[AIROC™ 蓝牙] 关于CYW20829 带有MCUBOOT程序的Jlink烧录的相关命令字

[复制链接]
75|0
Burnon_FAE_2 发表于 2025-9-30 22:09 | 显示全部楼层 |阅读模式
众所周知,在量产的过程中,客户都是需要烧录脚本来进行自动烧录的,那么Jlink也可以作为一个采用烧录脚本烧录的一种硬件上的手段,如下烧录脚本是我已经测试通过的,基于Openocd来进行量产烧录,请查阅相关脚本以及测试结果:



MCU BOOT:
$ ${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x800000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init;  flash erase_address 0x60000000 0x400000; shutdown"&&${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x800000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init; flash write_image "D:/CustomerProj/MCUBootApp.hex" 0x00000000; init; reset init; reset run; shutdown"

MCU APP:

$
${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60020000 size 0x140000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init;  flash erase_address  0x60020000 0x140000; shutdown"&&${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x400000 psize 0x100 esize 0x1000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init; flash write_image "D:/CustomerProj/mtb-example-btstack-freertos-cyw20829-voice-remote.final.hex" 0x00000000; init; reset init; reset run; shutdown"



sunyu@KennSun ~
$ ${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x800000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init;  flash erase_address 0x60000000 0x400000; shutdown"&&${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x800000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init; flash write_image "D:/CustomerProj/MCUBootApp.hex" 0x00000000; init; reset init; reset run; shutdown"
Open On-Chip Debugger 0.12.0+dev-5.7.0.3672 (2025-03-04-03:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
********************************************************************************
* !!! OBSOLETE target 'cyw20829.cfg' - will be removed soon.                   *
* Use 'infineon/cyw20829.cfg' target instead.                                  *
********************************************************************************
adapter speed: 2000 kHz
adapter srst delay: 25
adapter srst pulse_width: 25
** Test Mode acquire not supported by selected adapter
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Using CMSIS-flash algorithms 'CYW208xx_SMIF' for bank 'cyw20829_smif0_cm33' (footprint 29880 bytes)
Info : CMSIS-flash: ELF path: ../flm/cypress/cat1b/CYW208xx_SMIF.FLM
Info : CMSIS-flash: Address range:     0x60000000-0x67FFFFFF
Info : CMSIS-flash: Program page size: 0x00001000 bytes
Info : CMSIS-flash: Erase sector size: 0x00040000 bytes, unified
Info : J-Link V9 compiled May  7 2021 16:26:12
Info : Hardware version: 9.40
Info : VTarget = 3.272 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x6ba02477
***************************************
** Silicon: 0xEB4A, Family: 0x110, Rev.: 0x21 (B0)
** Detected Device: CYW20829B0010
** Life Cycle  : NORMAL_NO_SECURE
** Boot version: 1.2.0.8334
** Boot Status : CYBOOT_NEXT_APP_LAUNCHED
***************************************
Info : [cyw20829.sysap] Examination succeed
Info : [cyw20829.cm33] Cortex-M33 r1p0 processor detected
Info : [cyw20829.cm33] target has 8 breakpoints, 4 watchpoints
Info : [cyw20829.cm33ap] Examination succeed
Info : [cyw20829.cm33] Examination succeed
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for cyw20829.cm33 on 3333
Info : Listening on port 3333 for gdb connections
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
Info : SWD DPIDR 0x6ba02477
** Target acquired in Test Mode
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x49000000 pc: 0x0000698c msp: 0x20000800
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x89000000 pc: 0x00006adc msp: 0x20002400
[100%] [################################] [ Erasing     ]
erased address 0x60000000 (length 4194304) in 14.631801s (279.938 KiB/s)
shutdown command invoked
Info : cyw20829.dap: powering down debug domain...
Open On-Chip Debugger 0.12.0+dev-5.7.0.3672 (2025-03-04-03:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
********************************************************************************
* !!! OBSOLETE target 'cyw20829.cfg' - will be removed soon.                   *
* Use 'infineon/cyw20829.cfg' target instead.                                  *
********************************************************************************
adapter speed: 2000 kHz
adapter srst delay: 25
adapter srst pulse_width: 25
** Test Mode acquire not supported by selected adapter
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Using CMSIS-flash algorithms 'CYW208xx_SMIF' for bank 'cyw20829_smif0_cm33' (footprint 29880 bytes)
Info : CMSIS-flash: ELF path: ../flm/cypress/cat1b/CYW208xx_SMIF.FLM
Info : CMSIS-flash: Address range:     0x60000000-0x67FFFFFF
Info : CMSIS-flash: Program page size: 0x00001000 bytes
Info : CMSIS-flash: Erase sector size: 0x00040000 bytes, unified
Info : J-Link V9 compiled May  7 2021 16:26:12
Info : Hardware version: 9.40
Info : VTarget = 3.272 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x6ba02477
***************************************
** Silicon: 0xEB4A, Family: 0x110, Rev.: 0x21 (B0)
** Detected Device: CYW20829B0010
** Life Cycle  : NORMAL_NO_SECURE
** Boot version: 1.2.0.8334
** Boot Status : CYBOOT_NEXT_APP_LAUNCHED
***************************************
Info : [cyw20829.sysap] Examination succeed
Info : [cyw20829.cm33] Cortex-M33 r1p0 processor detected
Info : [cyw20829.cm33] target has 8 breakpoints, 4 watchpoints
Info : [cyw20829.cm33ap] Examination succeed
Info : [cyw20829.cm33] Examination succeed
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for cyw20829.cm33 on 3333
Info : Listening on port 3333 for gdb connections
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
Info : SWD DPIDR 0x6ba02477
** Target acquired in Test Mode
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x49000000 pc: 0x00006966 msp: 0x20000800
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x89000000 pc: 0x0000695e msp: 0x20000800
** Application was not launched, boot status: CYBOOT_TOC2_OBJ_INVALID
Info : Padding image section 0 at 0x600157c8 with 2104 bytes (bank write end alignment)
[100%] [################################] [ Programming ]
wrote 90112 bytes from file D:/CustomerProj/MCUBootApp.hex in 2.823026s (31.172 KiB/s)
** Reset using XRES pin
** Target acquired in Test Mode
[cyw20829.cm33] halted due to undefined, current mode: Thread
xPSR: 0x21000000 pc: 0x2000f4b8 msp: 0x2000fcb8
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to undefined, current mode: Thread
xPSR: 0x89000000 pc: 0x00006adc msp: 0x20002400
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
shutdown command invoked
Info : cyw20829.dap: powering down debug domain...

sunyu@KennSun ~
$
${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60020000 size 0x140000 psize 0x100 esize 0x40000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init;  flash erase_address  0x60020000 0x140000; shutdown"&&${OPENOCD}/bin/openocd -s "$OPENOCD/scripts" -f "$OPENOCD/scripts/interface/jlink.cfg" -c "transport select swd" -c "adapter speed 100" -c "set SMIF_BANKS { 0 {addr 0x60000000 size 0x400000 psize 0x100 esize 0x1000} }" -f $OPENOCD/scripts/target/cyw20829.cfg -c "init; reset init; flash write_image "D:/CustomerProj/mtb-example-btstack-freertos-cyw20829-voice-remote.final.hex" 0x00000000; init; reset init; reset run; shutdown"
Open On-Chip Debugger 0.12.0+dev-5.7.0.3672 (2025-03-04-03:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
********************************************************************************
* !!! OBSOLETE target 'cyw20829.cfg' - will be removed soon.                   *
* Use 'infineon/cyw20829.cfg' target instead.                                  *
********************************************************************************
adapter speed: 2000 kHz
adapter srst delay: 25
adapter srst pulse_width: 25
** Test Mode acquire not supported by selected adapter
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Using CMSIS-flash algorithms 'CYW208xx_SMIF' for bank 'cyw20829_smif0_cm33' (footprint 29880 bytes)
Info : CMSIS-flash: ELF path: ../flm/cypress/cat1b/CYW208xx_SMIF.FLM
Info : CMSIS-flash: Address range:     0x60000000-0x67FFFFFF
Info : CMSIS-flash: Program page size: 0x00001000 bytes
Info : CMSIS-flash: Erase sector size: 0x00040000 bytes, unified
Info : J-Link V9 compiled May  7 2021 16:26:12
Info : Hardware version: 9.40
Info : VTarget = 3.272 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x6ba02477
***************************************
** Silicon: 0xEB4A, Family: 0x110, Rev.: 0x21 (B0)
** Detected Device: CYW20829B0010
** Life Cycle  : NORMAL_NO_SECURE
** Boot version: 1.2.0.8334
** Boot Status : CYBOOT_NEXT_APP_LAUNCHED
***************************************
Info : [cyw20829.sysap] Examination succeed
Info : [cyw20829.cm33] Cortex-M33 r1p0 processor detected
Info : [cyw20829.cm33] target has 8 breakpoints, 4 watchpoints
Info : [cyw20829.cm33ap] Examination succeed
Info : [cyw20829.cm33] Examination succeed
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for cyw20829.cm33 on 3333
Info : Listening on port 3333 for gdb connections
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
Info : SWD DPIDR 0x6ba02477
** Target acquired in Test Mode
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x49000000 pc: 0x0000698c msp: 0x20000800
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x89000000 pc: 0x00006adc msp: 0x20002400
[100%] [################################] [ Erasing     ]
erased address 0x60020000 (length 1310720) in 5.526249s (231.622 KiB/s)
shutdown command invoked
Info : cyw20829.dap: powering down debug domain...
Open On-Chip Debugger 0.12.0+dev-5.7.0.3672 (2025-03-04-03:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
********************************************************************************
* !!! OBSOLETE target 'cyw20829.cfg' - will be removed soon.                   *
* Use 'infineon/cyw20829.cfg' target instead.                                  *
********************************************************************************
adapter speed: 2000 kHz
adapter srst delay: 25
adapter srst pulse_width: 25
** Test Mode acquire not supported by selected adapter
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Using CMSIS-flash algorithms 'CYW208xx_SMIF' for bank 'cyw20829_smif0_cm33' (footprint 29880 bytes)
Info : CMSIS-flash: ELF path: ../flm/cypress/cat1b/CYW208xx_SMIF.FLM
Info : CMSIS-flash: Address range:     0x60000000-0x67FFFFFF
Info : CMSIS-flash: Program page size: 0x00001000 bytes
Info : CMSIS-flash: Erase sector size: 0x00040000 bytes, unified
Info : J-Link V9 compiled May  7 2021 16:26:12
Info : Hardware version: 9.40
Info : VTarget = 3.272 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x6ba02477
***************************************
** Silicon: 0xEB4A, Family: 0x110, Rev.: 0x21 (B0)
** Detected Device: CYW20829B0010
** Life Cycle  : NORMAL_NO_SECURE
** Boot version: 1.2.0.8334
** Boot Status : CYBOOT_NEXT_APP_LAUNCHED
***************************************
Info : [cyw20829.sysap] Examination succeed
Info : [cyw20829.cm33] Cortex-M33 r1p0 processor detected
Info : [cyw20829.cm33] target has 8 breakpoints, 4 watchpoints
Info : [cyw20829.cm33ap] Examination succeed
Info : [cyw20829.cm33] Examination succeed
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for cyw20829.cm33 on 3333
Info : Listening on port 3333 for gdb connections
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
Info : SWD DPIDR 0x6ba02477
** Target acquired in Test Mode
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x49000000 pc: 0x0000698c msp: 0x20000800
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x89000000 pc: 0x00006adc msp: 0x20002400
Info : Padding image section 0 at 0x600800d6 with 3882 bytes (bank write end alignment)
[100%] [################################] [ Programming ]
wrote 397312 bytes from file D:/CustomerProj/mtb-example-btstack-freertos-cyw20829-voice-remote.final.hex in 9.256145s (41.918 KiB/s)
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
Info : SWD DPIDR 0x6ba02477
** Target acquired in Test Mode
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x49000000 pc: 0x0000698c msp: 0x20000800
Info : [cyw20829.cm33] external reset detected
[cyw20829.cm33] halted due to debug-request, current mode: Thread
xPSR: 0x89000000 pc: 0x00006adc msp: 0x20002400
** Reset using XRES pin
** Reset using DP.CDBGRSTREQ
shutdown command invoked
Info : cyw20829.dap: powering down debug domain...

您需要登录后才可以回帖 登录 | 注册

本版积分规则

74

主题

112

帖子

4

粉丝
快速回复 在线客服 返回列表 返回顶部