November 08, 2024, 08:07:50 PM

STM32F103 Olimex Bootloader Help

Started by Banzai, September 26, 2012, 12:38:51 AM

Previous topic - Next topic

Banzai

Hi Guys,

while playing around with the STM32-Maple-Clone I use CooCox to flash a new program.
Jipee, that works  ;D!
...but only one times  :(!
Now I have no bootloader anymore and the board cannot flashed with the ARM-Tiny-H JTAG anymore.  :-[

I've try to flash a new bootloader from http://leaflabs.com/docs/bootloader.html, using the guide on this site and kill my nervs while installing the whole python stuff  >:(. The script runs and ends with 'Verification OK'  ;D. I use all available bootloader bin's (except the 'Mini').

Long story short: The board is dead  :'( ! The LED1 lights up and nothing more....  :o. I can't reset the board by BUTton nor flashing software with MapleIDE, because the board is not recognized to a serial port.

Is there a 'Olimex'-Bootloader for download and/or a special 'how to' for flashing the board to default factory settings?

I hope somebody can give me advise...

Best Regards

Banzai

(Excuse my very bad english, I'm an old german man and tired about learning better english)

LubOlimex

I uploaded some goodies here:  https://docs.google.com/file/d/0B7WHuNCASY8cTWU0VkZCY3RPUkk/edit - "File -> Download" to get the whole .zip. Use prodTest_OLIMEXINO-STM32.hex to just upload the code we use here during production test.

Regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Banzai

Many thanks... I must try.

What 'way' I should go?
My first experience was to flash with CooCox/CoFlash and ARM-USB-TINY-H. Must I use the 'preboot'-mode on the board before flashing the .hex-file?
Or is there a way to flash the prodTest_OLIMEXINO-STM32.hex over RS232/UART with the FTDI Breakoutboard?
Think this works only for bin-files, so can I flash the 'maple_boot.bin' from your docs.google site?
The same named file from LeafLabs http://static.leaflabs.com/pub/leaflabs/maple-bootloader/maple_boot.bin is not working.

Sorry, so many questions.
I came from Atmel-8bit and thought there is a short way to STM32 (only 24bits away... ;)). So much to learn and so less I know.

Thank you in advance

Banzai

LubOlimex

If you just want to restore the bootloader use a program that flashes the chip using the .hex I uploaded (the one in the top level folder). I suggest to use http://www.coocox.org/CoFlash_Programmer.htm; the CoFlash programmer software can be also downloaded from the CooCox download manager. Just import the hex, select the board and the programmer and flash.

Note that the connector on OLIMEXINO-STM32 is the small one and you will need adapter:https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-20-10/.

Before trying the hardware reflash please ensure that you have actually managed to kill the bootloader - if there is no activity - plug the board to the USB while holding the button and then release it. If that is the case then the bootloader is intact and you have just overwritten the blink led demo program.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Banzai

Thanks for the patience and help, but...

...sorry, nothing works  :( :( :( :( :( :(.

1.) CoFlash doesnt supports hex-files, only bin or elf. So I use the CoIDE-Blinky-Demo to build a bin file.
2.) CoFlash returns 'Can NOT Stop MCU!!' when I try to flash the demo from CoIDE. I know that works one times, because that was the reason the board 'dies'.
3.) Try to 'Reset' per Button while flashing -> no effect.
4.) Try HW_RESET, VECTREST and SYSRESETREQ -> no effect
5.) Doesn't matter which button I press while plug in USB. Board is dead.

To my shame, I have a 'selfmade' 20/10 Adapter, because the german distributor for the Olimex STM32 don't have that adapter. I use the schematic eagle pdf from the olimex pages (https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-20-10/resources/ARM-JTAG-20-10-schematic.pdf) using no resistors because no values given in schematic.

Any ideas to reactivate the board to 'normal' state? Close/Open a jumper, take 20000Volt to power line or a prayer to god(s)?

Thank you very much

Banzai

LubOlimex

Can you try with this bin: https://docs.google.com/open?id=0B7WHuNCASY8cdW8yVzNwdTF5OWs ? Generated with the same project. Hope it works this time.

Regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Banzai

Dear lubolimex,

many thanks for your help, but CoFlash always ends with 'Can NOT Stop MCU'.
I used your kindly prepared file from previous post.

I've being trying serveral Reset-Types and Clocks and combinations of 'Auto Erase', 'Auto verify' and 'Run Programm'.

Pressing RST before, meanwhile or short time after pressing 'Program'-Button has no effect (NO LED blink or On/Off).

I check my 20to10-Adapter and cable from adapter to board with a tester and all lines are ok.

Think the 20€ are waste.... so I must buy a new ones, or do you have a 'cheaper' solution?

Best regards

Banzai

LubOlimex

Hello again Banzai,

I tested again the bin file from my previous post with OLIMEXINO-STM32, ARM-USB-TINY-H + ARM-JTAG 20-10 and CoFlash. It worked fine here - check these pictures for the settings I used: http://i.imgur.com/OTqLp.png, http://i.imgur.com/sCXVI.png.

Few points I noticed that might be problematic: you need only power and miniUSB connected if you have connected other peripherals, SD card, etc. please remove them; connect ARM-JTAG 20-10 directly to ARM-USB-TINY-H (replace the ribbon cable); be sure that you have connected it in the correct direction to the board's JTAG connector - the bud on the 20-10 connector should face the near board edge (!); make sure you have used the correct FTDI drivers - https://www.olimex.com/Products/ARM/JTAG/_resources/driver-ftd2xx.zip.

Regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Banzai

Hello lubolimex,

first, I have a selfmade 20to10 with a male connector for the cable, that has two female connectors.
So I can't connect directly to the adapter. In this case, I must 'build' a matching adapter board first.

I connected miniUSB + Power (12V) + JTAG and removed SD-Card. No other peripherie is connected anymore.
I use the settings you have posted, but I only can choose 'Olimex-OpenOCD' instead of a 'Olimex' in the Adapter selection. Think that means the same, but I'm not sure....

I get a red 'Can NOT Stop MCU!'  >:(, but no green 'Program Done' like in your pictures.

In my opinion the problem is to get the CPU (MCU) in a 'writable' state after pressing the RST-button or over the RST-pin from JTAG, but I flash a program that stuck the CPU in a 'deadlock'. Unfortunately, I can not check the signals on cable or board.

Think I will buy a new ones from 'watterott', the german distributor and send you (or to olimex?) the board via postmail in a soft-envelope, no insurance. Than you can play around with the board and maybe help others (or me again  ;) ) with similar problems.

Many Thanks from Germany for your patience.

Banzai

georgekk

Здравейте,

Днес изгубих доста време за да флашна bootloader на наскоро закупената от вас платка OLIMEXINO-STM32. Затова моля приемете моето предложение и сложете LINK с директен достъп до prodTest_OLIMEXINO.bin на
https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/open-source-hardware
Това е единствения компилиран boot които работи.

Както видях проекта MAPLE не се поддържа активно и всички bootloaders по нета не работят.
( Визирам http://leaflabs.com/docs/bootloader.html )
Под "не работят" разбирам, че при включване се обявява MAPLE003 ( USB-то), но не и серийния порт.

Поздрави.
Георги Кирчев
ZEK Engineering.



dongfang

Hi,
I can flash a Maple bootloader with ST's Flash Loader Demo tool. Absolutely Python free.
It's a Windows app. Make a serial connection to UART1 on the board, and hold that "BUT" bootloader button while pressing RESET. Now the program should be able to get through its comms check and you can select and flash the bootloader.
Regards
Soren

marcpaul

if you have the usb-tiny-h, openocd and the bootloader from the link above you can flash the new bootloader like:

openocd -f /opt/local/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg -f /opt/local/share/openocd/scripts/target/stm32f1x.cfg -c "init" -c "program <bootloaderfile>.hex verify reset"


<bootloaderfile> should be the name of the actual file

the path to the scripts is on mac os x with macports openocd install.. change this to the path where openocd is installed on your system..

after running the above command stm32 is resetting and running good old blinky demo :D

LubOlimex

Thanks for the input on the subject guys! Very helpful information indeed.

I've also uploaded the original bootloader here:https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/resources/OLIMEXINO_STM32_binaries.zip in case somebody needs it.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex