Problem flashing FRDM-MCXC242 with LinkServer (zephyr: west flash)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Problem flashing FRDM-MCXC242 with LinkServer (zephyr: west flash)

跳至解决方案
2,865 次查看
mw6
Contributor I

Hi,

I'm currently evaluating Zephyr on the FRDM-MCXC242 board.

When I tried flashing with west flash for the first time (using LinkServer) it worked. When trying to flash for a second time, west flash fails.

I can recover the board by flashing with a JLink probe (west flash -r jlink). Then flashing with LinkServer works again for the first try but at the second try it starts to fail again.

This is my output for the first try:

 

$ west -v flash
-- west flash: rebuilding
cmake version 3.30.5 is OK; minimum version is 3.13.1
Running CMake: 'C:\Program Files\CMake\bin\cmake.EXE' --build ##############################build'
ninja: no work to do.
-- west flash: using runner linkserver
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' -v
-- runners.linkserver: LinkServer: C:\nxp\LinkServer_24.9.75\Linkserver.exe, version v24.9.75
runners.linkserver: LinkServer cmd:  + ['C:\\nxp\\LinkServer_24.9.75\\Linkserver.exe', 'flash', '--probe', '#1', 'MCXC242:FRDM-MCXC242']
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' -v
runners.linkserver: flash command = ['C:\\nxp\\LinkServer_24.9.75\\Linkserver.exe', 'flash', '--probe', '#1', 'MCXC242:FRDM-MCXC242', 'load', '--addr', '0', '##############################\\zephyr.bin']
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' flash --probe '#1' MCXC242:FRDM-MCXC242 load --addr 0 '##############################\zephyr.bin'
INFO: Exact match for MCXC242:FRDM-MCXC242 found
INFO: Selected device MCXC242:FRDM-MCXC242
INFO: Getting available probes
INFO: Selecting probe by index
INFO: Selected probe #1 RJ5F0KUBKS14M (MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146)
INFO: MCU-Link firmware update `check`: local firmware [3.148] can be programmed on the selected probe ([RJ5F0KUBKS14M] [MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146])
Firmware update `check`: - the update can be performed using `auto` mode
Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:34:05 - crt_emu_cm_redlink.exe build 802)
Pc: (  0) Reading remote configuration
Wc(03). No cache support.
Nc: Found generic directory XML file in ##############################\crt_directory.xml
Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
Wc: ============= SCRIPT: MCXC_connect.scp =============
Wc: MCXC Connect Script
Wc: Connecting to Probe Index = 1
Wc: This probe = 1
Wc: This TAP = 0
Wc: This core = 0
Wc: DpID = 0BC11477
Wc: Assert NRESET
Wc: Reset pin state: 00
Wc: Power up Debug
Wc: MDM-AP APID: 0x001C0020
Wc: MDM-AP System Reset/Hold Reset/Debug Request
Wc: MDM-AP Control: 0x0000001C
Wc: MDM-AP Status (Flash Ready) : 0x00000033
Wc: Part is not secured
Wc: MDM-AP Control: 0x00000014
Wc: Release NRESET
Wc: Reset pin state: 01
Wc: MDM-AP Control (Debug Request): 0x00000004
Wc: MDM-AP Status: 0x0001003B
Wc: MDM-AP Core Halted
Wc: ============= END SCRIPT ===========================
Nc: Probe Firmware: MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146 (NXP Semiconductors)
Nc: Serial Number:  RJ5F0KUBKS14M
Nc: VID:PID:  1FC9:0143
Nc: USB Path: 0001:0005:00
Nc: Using memory from core 0 after searching for a good core
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: debug interface type      = CoreSight DP (DAP DP ID 0BC11477) over SWD TAP 0
Nc: processor type            = Cortex-M0+ (CPU ID 00000C60) on DAP AP 0
Nc: number of h/w breakpoints = 2
Nc: number of flash patches   = 0
Nc: number of h/w watchpoints = 2
Nc: Probe(0): Connected&Reset. DpID: 0BC11477. CpuID: 00000C60. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Ns: Content of CoreSight Debug ROM(s):
Nc: RBASE F0002000: CID B105100D PID 000008E000 ROM (type 0x1)
Nc: ROM 1 F0000000: CID B105900D PID 04001BB932 CSt ARM MTB type 0x31 Trace Sink - Basic trace router
Nc: ROM 1 F0001000: CID B105900D PID 000008E000 CSt MTBDWT type 0x4 Debug Control - Other
Nc: ROM 1 E00FF000: CID B105100D PID 04000BB4C0 ROM (type 0x1)
Nc: ROM 4 E000E000: CID B105E00D PID 04000BB008 Gen SCS (type 0x0)
Nc: ROM 4 E0001000: CID B105E00D PID 04000BB00A Gen DWT (type 0x0)
Nc: ROM 4 E0002000: CID B105E00D PID 04000BB00B Gen FPB (type 0x0)
Nc: NXP: MCXC242
Nc: DAP stride is 1024 bytes (256 words)
Nc: Inspected v.2 On chip Flash memory module FTFA_1K_MCXC.cfx
Nc: Image 'SemiGeneric Sep 19 2024 18:20:26'
Nc: Opening flash driver FTFA_1K_MCXC.cfx
Nc: VECTRESET requested, but not supported on ARMv6-M CPUs. Using SOFTRESET instead.
Nc: Using SOFT reset to run the flash driver
Nc: Flash variant 'MCXC242 FTFA Generic 1K' detected (64KB = 64*1K at 0x0)
Nc: Closing flash driver FTFA_1K_MCXC.cfx
Pc: ( 65) Chip Setup Complete
Pc: ( 70) License Check Complete
Nt: Loading 'zephyr.bin' Binary 0x00000000 len 0x8FFA
Nc: Opening flash driver FTFA_1K_MCXC.cfx (already resident)
Nc: VECTRESET requested, but not supported on ARMv6-M CPUs. Using SOFTRESET instead.
Nc: Using SOFT reset to run the flash driver
Nc: Flash variant 'MCXC242 FTFA Generic 1K' detected (64KB = 64*1K at 0x0)
Pb: 1 of 1 (  0) Writing sectors 0-35 at 0x00000000 with 36860 bytes
Ps: (  0) at 00000000: 0 bytes - 0/36860
Ps: (  2) at 00000000: 1024 bytes - 1024/36860
Ps: (  5) at 00000400: 1024 bytes - 2048/36860
Nc: 00000800 done   5% (2048 out of 36860)
Ps: (100) at 00000800: 34816 bytes - 36864/36860
Nc: Sectors written: 1, unchanged: 35, total: 36
Nc: Closing flash driver FTFA_1K_MCXC.cfx
Pb: (100) Finished writing Flash successfully.
Nt: Loaded 0x8FFA bytes in 161ms (about 228kB/s)
Nt: Reset target (system)
Nc: Starting execution using system reset
Nc: state - running or following reset request - re-read of state failed - rc Nn(05). Wire ACK Fault in DAP access
Nc: error closing down debug session - Nn(05). Wire ACK Fault in DAP access

 

 And this on the second try:

 

$ west -v flash
-- west flash: rebuilding
cmake version 3.30.5 is OK; minimum version is 3.13.1
Running CMake: 'C:\Program Files\CMake\bin\cmake.EXE' --build '##############################\build'
ninja: no work to do.
-- west flash: using runner linkserver
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' -v
-- runners.linkserver: LinkServer: C:\nxp\LinkServer_24.9.75\Linkserver.exe, version v24.9.75
runners.linkserver: LinkServer cmd:  + ['C:\\nxp\\LinkServer_24.9.75\\Linkserver.exe', 'flash', '--probe', '#1', 'MCXC242:FRDM-MCXC242']
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' -v
runners.linkserver: flash command = ['C:\\nxp\\LinkServer_24.9.75\\Linkserver.exe', 'flash', '--probe', '#1', 'MCXC242:FRDM-MCXC242', 'load', '--addr', '0', '##############################\\zephyr.bin']
runners.linkserver: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' flash --probe '#1' MCXC242:FRDM-MCXC242 load --addr 0 '##############################\zephyr.bin'
INFO: Exact match for MCXC242:FRDM-MCXC242 found
INFO: Selected device MCXC242:FRDM-MCXC242
INFO: Getting available probes
INFO: Selecting probe by index
INFO: Selected probe #1 RJ5F0KUBKS14M (MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146)
INFO: MCU-Link firmware update `check`: local firmware [3.148] can be programmed on the selected probe ([RJ5F0KUBKS14M] [MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146])
Firmware update `check`: - the update can be performed using `auto` mode
Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:34:05 - crt_emu_cm_redlink.exe build 802)
Pc: (  0) Reading remote configuration
Wc(03). No cache support.
Nc: Found generic directory XML file in ##############################\crt_directory.xml
Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
Wc: ============= SCRIPT: MCXC_connect.scp =============
Wc: MCXC Connect Script
Wc: Connecting to Probe Index = 1
Wc: This probe = 1
Wc: This TAP = 0
Wc: This core = 0
Wc: DpID = 0BC11477
Wc: Assert NRESET
Wc: Reset pin state: 00
Wc: Power up Debug
Wc: MDM-AP APID: 0x001C0020
Wc: MDM-AP System Reset/Hold Reset/Debug Request
Wc: MDM-AP Control: 0x00000008
Wc: MDM-AP Status (Flash Ready) : 0x00000036
Wc: Part is secured
Wc: Mass Erase Required
Wc: ============= END SCRIPT ===========================
Nc: Probe Firmware: MCU-LINK FRDM-MCXC242 (r0E7) CMSIS-DAP V3.146 (NXP Semiconductors)
Nc: Serial Number:  RJ5F0KUBKS14M
Nc: VID:PID:  1FC9:0143
Nc: USB Path: 0001:0015:00
Nc: Using memory from core 0 after searching for a good core
Ns: redlink server client - failed to receive response (to op 62) from server after 2000ms - timed out (rc 138)
Nc: connection failed - EE(47): Debug Mailbox Request Failed... Retrying
Ns: redlink server client - failed to receive response (to op 12) from server after 2000ms - timed out (rc 138)
Nc: probe 1 TAP 0 failed to read TAP ID - Ee(FF). Redlink interface error 255.
Ed:02: Failed on connect: Ee(FF). Redlink interface error 255.
Et: Probe(0): Connected&Reset. Was: NotConnected. DpID: 0BC11477. CpuID: 00000000. Info: <None>
Nc:   Last stub error 0: OK
Nc:   Last sticky error: 0x0 AIndex: 0
Nc:   Debug bus selected: MemAp 0
Nc:   DAP Speed test unexecuted or failed
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Pc: (100) Target Operation Failed
Ns: redlink server client - warning - 28 bytes of unexpected data from the server
Nc: error closing down debug session - Nn(05). Wire ACK Fault in DAP access
CRITICAL: Critical error
ERRMSG: Exception: Flash operation exited with code 1
FATAL ERROR: command exited with status 4294967295: 'C:\nxp\LinkServer_24.9.75\Linkserver.exe' flash --probe '#1' MCXC242:FRDM-MCXC242 load --addr 0 '##############################\zephyr.bin'

 

I have no idea why this would happen. Can you help me?

Thanks,

Max

标签 (2)
0 项奖励
回复
1 解答
2,580 次查看
dereksnell
NXP Employee
NXP Employee

Hi @mw6 and @Alice_Yang ,

Thank for raising this issue.  This was caused by the Flash Security setting in the FSEC location in flash.  We have an upstream Pull Request to resolve this at https://github.com/zephyrproject-rtos/zephyr/pull/82947.

Best regards

在原帖中查看解决方案

4 回复数
2,581 次查看
dereksnell
NXP Employee
NXP Employee

Hi @mw6 and @Alice_Yang ,

Thank for raising this issue.  This was caused by the Flash Security setting in the FSEC location in flash.  We have an upstream Pull Request to resolve this at https://github.com/zephyrproject-rtos/zephyr/pull/82947.

Best regards

2,459 次查看
mw6
Contributor I
Hi @dereksnell, thanks for resolving this issue. It works now on my desk!
0 项奖励
回复
2,561 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @dereksnell 

Thanks for your kindly help.

 

BR

Alice

0 项奖励
回复
2,726 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @mw6 

I have reproduce your issue on my side. I'm still finding the root cause. I will send to you with any update. Thanks for your patience.

 

BR

Alice

0 项奖励
回复