Skr1.4 flash over usb?

So I have a 1.4 turbo that I use for my E3. The other day the on board sd card failed. I can work around that with some firmware changes. Only issue is I can’t seem to flash it over USB. PlatformIO does not detect it when plugged in (it does show on my device manager on com 3).

My question. Has anyone flashed an skr 4.1 turbo over usb? Is it possible and if so can some one walk me through it?

I have “flashed” the skr 1.3 (not turbo not pro) over usb. But all it does it open the sd card as a usb drive and copy the firmware.bin to the sd card. Then you reboot and it loads from the sd card. That required a lot of work in marlin to make it work.

There are other programming interfaces. I used the uart to flash a new bootloader on a skr pro. I am pretty sure you can do the same with the turbo. But since it isn’t the path of least resistance, it will be poorly documented.

1 Like

Yeah I noticed how poorly documented it is. But I don’t have a lot of choice at the moment. I don’t have another board to put in it or the money to replace it (just had to buy a new TV after my son broke one).

I have seen some documentation on uploading to the SD card as you mentioned. But that will not work for me because the SD card is not working.

I have uploaded a bootloader before, but I don’t see how that helps me get new firmware (they are separate things I thought) onto the board, unless I’m missing somthing?

Thanks for the help Jeff, your the best!

This is my mental model of the firmware on arduino like microcontrollers:

There is a bootloader that runs every single boot. It decides if it should run the user’s firmware, or run itself.

If it decides to run itself, then you can talk to it and hand it new user code. If the transfer works, it will delete the old user code and put your new user code there. It won’t ever write over the bootloader program, no matter what you tell it. In a regular arduino, the arduino ide resets the controller and immediately tells the bootloader to stay on in flashing mode, and they talk to put new user code in the right place. On the skr boards, the bootloader reads the micro sd and if there is a firmware.bin, it does the same thing. The bootloader never changes.

If it decides to run the user code, it will run your program. It does this by default in a fraction of a second. It looks like you only have the user code on the microcontroller…

So, imagine if you have the bootloader at address 0. That always gets run. Then the user code starts at address 1000 (not real numbers). That only gets ran by the bootloader.

If you use the uart/isp to put your new code at 1000, then the bootloader will run it.

On older boards, like the atmega arduinos, you could also just put your code at 0. You wouldn’t be able to flash with the bootloader anymore, but your code wouldn’t care. A lot of the cheap 3D printers from China came “without a bootloader”. That’s what they meant. The user code started at 0, instead of having a bootloader first. They programmed these boards in china over ISP.

I am not that detail oriented, but I have seen some things that make me think these newer bootloaders are doing more now. They may be setting up some of the hardware and then calling address 1000 to start the user code. If that is true (and it is mostly speculation by me) then you will need to keep the bootloader and just flash to the user space.

I just barely scratch the surface of this stuff. There are a lot of very smart people that have a lot of experience with this kind of thing. They could probably read the datasheet and know how to do this in 5mins. So I would try to find help. Either from a troubleshooting post somewhere, or by asking in the right place with the right person (is that what you were hoping from here? :slight_smile:).

My guess is there is a simple command to flash new firmware to a specific address, and you just have to find that address.

Something like stmflasher firmware.bin 1000

(I can’t remember the name of the tool, and I don’t know the magic address).

2 Likes

@jeffeb3

I agree with your assessment, i made the post not sure if the bootloader would allow for direct flashing of user code (marlin) over usb or not. it appears the answer to that question is “Not”. witch leaves me with two options. either i can reflash the bootloader (witch should wipe out the existing user code in the process) to somthing that will allow flashing user code over USB (such as with most other 3d printer boards) or find a way to only over right the user code via a utility like you described in your post.

my experience flashing and interacting with bootloaders is pretty basic (i have fallowed online guides to flash bootloaders onto creality boards & the like). but i feel like this is a bit more involved than that. i have tried doing searches online but have come up short. i’m hoping someone on here will have the knowledge and skill to be able to help me get started on the right path.

