Regarding the question of S32K312 using JLink for online debugging

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Regarding the question of S32K312 using JLink for online debugging

Jump to solution
1,081 Views
Jason_L
Contributor II

Hi NXP TechSupport,

Use the routine engineering that comes with the software, use JLink to connect to online debugging, and the relevant settings for debugging are as shown in the following figure. When loaded into the debugging window, the debugging process is not entered correctly.

1Main.jpg2Debugger.jpg3startup.jpg3startup2.jpg4Debug result.jpg

0 Kudos
Reply
1 Solution
941 Views
Jason_L
Contributor II

Hi @Julián_AragónM ,

The problem that J-Link cannot be debugged properly in SWD mode is due to the Debug configuration settings.In the Debug configuration, the Enable SWO option in the Startup page is selected, and other settings are not set, which affects the debugging and prevents normal debugging. Tick off the options in the following diagram to get back to normal.

3startup.jpg

Thank you for your technical support.

Best regards,
Jason

View solution in original post

4 Replies
1,059 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Jason_L,

Could you confirm you can debug correctly this project with PE Micro? Just so we can rule out if the project is faulty.

You can also try using J-Flash to see if the debugger is the issue or not. You should be able to select a new project and configure the S32K312 as target device, then just trying to erase the MCU or program a binary:

Julin_AragnM_2-1716327038232.png

Julin_AragnM_0-1716326783435.png

I can successfully debug the S32K344EVB with a J-Link debugger. The only difference I can spot is the executable directory for both J-Link GDB and GDB Client Setup (but if you are able to go into debug view this is probably not the issue).

Julin_AragnM_1-1716326979133.png

Best regards,
Julián

0 Kudos
Reply
1,034 Views
Jason_L
Contributor II

Hi @Julián_AragónM ,

Thank you for your reply. Regarding your question, sorry I couldn't find PE Micro to confirm if there was a problem with the project. Regarding the project I created, this project is a sample project and I haven't tried to modify it.
As you said, I tried to use J-Flash to connect and download binary, and everything worked fine.
The operation is as follows:

JLink program.jpg

Application log started
- J-Flash V7.96h (J-Flash compiled May 15 2024 15:37:47)
- JLinkARM.dll V7.96h (DLL compiled May 15 2024 15:37:22)
Reading flash device list [D:\NXP\S32DS.3.5\Drivers\SEGGER\JLink_V796h\ETC/JFlash/Flash.csv] ...
- List of flash devices read successfully (451 Devices)
Reading MCU device list ...
- List of MCU devices read successfully (10955 Devices)
Creating new project ...
- New project created successfully
Connecting ...
- Connecting via USB to probe/ programmer device 0
- Probe/ Programmer firmware: J-Link V9 compiled May 7 2021 16:26:12
- Probe/ Programmer S/N: 69408534
- Device "S32K312" selected.
- Target interface speed: 4000 kHz (Fixed)
- VTarget = 3.309V
- ConfigTargetSettings() start
- ConfigTargetSettings() end - Took 13us
- InitTarget() start
- SDA_AP detected
- Checking if debug access is already enabled...
- Core already enabled
- Checking if HSE firmware is installed...
- HSE firmware not installed
- Checking if Cortex-M7_0 and Cortex-M7_1 are operating in lockstep mode
- Lock step mode disabled or not available
- InitTarget() end - Took 8.10ms
- Found SW-DP with ID 0x6BA02477
- DPIDR: 0x6BA02477
- CoreSight SoC-400 or earlier
- AP map detection skipped. Manually configured AP map found.
- AP[0]: MEM-AP (IDR: Not set)
- AP[1]: APB-AP (IDR: Not set)
- AP[2]: MEM-AP (IDR: Not set)
- AP[3]: AHB-AP (IDR: Not set)
- AP[4]: AHB-AP (IDR: Not set)
- AP[5]: AHB-AP (IDR: Not set)
- AP[6]: MEM-AP (IDR: Not set)
- AP[7]: MEM-AP (IDR: Not set)
- AP[4]: Skipped ROMBASE read. CoreBaseAddr manually set by user
- AP[4]: Core found
- CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
- Cache: L1 I/D-cache present
- Found Cortex-M7 r1p2, Little endian.
- FPUnit: 8 code (BP) slots and 0 literal slots
- ROM table scan skipped. CoreBaseAddr manually set by user: 0x40250400
- I-Cache L1: 8 KB, 128 Sets, 32 Bytes/Line, 2-Way
- D-Cache L1: 8 KB, 64 Sets, 32 Bytes/Line, 4-Way
- SetupTarget() start
- ECC RAM init skipped.
- SetupTarget() end - Took 2us
- Executing init sequence ...
- Initialized successfully
- Target interface speed: 4000 kHz (Fixed)
- Found 1 JTAG device. Core ID: 0x6BA02477 (None)
- Connected successfully
Opening data file [C:\Users\win11\workspaceS32DS.3.5\I2c_IP_FLEXIO_Transfer_S32K312\Debug_FLASH\I2c_IP_FLEXIO_Transfer_S32K312.bin] ...
- Data file opened successfully (38948 bytes, 1 range, CRC of data = 0x07C4B116, CRC of file = 0x07C4B116)
Auto programming target (38948 bytes, 1 range) ...
- Checking if selected data fits into selected flash sectors.
- Start of preparing flash programming
- End of preparing flash programming
- Start of determining dirty areas in flash cache
- End of determining dirty areas
- CPU speed could not be measured.
- Start of erasing sectors
- Blank checking 0x00400000 - 0x00409FFF
- Erasing range 0x00400000 - 0x00409FFF ( 5 Sectors, 40 KB)
- End of erasing sectors
- Start of flash programming
- Programming range 0x00400000 - 0x00407FFF ( 4 Sectors, 32 KB)
- Programming range 0x00408000 - 0x00409FFF ( 1 Sector, 8 KB)
- End of flash programming
- Flash programming performed for 1 range (40960 bytes)
- 0x400000 - 0x409FFF ( 5 Sectors, 40 KB)
- Start of verifying flash
- End of verifying flash
- Start of restoring
- End of restoring
- Executing exit sequence ...
- De-initialized successfully
- Target erased, programmed and verified successfully - Completed after 0.363 sec

 

111.jpg

The debug mode outputs the result.

 

Best regards,

Jason

0 Kudos
Reply
1,019 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Jason_L,

Please check the optimization inside the project's properties is set to 0:

Julin_AragnM_0-1716394203277.png

Best regards,
Julián

0 Kudos
Reply
942 Views
Jason_L
Contributor II

Hi @Julián_AragónM ,

The problem that J-Link cannot be debugged properly in SWD mode is due to the Debug configuration settings.In the Debug configuration, the Enable SWO option in the Startup page is selected, and other settings are not set, which affects the debugging and prevents normal debugging. Tick off the options in the following diagram to get back to normal.

3startup.jpg

Thank you for your technical support.

Best regards,
Jason