Normally I use OpenOCD to flash firmware on my microcontrollers, but always use telnet to connect to openocd server in the port 4444.
Today I realized it is not necessary to use telnet to flash the firmware, I can do it from command line:
$ sudo openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
I used this command to flash the nuttx.bin firmware on STM32F103 Minimum board. This is the “openocd_stm32f1.cfg” config file content:
# STM32F103Minimum Board # Using stlink as SWD programmer source [find interface/stlink-v2.cfg] # SWD as transport transport select hla_swd # Use STM32F103C8 target set WORKAREASIZE 0x4000 source [find target/stm32f103c8t6.cfg]
Great tip! I use the following command line to also reset and run the target, and exit openocd:
$ sudo openocd -f openocd_stm32f1.cfg -c init -c “reset halt” -c “flash write_image erase nuttx.bin 0x08000000” -c “reset run” -c “exit”
Thank you Pelle! You tip just help me now!
I’m creating a Quality Assurance Farm test to compile NuttX using a Raspberry Pi board:
https://bitbucket.org/acassis/raspi-nuttx-farm/commits/ff5f023c234dcd2218565999216b769e597c1f2a