4
\$\begingroup\$

I have successfully installed and configured Eclipse for ARM development according to this excellent tutorial:

http://gnuarmeclipse.github.io/

Almost all the tutorials (including the one above) I have seen provide instructions on how to set up debugging, but I cannot figure out how to just load program to the flash memory without attaching the debugger (e.g. release version of the firmware).

One tutorial solves this problem by installing and calling st-link utility from Eclipse environment, but my current setup is already able to flash the MCU - why should I install anything else? I just want to make GDB flash the memory and exit.

So guys, how do you upload release versions of the firmware to your ARMs? Thank you for your suggestions :)

\$\endgroup\$
  • \$\begingroup\$ I use ST-Link. What is your 'current hardware' ? Are you talking about a bootloader? \$\endgroup\$ – Daniel Apr 4 '16 at 15:02
  • 1
    \$\begingroup\$ In your build selection, do you have "Debug" and "Release" configurations? \$\endgroup\$ – uint128_t Apr 4 '16 at 15:24
  • \$\begingroup\$ Currently I am working with STM32f429 discovery with integrated st-link debugger. I use both Debug and Release configurations. Now I realized the generic tutorial example Blinky uses ARM semihosting - this could be the reason why the program execution stops when I quit the debugger. \$\endgroup\$ – klasyc Apr 5 '16 at 6:52
7
\$\begingroup\$

Finally I found the solution myself:

  1. Disable semihosting - it seems when the firmware is loaded via OpenOCD, MCU detects that semihosting interface is available and after disconnecting of the debugger the MCU hangs when it tries to write the semihosting interface.

    To make firmware running again it is necessary to replug the ST-link USB connector or leave the debugger running all the time.

    I am not experienced in semihosting too much, therefore I just removed all semihosting debug messages to get rid of it :)

  2. In Eclipse go to Run -> Run Configurations...

    a) Make a copy of your Debug configuration.

    b) On the Debugger tab update Config options of OpenOCD like this:

    -f board/stm32f429discovery.cfg -c "program Debug/blinky.elf verify reset exit"
    

    (of course replace the board definition by your board and also replace the Debug/blinky.elf by your binary file name).

    c) On Startup page uncheck all the options to leave GDB alone.

    d) Save.

After doing the steps above, Eclipse will only program the board without running debugger.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.