From: <jia...@by...> - 2018-11-01 04:12:04
|
Good day, I use a daisy chain configuration for 2 STM32 MCUs: J Link(TDI)-->(TDI)stm32f217(TDO)-->(TDI)stm32f302(TDO)-->(TDO)J Link I think I have set up the TAPs correctly, but the "flash write_image" always flash the same MCU, it does not switch target. I use the "targets" command below for switching target before flash program: targets stm32f217.cpu init reset init flash write_image erase unlock "mcu1_pb6_fast.hex" reset run but it failed at switching... What's wrong here? -------------------------- my whole board.cfg file: # interface interface jlink jlink serial 304439649 # board transport select jtag set CHIPNAME stm32f302 source [find target/stm32f3x.cfg] set CHIPNAME stm32f217 source [find target/stm32f2x.cfg] reset_config none targets stm32f217.cpu init reset init flash write_image erase unlock "mcu1_pb6_fast.hex" reset run targets stm32f302.cpu init reset init flash write_image erase unlock "mcu2_pb11_fast.hex" reset run shutdown --------------------------- outputs: Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 none separate cortex_m reset_config sysresetreq Info : replaced existing 'mrw' usage Info : replaced existing 'mrw' help Info : replaced existing 'mrb' usage Info : replaced existing 'mrb' help Info : replaced existing 'mmw' usage Info : replaced existing 'mmw' help adapter speed: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 none separate cortex_m reset_config sysresetreq none separate Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46 Info : Hardware version: 8.00 Info : VTarget = 3.293 V Info : clock speed 1000 kHz Info : JTAG tap: stm32f302.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f302.bs tap/device found: 0x06422041 (mfg: 0x020 (STMicroelectronics), part: 0x6422, ver: 0x0) Info : JTAG tap: stm32f217.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f217.bs tap/device found: 0x06411041 (mfg: 0x020 (STMicroelectronics), part: 0x6411, ver: 0x0) Info : stm32f302.cpu: hardware has 6 breakpoints, 4 watchpoints Info : stm32f217.cpu: hardware has 6 breakpoints, 4 watchpoints adapter speed: 1000 kHz Info : JTAG tap: stm32f302.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f302.bs tap/device found: 0x06422041 (mfg: 0x020 (STMicroelectronics), part: 0x6422, ver: 0x0) Info : JTAG tap: stm32f217.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f217.bs tap/device found: 0x06411041 (mfg: 0x020 (STMicroelectronics), part: 0x6411, ver: 0x0) target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000cb0 msp: 0x20020000 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000c60 msp: 0x20004000 adapter speed: 1000 kHz auto erase enabled auto unlock enabled Info : device id = 0x10036422 Info : flash size = 128kbytes wrote 4096 bytes from file mcu1_pb6_fast.hex in 0.543082s (7.365 KiB/s) adapter speed: 1000 kHz Info : JTAG tap: stm32f302.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f302.bs tap/device found: 0x06422041 (mfg: 0x020 (STMicroelectronics), part: 0x6422, ver: 0x0) Info : JTAG tap: stm32f217.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f217.bs tap/device found: 0x06411041 (mfg: 0x020 (STMicroelectronics), part: 0x6411, ver: 0x0) adapter speed: 1000 kHz Info : JTAG tap: stm32f302.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f302.bs tap/device found: 0x06422041 (mfg: 0x020 (STMicroelectronics), part: 0x6422, ver: 0x0) Info : JTAG tap: stm32f217.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f217.bs tap/device found: 0x06411041 (mfg: 0x020 (STMicroelectronics), part: 0x6411, ver: 0x0) target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000cb0 msp: 0x20020000 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000c60 msp: 0x20004000 adapter speed: 1000 kHz auto erase enabled auto unlock enabled wrote 4096 bytes from file mcu2_pb11_fast.hex in 0.503070s (7.951 KiB/s) adapter speed: 1000 kHz Info : JTAG tap: stm32f302.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f302.bs tap/device found: 0x06422041 (mfg: 0x020 (STMicroelectronics), part: 0x6422, ver: 0x0) Info : JTAG tap: stm32f217.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) Info : JTAG tap: stm32f217.bs tap/device found: 0x06411041 (mfg: 0x020 (STMicroelectronics), part: 0x6411, ver: 0x0) shutdown command invoked |
From: Paul F. <fer...@gm...> - 2018-11-01 10:32:58
|
Hello, On Thu, Nov 01, 2018 at 11:56:32AM +0800, jia...@by... wrote: > I think I have set up the TAPs correctly, but the "flash write_image" always > flash the same MCU, it does not switch target. Not sure about the correct solution but have you tried "flash write_bank 0/1" as a workaround? -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |
From: <jia...@by...> - 2018-11-01 12:27:28
|
Thank you Pual, I figured it out myself, by using this command. It seems "reset" command reset all defined target as said in user manual. However, "halt" just halt current target. init targets stm32f217.cpu halt flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu halt flash write_image erase unlock "mcu2_pb11_slow.hex" reset run -----邮件原件----- 发件人: Paul Fertser [mailto:fer...@gm...] 发送时间: 2018年11月1日 18:33 收件人: jia...@by... 抄送: ope...@li... 主题: Re: [OpenOCD-user] need help for program multiple devices in daisy chain Hello, On Thu, Nov 01, 2018 at 11:56:32AM +0800, jia...@by... wrote: > I think I have set up the TAPs correctly, but the "flash > write_image" always flash the same MCU, it does not switch target. Not sure about the correct solution but have you tried "flash write_bank 0/1" as a workaround? -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |
From: Paul F. <fer...@gm...> - 2018-11-01 12:38:07
|
On Thu, Nov 01, 2018 at 08:27:15PM +0800, jia...@by... wrote: > I figured it out myself, by using this command. It seems "reset" command > reset all defined target as said in user manual. However, "halt" just halt > current target. Indeed, sorry, haven't noticed that. I would expect "flash write_image" to complain when it tries to flash a non-halted target though. The usual scenario is using "reset init" just before flashing, so I would expect your script to be something like this: init reset init targets stm32f217.cpu flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu flash write_image erase unlock "mcu2_pb11_slow.hex" reset shutdown -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |
From: <jia...@by...> - 2018-11-02 02:36:54
|
Thanks again Paul. I finally find why my first script didn't work. "reset" command just make "targets" to default. So if "targets" before a "reset", it may be useless to switch the current target. So this won't work correctly: targets stm32f217.cpu init reset init flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu flash write_image erase unlock "mcu2_pb11_slow.hex" reset shutdown On Thu, Nov 01, 2018 at 08:27:15PM +0800, <mailto:jia...@by...> jia...@by... wrote: > I figured it out myself, by using this command. It seems "reset" > command reset all defined target as said in user manual. However, > "halt" just halt current target. Indeed, sorry, haven't noticed that. I would expect "flash write_image" to complain when it tries to flash a non-halted target though. The usual scenario is using "reset init" just before flashing, so I would expect your script to be something like this: init reset init targets stm32f217.cpu flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu flash write_image erase unlock "mcu2_pb11_slow.hex" reset shutdown |