Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootloader #2

Open
UncleBansh opened this issue Jul 28, 2019 · 79 comments
Open

Bootloader #2

UncleBansh opened this issue Jul 28, 2019 · 79 comments

Comments

@UncleBansh
Copy link

HI, bootloader has been erased. i cant flash with sd card, and cant connect over USB.
Can you share bootloader.bin with guide for flashing to recover my board?

@UncleBansh
Copy link
Author

UncleBansh commented Jul 29, 2019

yes, of course.
SKR-E3-SIP-bootloader.zip
there is.

flash from The address is 0x08000000

@UncleBansh
Copy link
Author

trhank you

@SSPW
Copy link

SSPW commented Sep 26, 2019

yes, of course.
SKR-E3-SIP-bootloader.zip
there is.

flash from The address is 0x08000000

is this bootloader for the RC or RE.
apparently E3 DIP is shipping with a 512K flash RE now, like i received

When i use this bootloader, the firmware is flashed.
But the firmware.bin file is not removed, so it reflashes every boot.
The FIRMWARE.CUR behaviour is unstable. Sometimes its missing.

@lococnc
Copy link

lococnc commented Sep 30, 2019

I found that with as many times as I have flashed the firmware that about 1 in 10 fails like described with endless beep and blank screen.
I formatted the SD card in my PC, then copied the files to it fresh and it will flash successfully. However it does occasionally not rename to .cur

@ghost
Copy link

ghost commented Oct 2, 2019

Here is the bootloader that came with my board that I received today, which shipped with an STM32F103RET6. In a hexdiff I noticed that it seems to be a different version of the one above but didn't look further into that.

SKR-E3-DIP-firmware-and-bootloader.zip

@Piscanc
Copy link

Piscanc commented Nov 1, 2019

Hi, anyone up for a challenge? ;D

i have similar problem... bricked board (rct6 variant).
board behavior:
status leds always on (both red and blue),not detected by PC, Ender3 screen only lit and buzzing, btt touchscreen not detecting the board (if reset pin inserted, screen goes in reset), sd slot not responding.
I can connect to it over st-link, but that is all i can do... it recognizes stm, reads the blocks, but they are empty.
from St-link Utility i get this
20:36:58 : Core is held in reset
20:36:58 : Error occured during program operation!
20:37:14 : Programmed memory Checksum: 0x00000000

from CubeProgrammer i first get flash memory protection, (after disabling it) i get failed to erase memory and lastly if i skip that... it hangs during writing in first block, i have to disconnect.
full log from connecting:
21:03:04:205 : STLinkUSBDriver.dll loaded
21:03:04:210 : STLinkUSBDriver.dll loaded
21:03:04:211 : ST-LINK SN : 51FF6C067871515223181867
21:03:04:212 : ST-LINK FW : V2J34S7
21:03:04:212 : Voltage : 3.22V
21:03:04:218 : SWD freq : 4000 KHz
21:03:04:219 : Connect mode: Hot Plug
21:03:04:222 : Reset mode : Hardware reset
21:03:04:553 : Device ID : 0x414
21:03:05:202 : flash loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x414.stldr is loaded
21:03:05:685 : UPLOADING OPTION BYTES DATA ...
21:03:05:686 : Bank : 0x00
21:03:05:687 : Address : 0x4002201c
21:03:05:688 : Size : 8 Bytes
21:03:05:689 : Reading data...
21:03:05:689 : r ap 0 @0x4002201C 0x00000008 bytes
21:03:05:691 : Bank : 0x01
21:03:05:691 : Address : 0x1ffff800
21:03:05:692 : Size : 16 Bytes
21:03:05:693 : Reading data...
21:03:05:694 : r ap 0 @0x1FFFF800 0x00000010 bytes
21:03:05:696 : UPLOADING OPTION BYTES DATA ...
21:03:05:697 : Bank : 0x00
21:03:05:698 : Address : 0x4002201c
21:03:05:699 : Size : 8 Bytes
21:03:05:700 : Reading data...
21:03:05:701 : r ap 0 @0x4002201C 0x00000008 bytes
21:03:05:703 : Bank : 0x01
21:03:05:703 : Address : 0x1ffff800
21:03:05:705 : Size : 16 Bytes
21:03:05:706 : Reading data...
21:03:05:707 : r ap 0 @0x1FFFF800 0x00000010 bytes
21:03:05:715 : UPLOADING ...
21:03:05:716 : Size : 1024 Bytes
21:03:05:716 : Address : 0x8000000
21:03:05:717 : Read progress:
21:03:05:718 : Reading data...
21:03:05:718 : r ap 0 @0x08000000 0x00000400 bytes
21:03:05:719 : Data read successfully
21:03:05:720 : Time elapsed during the read operation is: 00:00:00.012

full log from write attempt without skipping erase:
21:04:27:297 : Memory Programming ...
21:04:27:298 : Opening and parsing file: bootloader-bigtreetech-e3-dip.bin
21:04:27:299 : File : bootloader-bigtreetech-e3-dip.bin
21:04:27:300 : Size : 17096 Bytes
21:04:27:300 : Address : 0x08000000
21:04:27:302 : Erasing Segment <0> Address <0x08000000> Size <17096>Bytes
21:04:27:302 : Erasing memory corresponding to segment 0:
21:04:27:688 : Memory erase...
21:04:30:001 : halt ap 0
21:04:30:002 : w ap 0 reg 15 PC (0x20000000)
21:04:30:003 : w ap 0 reg 17 MSP (0x20000500)
21:04:30:006 : w ap 0 reg 16 xPSR (0x01000000)
21:04:30:023 : w ap 0 @0x20000960 0x00000200 bytes
21:04:30:030 : w ap 0 @0x20000000 0x00000004 bytes
21:04:30:033 : w ap 0 @0x20000004 0x0000053E bytes
21:04:30:034 : Erasing internal memory sectors [0 8]
21:04:30:035 : Init flashloader...
21:04:32:001 : halt ap 0
21:04:32:002 : halt ap 0
21:04:34:001 : w ap 0 reg 0 R0 0x00000001
21:04:34:002 : w ap 0 reg 1 R1 0x00000000
21:04:34:010 : w ap 0 reg 2 R2 0x00000000
21:04:34:017 : w ap 0 reg 3 R3 0x00000000
21:04:34:017 : w ap 0 reg 4 R4 0x00000000
21:04:34:017 : w ap 0 reg 5 R5 0x00000000
21:04:34:018 : w ap 0 reg 6 R6 0x00000000
21:04:34:018 : w ap 0 reg 7 R7 0x00000000
21:04:34:019 : w ap 0 reg 8 R8 0x00000000
21:04:34:019 : w ap 0 reg 9 R9 0x00000000
21:04:34:020 : w ap 0 reg 10 R10 0x00000000
21:04:34:020 : w ap 0 reg 11 R11 0x00000000
21:04:34:026 : w ap 0 reg 12 R12 0x00000000
21:04:34:027 : w ap 0 reg 13 SP 0x00000000
21:04:34:028 : w ap 0 reg 14 LR 0x20000001
21:04:34:028 : w ap 0 reg 15 PC 0x20000005
21:04:34:029 : w ap 0 reg 16 xPSR 0x01000000
21:04:34:029 : w ap 0 reg 17 MSP 0x2000093E
21:04:34:030 : w ap 0 reg 18 PSP 0x00000000
21:04:34:031 : run ap 0
21:04:36:000 : halt ap 0
21:04:36:001 : r ap 0 reg 0 R0 0x00000000
21:04:36:002 : Init function fail
21:04:36:012 : r ap 0 reg 16 xPSR 0x00000000
21:04:36:013 : Loader sector erase...
21:04:36:013 : Error: failed to erase memory
21:04:36:082 : Error: failed to erase memory

from what i can tell boot0 is in low state, but i dont see any way in changing that.
Is there any help for me, besides swaping parts?

ps: sorry for lengthy post

@TheAssassin
Copy link

For some reason, noone's posted their flash commands yet. I hope this will help people in the same situation.

I've struggled for 2 days with my board, which came without firmware and bootloader. Flashing didn't work, communication wasn't possible (USB wasn't even recognized), so I suspected a bootloader problem very early. I then hooked up some debugger (a black magic probe) and could run the software (via pio debug, just had to set a few things in the platformio.ini), however nothing else worked, and I was left with a board that I could only run by starting the software from another computer. A super annoying situation, especially since I had a brand new board.

I sourced an ST-Link v2 from a friend, and started working on the issue. After hooking it up to the SWD port on the board (luckily there's such a port, there's no other means for debugging, such as a UART interface for serial comunication) with four jumper cables (GND, 3.3V, SWDIO and SWCLK, make sure it's correct or the board won't be found!), I was able to flash the bootloader + firmware from the zip archive provided above.

