eclipseembeddedarm

How to run my code on an ARM _without_ debugging?


I've been developing a project (in C) for an STM32F105, using the Eclipse IDE with CDT plugins. I'm using the gcc-arm toolchain, OpenOCD (gdb) for debugging, and an ST-Link/V2 JTAG device.

I've been debugging on my target board, no problems.

Now, I finally want the code to run by itself, and I don't know how to do it in Eclipse! I'm sure it's simple, but I can't find it.

How do I build the code and program my target so that it runs "normally"?


Solution

  • Configure OpenOCD as external tool and use arguments more or less like these:

    -f interface/... -f target/... -c "init; reset init; flash write_image erase <your_hex_file.hex>; reset run; shutdown;"

    or, by using the program command which is equivalent to the above:

    -f interface/... -f target/... -c "program <your_hex_file.hex> reset exit"

    You should of course adapt this command to your project: enter proper interface and target configs and set right name of hex file (you can also use .bin or .elf, but .hex is usually the most convenient).

    In the "Working Directory" textbox enter your project directory - use "Browse Workspace" to do that, you should have sth like this there: ${workspace_loc:/<name_of_your_project>}