does anyone have a link to some helpful information or a guide that could get me from “where do i start with this” to “ok i ran into this problem” (because there are always problems haha)?

thanks again for all that you do Jeff!

1 Like

Here is few infos of how to replace bootloader to usb bootloader for SKR Pro:

1 Like

sorry for so long without an update. i was able to find a new bootloader that allows for flashing over usb & from the screen SD. so hurray! but now i have run into another roadblock.

I of course needed to change marlin to use the screen SD rather than the board SD, and i figured while i was at it i would update to the most recent version of marlin. but here is the issue, when i flash the new firmware all i get is an endless reboot cycle. no com between the PC and the board. i had no error when compiling and i have no idea what is causing it. when i revert back to an older firmware version it boots up fine.

has anyone run into this kind of problem before? maybe one of the marlin super users out there have an idea of where my problem might be? any thoughts or ideas would be really helpful. i will throw up some pictures later today.

Hi Atom, could you please share your settings for uploading via USB?
All this “SD-Card back and forth” is quite painful, even if the bootloader is in place.

basically the goal should be to use Pronterface for some tests (which is working fine) invert the X-Achses (for instance) upload, try again, … tweak the firmware until it’s done :slight_smile:

I’ve been using VS-Code, PlatformIO, Marlin-Plugin, even added the COM-Port-Options to the PlatformIO Settings but the flashing via USB still causes errors.

Once this is solved, I’m happy to support on the Display-SD-Card-Issues. Probably something we could find in the DIFF of your Versions.

Best Regards
Robin

1 Like

@RobinBlood It’s not as simple as settings. The pre-installed bootloader on the skr 1.4 only allows flashing firmware from the on board SD card. To get around that I had to install a new bootloader (3rd party). I can try and find the link to the github with the new bootloader, but it’s a pretty involved process, unless your SD card reader dose not work I would not recommend it.

Also my problem is not with the screen, when I flash my new firmware the whole board gets stuck in a reboot cycle, no serial coms at all (so no terminal interface with ponterface or any other interface). It’s like when the OS on your computer gets corrupted and all that it does is restart itself over and over again.

That said I would welcome any help in looking over the firmware for the possible cause.

here is the github for the bootloader i installed. it has farily clear instructions if it is the route you want to take.

here is my config and advanced config. if anyone has time to look them over.
Marlin.zip (84.0 KB)

thanks,
Atom

I can’t imagine anything in the config files that would cause that. I don’t know every line, but that is very unexpected.

Does “stock” Marlin 2.0.9.2 work (after it has been configured for the board)?

Can you connect a serial program to it? Does it print anything? I think you can use putty. In Linux, I would use miniterm or screen. I am wondering if it prints one of those kill messages.

1 Like

i have a serial monitor on the ESP32 i have connected to it. when the power is on it wont even communicate with the board (no serial connection, almost like its not even running marlin).

i grabbed a precompiled copy of marlin from github (not sure what version but its not the most up to date) and when i flash it over it boots fine. so i know it has to be on my end (either an issue during compile or with my configs). i have not tried compiling a stock copy of the most recent release. but i will try that tonight and let you know. i will also plug in with the Arduino terminal and confirm no serial coms, i don’t currently have a Linux rig (well i might have an old one running Fedora core 4 but i dont want to pull out that dinosaur) but i find that the Arduino terminal is about as simple as it gets for windows.

thanks for the help,
Atom

Yeah. Since this makes no sense, my only way to figure it out is to split the problem and try to narrow it down. Using code someone else compiled (like the known hex files at MarlinBuilder releases), and trying a few versions of stock Marlin, and trying it with and without your config will tell us where to look.

That should totally work. No need to bring out an old Linux laptop. It may not send anything on the esp serial port if it isn’t configured (or it isn’t getting that far). It is just another shot in the dark.

1 Like

so new developments… I FIXED IT, YAY!.. turns out the issue was a faulty ribbon cable. on the ex2 plug. got it all up and runing now. thank you all for all the amazing help :slight_smile:

3 Likes