For flashing on Linux, I can recommend using stlink, a free/open source tool that can flash STM32 chips over SWD. I struggled a bit finding the start address, which is very important if you have .bin files and not .hex (the latter provides such information already). With the wrong start address, st-flash just prints Unknown memory region, which doesn't really help.

The following command worked, flashing went pretty uneventful:

> st-flash write firmware-bigtreetech-e3-dip-stock-with-bootloader.bin 0x8000000
st-flash 1.5.1-47-g2901826
2019-11-04T15:21:45 INFO common.c: Loading device parameters....
2019-11-04T15:21:45 INFO common.c: Device connected is: F1 High-density device, id 0x10036414
2019-11-04T15:21:45 INFO common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 2048 bytes
2019-11-04T15:21:45 INFO common.c: Ignoring 279996 bytes of 0xff at end of file
2019-11-04T15:21:45 INFO common.c: Attempting to write 244292 (0x3ba44) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0803b800 erased
2019-11-04T15:21:47 INFO common.c: Finished erasing 120 pages of 2048 (0x800) bytes
2019-11-04T15:21:47 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-11-04T15:21:47 INFO flash_loader.c: Successfully loaded flash loader in sram
120/120 pages written
2019-11-04T15:21:57 INFO common.c: Starting verification of write complete
2019-11-04T15:21:59 INFO common.c: Flash written and verified! jolly good!

The start address 0x8000000 is where the bootloader starts. It occupies 0x4000 bytes (16kiB), so naturally, the actual firmware starts at 0x8004000. Since we need the bootloader as well, we need to flash it there. You can just flash the bootloader if you plan to use your own firmware, too, it's sufficient.

It's disappointing @bigtreetech didn't chime in in this discussion, providing the missing bootloader + firmware and instructions. @bigtreetech your boards are praised on the Internet, I hope your quality assurance is going to be improved. Boards without a firmware are one thing, but boards without a bootloader are really annoying. You need to invest time and money in order to fix them, and that shouldn't be required.

P.S.: Huge thanks to @thubot for providing the original firmware. I suspect you read it out with an ST-Link v2 programmer as well. After finding the right command, I could flash it just fine with an ST-Link v2 and stlink. The bootloader then worked as intended, flashing a custom Marlin build worked fine from the SD card, the blue LED was flashing just fine, the file was renamed and after fixing my Marlin config, I could communicate with the board via USB and a serial console (using the excellent tio, which I can really recommend for serial communication, it's a life saver!) as expected. I'm going to plug everything in again and will try it out asap!

P.P.S.: @Piscanc try my instructions on a Linux computer (a live CD will work just fine), I hope you can get your board flashed as well.

P.P.P.S.: If you don't have an ST-Link v2 and don't want to invest 2-3 bucks for a cheap Chinese one, please look for the next FabLab or Hackerspace, they most likely have one and they can probably help you flashing it!

@Piscanc
Copy link

Piscanc commented Nov 4, 2019

@TheAssassin thank you for your notice. I must confess, i´m not "sw" person... i would rather cut peace of something few times, than making 3d model... if you know what i mean, but i am trying...
I managed to get st-link 1.5.1 on ubuntu live 19.04, but i get same Unknown memory region :(
getting your git link version running is beyond me, al least without more detailed guidance...

to get it in the open...
i got 3.5tft v2.0 (i presume that those who have it, know what i mean) and this board on the local "flee" market(eu)... but at last this board was sold as non-communicating... and was warned, but i rolled the dice. Thinking if i managed to get tft working (presumably, no way to test it atm), loading up this board would be walk in the park. It has everything clearly labeled, it read it right up, just...

to sum up, i have st-linkv2 directly from farrnell, so it should be god,
stm32 chip is recognized/connected in windows and in linux,
basic st-utility stops at core is held in reset, or freezes if i skip erasing or verify
bit more "comprehensive" Cube programmer does the same, first it complains that its read protected, then it fails to erase memory, if i disable protection there it freezes again. i would understand if something was written in the blocks, but all are 0.
would this say bad chip or empty chip? am i missing something obvious? you cant write, if you cant erase.

i am not going to trouble of obtaining it and swapping chips...

PS: tnx to every one who participates :)

@TheAssassin
Copy link

TheAssassin commented Nov 4, 2019

Please post your command and your log of st-link on Ubuntu, @Piscanc. Probably just a usage error. We must get your board to work. Mine's printing now just fine in my Ender-2 (despite the display isn't working, might need to get an ender-3 one).

