Bricked mainboard?

Post Reply
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Bricked mainboard?

Post by mjc506 »

I purchased a mainboard kit from the shop, it arrived, and was working fine.

Today, I made some small edits to the firmware and uploaded the binary, and now the 'alive' LED isn't flashing.

I powercycled the board, and tried to upload the original firmware, but this kept failing (the green LED on the esp would flash briefly, then a couple long flashes, then that's it). Occasionally it would start to upload, get to 10-20% on the web interface and hang (and eventually the esp would reset). Once it even managed to upload to 100%, but still the 'alive' LED isn't flashing.

I can't get my st-link to talk to the board either (although this may be an issue with the st-link itself, I'm not sure) to reflash the bootloader/firmware, but if I can even occasionally start a firmware upload, the bootloader should be ok? I've got the weird SWD connector on my board, but VCC and Ground are easy to identify, so I can't have got the connections too wrong... I read about SWD over the esp, but this doesn't seem to work either.

What've I done?!
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Bricked mainboard?

Post by johu »

Correct, a normal firmware upgrade cannot destroy the boot loader. If the flashed firmware is faulty you should see the alive LED come on briefly every 2 seconds. Unless the firmware fails at a really early stage.
It will basically cycle through the boot loader every 2 seconds and should allow for another update. If you have a UART<->USB adapter you can monitor the serial port that the ESP is normally connected to. It should output "2D" every 2 seconds. Or at least once at power up. If it only does the latter, you have to solder a small wire to reset (check schematic) and ground that. Then upload a valid firmware binary and release reset immediately after.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Bricked mainboard?

Post by mjc506 »

Thanks again :) I had 2D once on boot, so found reset and uploaded the original firmware that way. Perhaps I'll get my st-link working before playing with more firmware edits... Tomorrow's job!

Thank you!
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Bricked mainboard?

Post by mjc506 »

Weird. After st-flash'ing the original firmware and awakening the mainboard, I sent the same .bin over the web interface and it didn't come back up. St-flash again and all is well, and I flashed my edited firmware and that's fine too. It wouldn't be too bad to ignore the web interface uploader and just use st-flash, but the st-link doesn't work on my (linux) dev laptop, so I've dragged my windows desktop to the bench and just have to make, copy the files across, and flash by stlink. Ah well, it works at least :)
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Bricked mainboard?

Post by johu »

Are you maybe not using the right linker file? Firmware has to be linked to start at 0x08001000
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Bricked mainboard?

Post by mjc506 »

As far as I know! I've not touched the linker file, and the file flash successfully from a Windows machine. I may have upset the esp, so will probably reflash that at some point just in case. It's not the end of the world though, I still have a reliable flash method.
User avatar
thornogson
Posts: 60
Joined: Sun Mar 15, 2020 10:04 am
Location: United Kingdom
Been thanked: 1 time

Re: Bricked mainboard?

Post by thornogson »

mjc506 wrote: Sat Feb 13, 2021 5:24 pm I purchased a mainboard kit from the shop, it arrived, and was working fine.

Today, I made some small edits to the firmware and uploaded the binary, and now the 'alive' LED isn't flashing.

I powercycled the board, and tried to upload the original firmware, but this kept failing (the green LED on the esp would flash briefly, then a couple long flashes, then that's it). Occasionally it would start to upload, get to 10-20% on the web interface and hang (and eventually the esp would reset). Once it even managed to upload to 100%, but still the 'alive' LED isn't flashing.

I can't get my st-link to talk to the board either (although this may be an issue with the st-link itself, I'm not sure) to reflash the bootloader/firmware, but if I can even occasionally start a firmware upload, the bootloader should be ok? I've got the weird SWD connector on my board, but VCC and Ground are easy to identify, so I can't have got the connections too wrong... I read about SWD over the esp, but this doesn't seem to work either.

What've I done?!
Hi @mjc506 ,
I'm John in North Wales and I have the same problem with a new Auris board and my older board , did you find a solution ? this bit of the EV journey is a black hole to me but I'm learning fast !
I have SPlink talking to the STM , but although it tells me its updated , the webpage just hangs when I try to load the stm32_sine.bin or the FOC bin . I'm using the earlier olimex wifi module that came pre programmed with the original board. I have a wemos d1 that would fit on the board . Any help/comment welcome , cheers
We are all ignorant, just about different things. If y'aint learnin', y'aint livin'
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Bricked mainboard?

Post by mjc506 »

Sorry, been away for a while...

Yes, I 'revived' the board by reflashing with the STlink, and suspect my issue with the web updater was me renaming the binaries before uploading. Not gotten around to clearing the filesystem on the ESP yet, but there's a thread around here somewhere describing the issue and how to do it.
User avatar
mane2
Posts: 171
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 18 times
Been thanked: 6 times

Re: Bricked mainboard?

Post by mane2 »

I also had this problem yesterday. Made a change to stm32_sine and ran make (on MacOS). It completed succesfully and created stm32_sine.bin file. Uploaded that via web interface. After that, I can't see parameters or spot values. I guess wifi-board can't communicate to STM32 board anymore. I guess I need to open up the small drive unit and pull the card out? Or is there any other procedures that might fix this?

Also curious why the update failed. Web interface showed the progress bar, and it took a while to upload it, and it was successful.

Is it possible to have such an old web-interface firmware, that it does not talk to new STM32 firmware? My board is from 2018 or 2019 .. and haven't flashed or updated either of those after that.
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Bricked mainboard?

Post by johu »

There wasn't any change in protocol but at some point the boot loader enables the watchdog. This causes the STM32 to reset like every 2s if there is no valid firmware on there. And that allows you to have another go at flashing. Just try again with some "stock" firmware to try to recover.

If you do take the board out go straight for the newer bootloader that also supports updating via CAN https://github.com/jsphuebner/stm32-CANBootloader/
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mane2
Posts: 171
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 18 times
Been thanked: 6 times

Re: Bricked mainboard?

Post by mane2 »

johu wrote: Thu Aug 17, 2023 12:54 pm There wasn't any change in protocol but at some point the boot loader enables the watchdog. This causes the STM32 to reset like every 2s if there is no valid firmware on there. And that allows you to have another go at flashing. Just try again with some "stock" firmware to try to recover.

If you do take the board out go straight for the newer bootloader that also supports updating via CAN https://github.com/jsphuebner/stm32-CANBootloader/
Thanks. I tried to upload again but the progress bar does not move, and it almost immediately says complete. I can see the file get uploaded to esp8266 but it won’t get uploaded to stm32.

Maybe there is a JavaScript function that I could trigger from is console and get some logs back, to see what happens?
Post Reply