Embedded Software & Hardware

embedded The Web

openOCD ARM STM32F103VET6

https://www.elektroda.pl/rtvforum/topic3054068.html
Podobnie jak wczesniej do programowania uzywam polecenia:

openocd.exe -f board/stm32f4discovery.cfg -c init -c halt -c "flash write_image erase ${project_name}.elf" -c reset -c shutdown

To powinno zadzialac:

openocd.exe -f board/stm32f4discovery.cfg -c init -c targets -c "reset halt" -c "flash write_image erase ${project_name}.elf" -c "verify_image ${project_name}.elf" -c "reset run" -c shutdown


Na koncu zamiast "reset" uzyj "reset run".

Download pre-built Windows version:

https://gnutoolchains.com/arm-eabi/openocd/

Windows 10 - install WinUSB driver - UsbDriverTool.exe

http://sysprogs.com/getfile/413/UsbDriverTool-2.0.exe

./bin/openocd.exe -f jtag_aok.cfg -f share/openocd/scripts/board/stm32f103c8_blue_pill.cfg

Content jtag_aok.cfg file:

-----------------
interface ftdi
ftdi_vid_pid 0x0403 0x6014
ftdi_layout_init 0x8c28 0xff3b
ftdi_layout_signal SWD_EN -ndata 0x0020 -oe 0x2000
ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400
ftdi_layout_signal nSRST -data 0x0200 -noe 0x0800
ftdi_layout_signal SWDIO_OE -ndata 0x1000
ftdi_layout_signal LED -ndata 0x8000



http://openocd.org/doc/html/General-Commands.html



telnet localhost 4444


commands:

Memory Dump Byte

mdb 0x20000000 0x10


Memory Write Byte

mwb 0x20000000 0xAA


Display registers

reg


Display single register

reg r0

halt

resume

reset


Dump memory from address 0, size 0x80000 (512 k) and save to rom.bin.

dump_image rom.bin 0 0x80000




Start openOCD



Connect to openOCD on port 4444






command
reg




halt
reg




reset halt
PC counter: 0x080001F0




dump_image






arm-none-eabi-gcc test.c

exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status

non-semihosting/retarget

arm-none-eabi-gcc test.c -specs=nosys.specs

https://stackoverflow.com/questions/19419782/exit-c-text0x18-undefined-reference-to-exit-when-using-arm-none-eabi-gcc

Blinking LED

https://blog.danman.eu/blinking-led-on-stm32f103-with-only-linux-tools/
STM32F103VHB6_RevZ_Demo1_Lanchon_20080210
http://www.yagarto.org/

SEGGER Embedded Studio (powerful C/C++ IDE for ARM microcontrollers, free for non-commercial use)
Raspberry Pi and OpenOCD https://iosoft.blog/2019/01/28/raspberry-pi-openocd/


© 2003-2017 Andrzej Okrutny, Krakow POLSKA