P.S.: Also try running the st-info tool with --probe and post the output. "Unknown memory region" already shows that you connected it just fine, which is a good sign. The --probe switch shows some information on your board, which are very important for "remote debugging".

P.P.S.: I don't use the Windows tool, and find command line tools on Linux easier. But that doesn't mean flashing with the Windows tools can't work, I bet you can get it going somehow.

P.P.P.S.: That write lock seems to be caused by you using a wrong start address. I doubt it's "bad chip", if that were the case you most likely couldn't communicate with it at all.
You should document your work much better. Make screenshots, post them here. I'm mostly guessing right now. The more info, the better I can help you.

@Piscanc
Copy link

Piscanc commented Nov 5, 2019

@TheAssassin
ubuntu@ubuntu:/Downloads$ st-info --probe
Found 1 stlink programmers
serial: 513f6c067871515223181867
openocd: "\x51\x3f\x6c\x06\x78\x71\x51\x52\x23\x18\x18\x67"
flash: 0 (pagesize: 2048)
sram: 65536
chipid: 0x0414
descr: F1 High-density device
ubuntu@ubuntu:
/Downloads$ st-flash write firmware-bigtreetech-e3-dip-stock-with-bootloader.bin 0x8000000
st-flash 1.5.1
2019-11-05T18:51:50 INFO common.c: Loading device parameters....
2019-11-05T18:51:50 INFO common.c: Device connected is: F1 High-density device, id 0x10036414
2019-11-05T18:51:50 INFO common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in pages of 2048 bytes
Unknown memory region
ubuntu@ubuntu:~/Downloads$ sudo st-flash write firmware-bigtreetech-e3-dip-stock-with-bootloader.bin 0x8000000st-flash 1.5.1
2019-11-05T18:52:02 INFO common.c: Loading device parameters....
2019-11-05T18:52:03 INFO common.c: Device connected is: F1 High-density device, id 0x10036414
2019-11-05T18:52:03 INFO common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in pages of 2048 bytes
Unknown memory region

hope it helps...

@TheAssassin
Copy link

flash: 0 (pagesize: 2048)

2019-11-05T18:52:03 INFO common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in

That doesn't look good indeed. The value of "flash" should be 256KiB or 512KiB at least. It might indeed be a faulty chip.

Can you read what's printed on the chip?

@Piscanc
Copy link

Piscanc commented Nov 5, 2019

STM32F103
RCT6
99222 98
MYS 99 837

@TheAssassin
Copy link

You can try one last time with the one in the zip provided here. But to be honest, this looks like your chip is faulty.

You can, however, try to ask in the stlink issue tracker about the flash being 0 bytes. Perhaps it's just a software bug.

@Piscanc
Copy link

Piscanc commented Nov 5, 2019

Tried that... even tried wrog one ment for 2209, just to see. But same problem...

Now was it because of shipping, esd, or sun flare... or error during first initial firmware load? Witch was done with SD provided.

@TheAssassin
Copy link

Now was it because of shipping, esd, or sun flare... or error during first initial firmware load? Witch was done with SD provided.

I doubt it's your fault. I also doubt you ever succeeded in flashing firmware. I mean, your board likely has been lacking a bootloader to begin with. The bootloader is the piece of software that is loaded first, and that flashes the actual firmware from the SD card. When it's missing, the board is pretty much "dead".

@Piscanc
Copy link

Piscanc commented Nov 5, 2019

:) agree, that i didnt mess up the board, because it was too broken to begin with.
but i could make an argument that every chip is "born" empty, we just lack skill/equipment to do so...

@TheAssassin
Copy link

The flash parameter is the size of the space you can flash. If it displays 0, it means you can't write to it. That's clearly an issue with the hardware. Check my log, it tells the flash size is 512 kiB (I got a newer chip which has a larger flash area, yours should show 256 kiB as per the specification).

@sl1pkn07
Copy link

thi @TheAssassin . the RET6 bootloader can't flash the firmware into the E3DIP (RET6 unit) if is more greather than 256KB (like the "official" mcu capacity have), rigth?

any tip (with commands if is possible (and linux xd)) for do it?

my firmware is more tan 256K and if put it into the SD card and reboot, do nothing (uppercase/lowercase test)

greetings

@TheAssassin
Copy link

TheAssassin commented Nov 15, 2019

thi @TheAssassin . the RET6 bootloader can't flash the firmware into the E3DIP (RET6 unit) if is more greather than 256KB (like the "official" mcu capacity have), rigth?

I've just flashed the bootloader provided in that comment. The bootloader itself is just 16 kiB, what you talk about is the ROM size including the firmware (but even that is smaller than 256 kiB).

It could be that the bootloader doesn't want to flash your firmware, but flashing is definitely possible over the SWD pins. Unfortunately, we can't change the bootloader, we didn't even get an official binary, someone had to read out theirs from the board. But I'd try to trim down the firmware. Otherwise you need an ST-Link v2 (clone) (a bluepill board might work as well, there's guides on the Internet how to use them as ST-Link v2). I can look up the command later if you have access to an ST-Link v2.

After having gone through all of this, I already thought about trying to write my own bootloader that flashes from the SD card. There's examples on the Internet how to do so.

By the way, I believe the reason that their upstream bootloader refuses to flash firmwares with > 256 kiB even when you have a RET6 is that they just use the same one for all boards. I assume there were no more RCT6s and they simply took the next size to continue manufacturing. When you have more than one chip with different flash sizes, you have to write your bootloader so that it works on all chips, right?

@sl1pkn07
Copy link

sl1pkn07 commented Nov 15, 2019

is possible use this one https://github.com/DAlexis/stm32-usb-bootloader instead the official (in RET6 units)? seems have the same options like the official one (update from USB (treated as storage mass when conect to pc) and from SD card. and is native RET6 mcu

the unique thing different, is the name of the firmware, but is possible change it

and i have a clone STlink.v2 (MarlinFirmware/Marlin#15890 (comment))

greetings

@TheAssassin
Copy link

I haven't tried that. In theory any STM32 bootloader should work.

@sl1pkn07
Copy link

is strange. just build (and do some changes about spaces in the namepaths i the build script and cmakefile), with gcc-none-eabi 9.2.0 (ship by my distro) and get a 510KB file? is normal?

@TheAssassin
Copy link

TheAssassin commented Nov 16, 2019

Don't know what you're building there. I'm using https://github.com/TheAssassin/Marlin-Ender2-SKR-E3-DIP, and end up with a file size of 210 kiB or so... Just use platformio, it comes with the right compilers.

@sl1pkn07
Copy link

sl1pkn07 commented Nov 16, 2019

I talk about build that bootloader i posted. the builded bootloader have 510Kb

Screenshot_20191116_094136

@TheAssassin
Copy link

Strange, when I build this using that script, I end up with much smaller files:

> du -sh build/*/*.bin
48K	build/debug/usb-bootloader.bin
48K	build/release/usb-bootloader.bin

@sl1pkn07
Copy link

Screenshot_20191116_201242

mmmm

@TheAssassin
Copy link

Use the script.

In any case, this is all way off topic. If you have further questions, please consider reaching out to me via IRC on FreeNode.

@sl1pkn07
Copy link

my screenshot is taked from CMakeCache.txt loaded from the build.sh script

@wisesokol
Copy link

I will release a detailed video very soon. Wait a couple of days

@penright
Copy link

I will release a detailed video very soon. Wait a couple of days

Cool. I have been playing with the "flashing", now and I thought I had a bad STLink-V2. When I plug it in, windows does not understand the device. I have installed the ST drivers. I found where you can flash a Blue Pill. I can connect to it serially and flash it whit the hex file provided which may or may not be right. But when I try and connect to use it USB, same thing. I am ordering one more clone and a Nucleo. Thanks for documenting this process.

@penright
Copy link

I will release a detailed video very soon. Wait a couple of days
If you tell me to hold my horses, I understand ...
Excited about the video, but meanwhile, I have been playing around. I think I am starting to understand. Looking at the schematics for the E3 DIP. The Boot0 is hardwired low. Am I right in saying to use either the serial (USB) or SW (STLink) that has to be high? How do you do that? Looks like the Boot1 (P2) is the Z DIR, if yes, reading print straight up, reader header, right before the EN for the extruder. Am I getting close?
I did get my Blue Pill flashed, then updated, and now windows see it when plugged in and so does the cube programmer. Progress.

@wisesokol
Copy link

wisesokol commented Jul 23, 2020

Hi All.
Video is done.
https://youtu.be/w2hJrD5voBY

@abtx
Copy link

abtx commented Aug 1, 2020

Any tutorial on how to flash the board? I've got BTT SKR Mini E3 V1.2 and it seems bricked.

@wisesokol
Copy link

Any tutorial on how to flash the board? I've got BTT SKR Mini E3 V1.2 and it seems bricked.

See my video. Link in my post upper

@abtx
Copy link

abtx commented Aug 2, 2020

@wisesokol thanks but the link doesn't seem to link to anything. Can you check it please?

@wisesokol
Copy link

@wisesokol thanks but the link doesn't seem to link to anything. Can you check it please?
Shit linker!!!!

https://youtu.be/w2hJrD5voBY
Copy and paste in to browser

@limestone-xyz
Copy link

limestone-xyz commented Nov 27, 2020

Hey, I've been trying to follow the instructions in the video, but when I try to erase with the Cubeprogrammer, it says it is protected. When I try to overwrite the "Write-Protection" option bytes, cubeprogrammer freezes and nothing happens until I unplug the STLink. Any hint on what I can try / have to do?
@wisesokol & @TheAssassin maybe?
Thanks!

@wisesokol
Copy link

Use st link utility, not cube. Also you can take some mistakes when soldering.

@limestone-xyz
Copy link

limestone-xyz commented Nov 27, 2020

Also tried with the ST-link software, it is the same problem.
I did not change anything by now, using the programmer on the stock board.

@wisesokol
Copy link

Original bootloader maybe protect to write. Try write only program’s part. Use address from my video

@limestone-xyz
Copy link

Yeah the option bytes are on "protected", but I can't overwrite them. If I try, the programmer software freezes until I unplug the STLink. I also tried just writing, but it doesn't work. Any more thoughts what could be wrong?

@TheAssassin
Copy link

You could at least post the command you're trying to flash with. Right now, all this is just guesswork. You probably know that you didn't post anything concrete that would allow one to help you. Not even a screenshot, showing what you entered in the tools.

Here's something to read for you: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

There's indications in this thread that such "write blocked" errors might show up if you're writing in the wrong range (i.e., have the wrong start address), and a lot more hints. The addresses must be correct. See https://github.com/bigtreetech/BIGTREETECH-SKR-E3-DIP-V1.0/issues/2#issuecomment-549424516,https://github.com/bigtreetech/BIGTREETECH-SKR-E3-DIP-V1.0/issues/2#issuecomment-549600690, ...

Perhaps you also have a faulty chip? Who knows?

You could also try st-flash on some Linux, which worked for me.

Pinging me and @wisesokol but then failing to provide any evidence that could help us help you is really presuming. Provide some information, then we'll have a look again.

@wisesokol
Copy link

@TheAssassin is right. what do you want to get? Reload firmware with sd card. Our issue for ret6 chip. Maybe your board has rct chip with 250kb of flash.

@limestone-xyz
Copy link

limestone-xyz commented Nov 28, 2020

Thanks for the reply - I've learned my lesson.
I'll write up what I know and report back.

@limestone-xyz
Copy link

limestone-xyz commented Nov 28, 2020

So this is my situation:
Ender-3 with BTT SKR MINI E3 1.2 and stock LCD.
I’m pretty much a novice when it comes to MCU.
My Chip is a: ARMx STM32F103, RCT6, 99036 93, MYS 99 948
PXL_20201128_154531287

After around 7 months of use I lost connection to Octoprint after a successful print and the stock LCD turned blue. I couldn't get anything to work after that, the firmware.bin didn't get flashed/overwritten anymore and I couldn’t get any connection to the board, no reset no nothing. Only the Power led is lighting up and the LCD is flat blue.
Exactly like the issue described here: bigtreetech/BIGTREETECH-SKR-mini-E3#224

I then measured/probed all the hardware parts on my printer, from the PSU safety ground to the hot end thermistor, to at least rule out a hardware defect. Everything is okay.
After reading up on the topic, I came to the conclusion that it might be a faulty chip or bootloader and found this thread.

I’m on WIN10 and tried using both the STM32CubeProgrammer and ST-Link Utility. I made sure to follow the instructions of @wisesokol video as closely as I could - as I don’t understand any russian.
He is using the “normal” mode when connecting - but that doesn’t work for me. I have tried using all the reset modes, but always get the following error:
STM32_ST-LINK_Utility_5sYTi3gPRW

I can only connect in the “hot plug” mode and get an "unknown flash size". Like mentioned by @Piscanc here: #2 (comment)
And as far as we know, he couldn’t figure it out / it’s a dead chip.

When I connect via the hot plug mode (using the addresses you @TheAssassin provided). I get basically - as far as I can tell - nothing:
STM32_ST-LINK_Utility_Qy7cEdWqtu
STM32_ST-LINK_Utility_RkRWR6tFhH

Any help is greatly appreciated.

@TheAssassin
Copy link

Well, worst case, your chip is faulty. I wonder why you received a board with an RCT6; back when I got mine, they shipped the larger RET6 already. It could be a large variety of issues, most of which are impossible to prove without specialized equipment: electrostatic discharge, overvoltage burn, memory corruption, faulty connection on the PCB, ...

One interesting detail, which was missing before, is that this failure occurred after months of usage. In my case (and most others'), the issue was that the thing came without any firmware or bootloader at all.

As I'm not familiar with this ST-Link tool (I use st-flash from the commandline, which is a bit more helpful IMO), I can't tell what the exact problem is. @wisesokol might be able to spot an error. The chip is recognized, so I don't think it's entirely dead.

A few things you can try:

  • lower the bus speed of the ST-Link V2, as the tool suggests
  • don't flash the bootloader, but flash only the firmware (if that works, that might bring you forward; I posted the address somewhere above)
  • try to run Marlin in a debugger (worked for me, not a persistent option, but you don't need a bootloader to run the firmware then)
  • make sure all electric connections are okay (you can hook up an oscilloscope, if available, to see if all the signals are clean)
  • make sure the chip is powered with the right voltage (measure the voltage after the regulator that powers the chip, not the pins of the chip (could easily create a short circuit!))

As it used to work and suddenly stopped working, I have little faith you'll be able to rescue this without serious electronics engineering skills (which I also don't have, I'm more of a software person). My best guess is that something on the board just broke. Bad luck. You could probably try to get a new board from the manufacturer.

@wisesokol
Copy link

I think your chip is broken. There is no information about the memory size. Only st link must be connected to the Board via swd 5 wires.

@Piscanc
Copy link

Piscanc commented Nov 28, 2020

my board still sits broken to prity much same level as yours right now.
powers on, but sits in reset state with read out protection.
I get your first error when connecting to unpowered board, rest is the same.
it got shocked with 5V over usb?

@TheAssassin
Copy link

Only st link must be connected to the Board via swd 5 wires.

Well, you can normally also flash if powered otherwise, but it's certainly better to unplug everything (ideally take the board out), then hook up the ST-Link.

Why 5 wires, though? Shouldn't it be four? (I haven't worked with it in a while, but I think it was IO, clock, ground and Vin.)

@wisesokol
Copy link

I use rst(reset) pin too.

@TheAssassin
Copy link

Ah, yeah, that makes sense.

@wisesokol
Copy link

There seems to be a common problem when using octoprint. Maybe 5v break chip.

@TheAssassin
Copy link

Don't think so. First of all, chances are they use an external chip to handle the USB connection. And even then, it must withstand a permanent USB connection, or it's useless...

@limestone-xyz
Copy link

limestone-xyz commented Nov 30, 2020

I've got a new replacement e3 V2 board for now (also has got an RCT6). But I will try to test a little more on my "bricked" one. I'll report back, if I can find anything.

EDIT:
I found the cause of my problem at least, and have heard form others with the same experience.
Two of my SKR mini E3 V2.0 were bricked by an electrostatic discharge of myself. I just found out because I heard a clicking sound doing some calibration prints and wanting to remove filament residue, but not even touching anything - I just came near. This board then had the exact same issue like the ones before.

So if anyone has the same issue with the board as I had (blank screen, no serial connection/octoprint, can't read MC with STLink), it quite possibly came from an ESD and bricked the MCU/electronics.
So be sure to:

  • ground yourself before doing something on the printer, regardless where
  • use an esd-bracelet
  • don't keep the room humidity too low

@Urasik-65
Copy link

у Квадрокоптера MJX Bugs 4w 4K слетела прошивка. на STM 32F103RCT6
Где найти прошивку чтобы квадрокоптер снова заработал
Помогите!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests