-
Notifications
You must be signed in to change notification settings - Fork 111
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
Comments
yes, of course. flash from The address is 0x08000000 |
trhank you |
is this bootloader for the RC or RE. When i use this bootloader, the firmware is flashed. |
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. |
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. |
Hi, anyone up for a challenge? ;D i have similar problem... bricked board (rct6 variant). 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 write attempt without skipping erase: from what i can tell boot0 is in low state, but i dont see any way in changing that. ps: sorry for lengthy post |
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 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 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 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! |
@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... to get it in the open... to sum up, i have st-linkv2 directly from farrnell, so it should be god, i am not going to trouble of obtaining it and swapping chips... PS: tnx to every one who participates :) |
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 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. |
@TheAssassin hope it helps... |
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? |
STM32F103 |
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. |
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. |
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". |
:) agree, that i didnt mess up the board, because it was too broken to begin with. |
The |
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 |
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? |
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 |
I haven't tried that. In theory any STM32 bootloader should work. |
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? |
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. |
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 |
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. |
my screenshot is taked from CMakeCache.txt loaded from the build.sh script |
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. |
|
Hi All. |
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 |
@wisesokol thanks but the link doesn't seem to link to anything. Can you check it please? |
https://youtu.be/w2hJrD5voBY |
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? |
Use st link utility, not cube. Also you can take some mistakes when soldering. |
Also tried with the ST-link software, it is the same problem. |
Original bootloader maybe protect to write. Try write only program’s part. Use address from my video |
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? |
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 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. |
@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. |
Thanks for the reply - I've learned my lesson. |
So this is my situation: 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. 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. 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. I can only connect in the “hot plug” mode and get an "unknown flash size". Like mentioned by @Piscanc here: #2 (comment) When I connect via the hot plug mode (using the addresses you @TheAssassin provided). I get basically - as far as I can tell - nothing: Any help is greatly appreciated. |
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 A few things you can try:
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. |
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. |
my board still sits broken to prity much same level as yours right now. |
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.) |
I use rst(reset) pin too. |
Ah, yeah, that makes sense. |
There seems to be a common problem when using octoprint. Maybe 5v break chip. |
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... |
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: 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.
|
у Квадрокоптера MJX Bugs 4w 4K слетела прошивка. на STM 32F103RCT6 |
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?
The text was updated successfully, but these errors were encountered: