Cannot debug on S32K358

By Jeff H. : Sep 23, 2025 at 01:55 PM (13:55 hours)
Staff: Johnny N. : 12 comments

I am using a PE Multilink with the NXP RD-BESSK358BMU board. I have SW2 on the board set to ON to prevent the PMIC watchdog from resetting the micro.

I am using S32DS 3.5 with RTD 3.0.0 (202303).

As a test case, I created a new project using the DIO example: Siul2_Port_Ip_Example_S32K358 (Debug:Flash)
It builds fine, though when I attempt to debug it on the target, it seems to have trouble loading the ARP file.
The file is present in the directory. How can I get past this issue?

Here is the log:

Connection from "127.0.0.1" via 127.0.0.1. Connection from port "56597" to 6224
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "56602" to 7224
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
PE-ERROR: Warning. Can't read registers while part is running.
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read registers while part is running.
Telnet server running on 127.0.0.1:51794
Requesting next symbol pxCurrentTCB
Symbol pxCurrentTCB not found.
Requesting next symbol pxReadyTasksLists
Symbol pxReadyTasksLists not found.
Requesting next symbol xDelayedTaskList1
Symbol xDelayedTaskList1 not found.
Requesting next symbol xDelayedTaskList2
Symbol xDelayedTaskList2 not found.
Requesting next symbol xPendingReadyList
Symbol xPendingReadyList not found.
Requesting next symbol uxCurrentNumberOfTasks
Symbol uxCurrentNumberOfTasks not found.
Requesting next symbol uxDeletedTasksWaitingCleanUp
Symbol uxDeletedTasksWaitingCleanUp not found.
Requesting next symbol xSuspendedTaskList
Symbol xSuspendedTaskList not found.
Requesting next symbol xSchedulerRunning
Symbol xSchedulerRunning not found.
Requesting next symbol FreeRTOSDebugConfig
Symbol FreeRTOSDebugConfig not found.
Requesting next symbol _tx_thread_current_ptr
Symbol _tx_thread_current_ptr not found.
Requesting next symbol _tx_thread_created_ptr
Symbol _tx_thread_created_ptr not found.
Requesting next symbol _tx_thread_created_count
Symbol _tx_thread_created_count not found.
Requesting next symbol _tx_thread_system_state
Symbol _tx_thread_system_state not found.
Unable to load libusb0.dll
Copyright 2025 P&E Microcomputer Systems,Inc.
Command Line Parameters :
-device=NXP_S32K3xx_S32K358
-startserver
-singlesession
-serverport=7224
-gdbmiport=6224
-interface=USBMULTILINK
-speed=5000
-port=USB1
-streamingport=10224
-configfile=C:/Users/140597/workspaceS32DS.3.5_BESS/.metadata/.plugins/com.pemicro.debug.gdbjtag.pne/config.ini
PEmicro Interface detected - Flash Version 11.52

CMD>RE

Initializing.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
Target has been RESET and is active.
CMD>CM C:\nxp\S32DS.3.5_BESS\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.expansion_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\nxp_s32k358_1x32x2004k_hse_enabled.arp

Initializing.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
Initialized.

;version 1.01, 11/22/2023, Copyright 2023 P&E Microcomputer Systems, www.pemicro.com [S32K358_hse_enabled]

;device nxp, s32k358, 1x32x2004k,desc=hse_enabled

;begin_cs device=$00400000, length=$007D4000, ram=$20400000

Loading programming algorithm ...
Error loading .ARP file : C:\nxp\S32DS.3.5_BESS\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.expansion_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\nxp_s32k358_1x32x2004k_hse_enabled.arp at address 20400002
Error loading programming algorithm - load aborted.
Error occured during Flash programming.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000

The rest of the log:

Starting reset script (C:\nxp\S32DS.3.5_BESS\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.expansion_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) ...
REM Enable clocks for selected cores in MC_ME module
Delaying for 200mS ...
Done.
REM Initialize RAM and DMA:
REM Initialize DMA TCD:
REM Copy valid executable code to RAM for each core to be used.
REM Enable required cores in MC_ME:
Delaying for 20mS ...
Done.
Delaying for 20mS ...
Done.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
BusFault: An imprecise (asynchronous) data access error has occurred.
HardFault: A fault has been escalated to a hard fault.

Reset script (C:\nxp\S32DS.3.5_BESS\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.expansion_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) completed.


PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.

PE-ERROR: Error downloading to the device. Terminating debug session.
Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "56597" from 6224
PE-ERROR: Error : Attempted to send response but connection already closed.
Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "56602" from 7224
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
INFO: DAP IDCODE = 0x6BA02477
Target Disconnected.

Hi,

You'll running an older 3.5.x release of S32DS but you're using a very new version of our ARM Eclipse plugin. Do you have a setup with the latest 3.6.x release of S32DS that you can test.

Regards,
Johnny

I updated to S32DS 3.6.3 and still have the same problem. Here's the log:
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "58770" to 6224
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "58775" to 7224
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
PE-ERROR: Warning. Can't read registers while part is running.
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read registers while part is running.
Telnet server running on 127.0.0.1:51794
Requesting next symbol pxCurrentTCB
Symbol pxCurrentTCB not found.
Requesting next symbol pxReadyTasksLists
Symbol pxReadyTasksLists not found.
Requesting next symbol xDelayedTaskList1
Symbol xDelayedTaskList1 not found.
Requesting next symbol xDelayedTaskList2
Symbol xDelayedTaskList2 not found.
Requesting next symbol xPendingReadyList
Symbol xPendingReadyList not found.
Requesting next symbol uxCurrentNumberOfTasks
Symbol uxCurrentNumberOfTasks not found.
Requesting next symbol uxDeletedTasksWaitingCleanUp
Symbol uxDeletedTasksWaitingCleanUp not found.
Requesting next symbol xSuspendedTaskList
Symbol xSuspendedTaskList not found.
Requesting next symbol xSchedulerRunning
Symbol xSchedulerRunning not found.
Requesting next symbol FreeRTOSDebugConfig
Symbol FreeRTOSDebugConfig not found.
Requesting next symbol _tx_thread_current_ptr
Symbol _tx_thread_current_ptr not found.
Requesting next symbol _tx_thread_created_ptr
Symbol _tx_thread_created_ptr not found.
Requesting next symbol _tx_thread_created_count
Symbol _tx_thread_created_count not found.
Requesting next symbol _tx_thread_system_state
Symbol _tx_thread_system_state not found.
Unable to load libusb0.dll
Copyright 2025 P&E Microcomputer Systems,Inc.
Command Line Parameters :
-device=NXP_S32K3xx_S32K358
-startserver
-singlesession
-serverport=7224
-gdbmiport=6224
-interface=USBMULTILINK
-speed=5000
-port=USB1
-streamingport=10224
-configfile=C:/Users/140597/workspaceS32DS.3.6.3_BESS/.metadata/.plugins/com.pemicro.debug.gdbjtag.pne/config.ini
PEmicro Interface detected - Flash Version 11.52

CMD>RE

Initializing.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
Target has been RESET and is active.
CMD>CM C:\nxp\S32DS.3.6.3_BESS_RTD300\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\nxp_s32k358_1x32x2004k_hse_enabled.arp

Initializing.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
Initialized.

;version 1.01, 11/22/2023, Copyright 2023 P&E Microcomputer Systems, www.pemicro.com [S32K358_hse_enabled]

;device nxp, s32k358, 1x32x2004k,desc=hse_enabled

;begin_cs device=$00400000, length=$007D4000, ram=$20400000

Loading programming algorithm ...
Error loading .ARP file : C:\nxp\S32DS.3.6.3_BESS_RTD300\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\nxp_s32k358_1x32x2004k_hse_enabled.arp at address 20400002
Error loading programming algorithm - load aborted.
Error occured during Flash programming.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000

(log continued)

Starting reset script (C:\nxp\S32DS.3.6.3_BESS_RTD300\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) ...
REM Enable clocks for selected cores in MC_ME module
Delaying for 200mS ...
Done.
REM Initialize RAM and DMA:
REM Initialize DMA TCD:
REM Copy valid executable code to RAM for each core to be used.
REM Enable required cores in MC_ME:
Delaying for 20mS ...
Done.
Delaying for 20mS ...
Done.
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
BusFault: An imprecise (asynchronous) data access error has occurred.
HardFault: A fault has been escalated to a hard fault.

Reset script (C:\nxp\S32DS.3.6.3_BESS_RTD300\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) completed.


PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.

PE-ERROR: Error downloading to the device. Terminating debug session.
Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "58770" from 6224
PE-ERROR: Error : Attempted to send response but connection already closed.
Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "58775" from 7224
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
INFO: DAP IDCODE = 0x6BA02477
Target Disconnected.

Hi Jeff,

It looks like there are a couple of problems that happened during our attempt at starting a debug session.

First, we tried to load the algorithm and that failed.

Error loading .ARP file : C:\nxp\S32DS.3.6.3_BESS_RTD300\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.0.8.202509081843\supportFiles_ARM\NXP\S32K3xx\nxp_s32k358_1x32x2004k_hse_enabled.arp at address 20400002
Error loading programming algorithm - load aborted.

Then we tried to run some setup code that our reset script downloaded to RAM and that caused a hard fault.

BusFault: An imprecise (asynchronous) data access error has occurred.
HardFault: A fault has been escalated to a hard fault.

I understand you have SW2 set to ON to disable the SBC. But this is the full guide provided by the user manual.
https://www.nxp.com/docs/en/user-manual/UM12196.pdf

5.2.4.1.1 Entering SBC Debug mode
The debug circuit is intended for development purposes only and must be removed for production.
There are two options to enter Debug mode. It is recommended to use the first option:

1. Press and hold SW1 (or set SW2 to On position) while connecting the 24 V power supply and release SW1
after the 24 V supply is connected. Make sure that D26 is solid On afterward.
2. FS2633 debug pin is accessible at connector J11 pin 4. Applying a voltage between 2.5 V and 6 V to this
pin, before the board power supply is connected, ensures Debug mode.

Make sure the 24 V power supply is in range from 20 V to 30 V while entering Debug mode. The power supply
current limit must be at least 2 A to meet sufficient input voltage steepness for Debug mode entering. If there is
slow input voltage ramp-up, Debug mode may not be activated. This may typically happen when a power supply
with a soft-start function is used.

A blinking D26 indicates the MCU power supply is being reset, which means Debug mode was not successfully
activated.

Is the D26 LED is solidly on?

I will check if we have this board to verify on my end.

Regards,
Johnny
PEmicro

D26 is solidly on.

In an earlier installation (S32DS 3.5) and earlier firmware, I was able to debug this board.

Jeff,

Do you remember what firmware version your multilink (also what revision is your multilink?) was running before? We can try to downgrade you to that. if it works, then you can get on with your development while we try to reproduce this issue on our end.

Regards,
Johnny

I don't know which version of firmware I was running prior to the upgrade.
I have USB-ML-UNIVERSAL Rev D.

Hi Jeff,

I sent you the version 10.29 firmware for the USB-ML-UNIVERSAL (but renamed to 11.99). You can use our PEFirmwareConfig utility to downgrade to this firmware. Just drop the file into the utility folder where the rest of the firmware files are.

https://www.pemicro.com/downloads/download_file.cfm?download_id=346

Before downgrading, I found another S32K358 based board with the same debug connector.
I was able to debug the file on that board, so it's not a problem with the debugger, cable, or the software.

With the second board, I do not receive the error about loading the programming algorithm.

I notice the very beginning of the log is different:
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "64700" to 6224
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "64705" to 7224
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
PE-ERROR: Warning. Can't read registers while part is running.
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read registers while part is running.
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)

For four PE-ERROR messages do not appear when I use the second board.
Could the processor on the problematic board be stuck in a debug state from a previous debug session?

Hi Jeff,

I spoke with a colleague who has more experience with the S32K358 and he pointed to the following section in the user manual.

5.2.4.1.2 Leave Debug mode

For safety reasons, FSxB safety outputs' functionality is limited in Debug mode. To enable full board functionality (for example, contactor control) Debug mode must be left. The following are the options to leave Debug mode. Make sure that SW2 is in Off position.

1. To leave Debug mode, the BMU power supply must be disconnected and connected again. The actual SBC state can be checked in the FS_STATES register via SPI.

2. A request to leave Debug mode can be entered into the SBC FS_STATES register via SPI.

Warning: Avoid an immediate and unconditional leave Debug mode command in the MCU firmware. Such a
command may cause dead lock, when loading of new MCU firmware through JTAG may not be possible, as the
SBC is always switched to Normal mode right after startup in such a case.

Do you have unconditional startup code that writes the bit for the SBC to exit debug mode? If you do, then the question is if the device is in that dead lock state.

Regards,
Johnny