NucleoのCN4ピンアサイン
1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|
VDD_TARGET | SWCLK | GND | SWDIO | NRST | SWO(Reserve) |
ジャンパ配線
U9へ書き込む場合
Nucleo | yatagarasu V2 |
---|---|
1赤(VDD_TARGET) | SWS_V_G_1 |
2青(SWCLK) | SWD1_CONN1_1 |
3黒(GND) | SWD_V_G_2 |
4黄(SWIO) | SWD1_CONN1_2 |
U11へ書き込む場合
Nucleo | yatagarasu V2 |
---|---|
1赤(VDD_TARGET) | SWS_V_G_1 |
2青(SWCLK) | SWD2_CONN_1 |
3黒(GND) | SWD_V_G_2 |
4黄(SWIO) | SWD2_CONN1_2 |
U12へ書き込む場合
Nucleo | yatagarasu V2 |
---|---|
1赤(VDD_TARGET) | SWS_V_G_1 |
2青(SWCLK) | SWD3_CONN_1 |
3黒(GND) | SWD_V_G_2 |
4黄(SWIO) | SWD3_CONN1_2 |
OpenOCDを起動する。
miyamoto@ubuntu-16:~$ openocd -f interface/stlink-v2-1.cfg -f target/lpc812.cfg
Open On-Chip Debugger
0.10.0+dev-00414-gcdf1e82 (2018-06-02-07:47)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select
<transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to
plain JTAG/SWD
adapter speed: 10 kHz
adapter_nsrst_delay: 200
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Unable to match requested speed 10 kHz, using 5 kHz
Info : Unable to match requested speed 10 kHz, using 5 kHz
Info : clock speed 5 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.234098
Info : lpc812.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
telnetで接続しfirmwareを書き込む
miyamoto@ubuntu-16: $ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x1fff0008 msp: 0x10000ffc
> flash write_image erase /home/miyamoto/git/junkyard/uubridge/build/uubridge.elf
auto erase enabled
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x10000104
Verification will fail since checksum in image (0x0000030d) to be written to flash is different from
calculated vector checksum (0xefffddbe).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 2048 bytes from file /home/miyamoto/git/junkyard/uubridge/build/uubridge.elf in 55.767582s (0.036 KiB/s)
>