Unable to debug using ‘S32 Design Studio for Arm’ and Segger J-Link Classic Base

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

Unable to debug using ‘S32 Design Studio for Arm’ and Segger J-Link Classic Base

Jump to solution
2,889 Views
johngreenjets
Contributor III

am trying to use a Segger J-Link debugger with ‘S32 Design Studio for Arm IDE’.

I am using a ‘UCANS32K146’ evaluation board which has a S32K146 processor.

I set a breakpoint as shown...

johngreenjets_0-1683040880636.png

 

But the debugger does not seem to run to or stop at the break point, it seems to be in reset ?

Below is a copy of the console messages...

SEGGER J-Link GDB Server V6.42a Command Line Version

JLinkARM.dll V6.42a (DLL compiled Feb  1 2019 18:00:08)

Command line: -if swd -device S32K146 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 S32K146
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jan 30 2023 11:28:07
Hardware: V10.10
S/N: 50116597
Feature(s): GDB
Checking target voltage...
Target voltage: 3.27 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)
Read 2 bytes @ address 0x00000000 (Data = 0xFFFF)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xFFFFFFFE)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 0 0 0x1 0
Failed to enable SWO. Could not measure target CPU frequency.
Read 2 bytes @ address 0x0000C5C8 (Data = 0x0000)
Read 2 bytes @ address 0x000070F0 (Data = 0x0000)
Read 4 bytes @ address 0xFFFFFFFE (Data = 0x00000000)
Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
Downloading 1024 bytes @ address 0x00000000 - Verified OK
Downloading 16 bytes @ address 0x00000400 - Verified OK
Downloading 15888 bytes @ address 0x00000410 - Verified OK
Downloading 15872 bytes @ address 0x00004220 - Verified OK
Downloading 16064 bytes @ address 0x00008020 - Verified OK
Downloading 15920 bytes @ address 0x0000BEE0 - Verified OK
Downloading 7392 bytes @ address 0x0000FD10 - Verified OK
Downloading 1004 bytes @ address 0x000119F0 - Verified OK
Downloading 960 bytes @ address 0x00011DDC - Verified OK
Downloading 16 bytes @ address 0x0001219C - Verified OK
Downloading 8 bytes @ address 0x000121AC - Verified OK
Downloading 2472 bytes @ address 0x000121B4 - Verified OK
WARNING: CPU could not be halted
ERROR: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
Can not read register 16 (XPSR) while CPU is running
Can not read register 20 (CFBP) while CPU is running
Can not read register 0 (R0) while CPU is running
Can not read register 1 (R1) while CPU is running
Can not read register 2 (R2) while CPU is running
Can not read register 3 (R3) while CPU is running
Can not read register 4 (R4) while CPU is running
Can not read register 5 (R5) while CPU is running
Can not read register 6 (R6) while CPU is running
Can not read register 7 (R7) while CPU is running
Can not read register 8 (R8) while CPU is running
Can not read register 9 (R9) while CPU is running
Can not read register 10 (R10) while CPU is running
Can not read register 11 (R11) while CPU is running
Can not read register 12 (R12) while CPU is running
Can not read register 14 (R14) while CPU is running
Can not read register 15 (R15) while CPU is running
Can not read register 17 (MSP) while CPU is running
Can not read r
Writing register (PC = 0x     528)
Read 2 bytes @ address 0x0000C5C8 (Data = 0x0000)
Read 2 bytes @ address 0x000070F0 (Data = 0x0000)
Read 4 bytes @ address 0x00000528 (Data = 0x00000000)
Read 2 bytes @ address 0x00000528 (Data = 0x0000)
Read 2 bytes @ address 0x0000B2E2 (Data = 0x0000)
Read 2 bytes @ address 0x0000B364 (Data = 0x0000)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xFFFFFFFE)
Read 2 bytes @ address 0x0000B2E2 (Data = 0xFFFF)
Read 2 bytes @ address 0x0000B2E2 (Data = 0xFFFF)
Read 2 bytes @ address 0x0000B2E2 (Data = 0xFFFF)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE
Setting breakpoint @ address 0x0000B2E2, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x0000B364, Size = 2, BPHandle = 0x0002
Starting target CPU...
Debugger requested to halt target...
WARNING: CPU could not be halted
Reading all registers
WARNING: CPU could not be halted
ERROR: Can not read register 0 (R0) while CPU is running
ERROR: Can not read register 1 (R1) while CPU is running
ERROR: Can not read register 2 (R2) while CPU is running
ERROR: Can not read register 3 (R3) while CPU is running
ERROR: Can not read register 4 (R4) while CPU is running
ERROR: Can not read register 5 (R5) while CPU is running
ERROR: Can not read register 6 (R6) while CPU is running
ERROR: Can not read register 7 (R7) while CPU is running
ERROR: Can not read register 8 (R8) while CPU is running
ERROR: Can not read register 9 (R9) while CPU is running
ERROR: Can not read register 10 (R10) while CPU is running
ERROR: Can not read register 11 (R11) while CPU is running
ERROR: Can not read register 12 (R12) while CPU is running
ERROR: Can not read register 13 (R13) while CPU is running
ERROR: Can not read register 14 (R14) while CPU is running
ERROR: Can not read register 15 (R15) while CPU is running
ERROR: Can not read register 16 (XPSR) while CPU is running
ERROR: Can not read register 17 (MSP) while CPU is running
ERROR: Can not read register 18 (PSP) while CPU is running
ERROR: Can not read register 24 (PRIMASK) while CPU is running
ERROR: Can not read register 25 (BASEPRI) while CPU is running
ERROR: Can not read register 26 (FAULTMASK) while CPU is running
ERROR: Can not read register 27 (CONTROL) while CPU is running
ERROR: Can not read register 32 (FPSCR) while CPU is running
ERROR: Can not read register 33 (FPS0) while CPU is running
ERROR: Can not read register 34 (FPS1) while CPU is running
ERROR: Can not read register 35 (FPS2) while CPU is running
ERROR: Can not read register 36 (FPS3) while CPU is running
ERROR: Can not read register 37 (FPS4) while CPU is running
ERROR: Can not read register 38 (FPS5) while CPU is running
ERROR: Can not read register 39 (FPS6) while CPU is running
ERROR: Can not read register 40 (FPS7) while CPU is running
ERROR: Can not read register 41 (FPS8) while CPU is running
ERROR: Can not read register 42 (FPS9) while CPU is running
ERROR: Can not read register 43 (FPS10) while CPU is running
ERROR: Can not read register 44 (FPS11) while CPU is running
ERROR: Can not read register 45 (FPS12) while CPU is running
ERROR: Can not read register 46 (FPS13) while CPU is running
ERROR: Can not read register 47 (FPS14) while CPU is running
ERROR: Can not read register 48 (FPS15) while CPU is running
ERROR: Can not read register 49 (FPS16) while CPU is running
ERROR: Can not read register 50 (FPS17) while CPU is running
ERROR: Can not read register 51 (FPS18) while CPU is running
ERROR: Can not read register 52 (FPS19) while CPU is running
ERROR: Can not read register 53 (FPS20) while CPU is running
ERROR: Can not read register 54 (FPS21) while CPU is running
ERROR: Can not read register 55 (FPS22) while CPU is running
ERROR: Can not read register 56 (FPS23) while CPU is running
ERROR: Can not read register 57 (FPS24) while CPU is running
ERROR: Can not read register 58 (FPS25) while CPU is running
ERROR: Can not read register 59 (FPS26) while CPU is running
ERROR: Can not read register 60 (FPS27) while CPU is running
ERROR: Can not read register 61 (FPS28) while CPU is running
ERROR: Can not read register 62 (FPS29) while CPU is running
ERROR: Can not read register 63 (FPS30) while CPU is running
ERROR: Can not read register 64 (FPS31) while CPU is running
ERROR: Can not read register 15 (R15) while CPU is running
ERROR: Can not read register 16 (XPSR) while CPU is running
ERROR: Can not read register 17 (MSP) while CPU is running
ERROR: Can not read register 18 (PSP) while CPU is running
ERROR: Can not read register 19 (RAZ) while CPU is running
ERROR: Can not read register 20 (CFBP) while CPU is running
ERROR: Can not read register 21 (APSR) while CPU is running
ERROR: Can not read register 22 (EPSR) while CPU is running
ERROR: Can not read register 23 (IPSR) while CPU is running
ERROR: Can not read register 24 (PRIMASK) while CPU is running
ERROR: Can not read register 25 (BASEPRI) while CPU is running
ERROR: Can not read register 26 (FAULTMASK) while CPU is running
ERROR: Can not read register 27 (CONTROL) while CPU is running
ERROR: Can not read register 28 (BASEPRI_MAX) while CPU is running
ERROR: Can not read register 29 (IAPSR) while CPU is running
ERROR: Can not read register 30 (EAPSR) while CPU is running
ERROR: Can not read register 31 (IEPSR) while CPU is running
ERROR: Can not read register 32 (FPSCR) while CPU is running
ERROR: Can not read register 33 (FPS0) while CPU is running
ERROR: Can not read register 34 (FPS1) while CPU is running
ERROR: Can not read register 35 (FPS2) while CPU is running
ERROR: Can not read register 36 (FPS3) while CPU is running
ERROR: Can not read register 37 (FPS4) while CPU is running
ERROR: Can not read register 38 (FPS5) while CPU is running
ERROR: Can not read register 39 (FPS6) while CPU is running
ERROR: Can not read register 40 (FPS7) while CPU is running
ERROR: Can not read register 41 (FPS8) while CPU is running
ERROR: Can not read register 42 (FPS9) while CPU is running
ERROR: Can not read register 43 (FPS10) while CPU is running
ERROR: Can not read register 44 (FPS11) while CPU is running
ERROR: Can not read register 45 (FPS12) while CPU is running
ERROR: Can not read register 46 (FPS13) while CPU is running
Read 4 bytes @ address 0xDEADBEEE (Data = 0x00000000)
WARNING: Failed to read memory @ address 0xDEADBEEF
Removing breakpoint @ address 0x0000B2E2, Size = 2
Removing breakpoint @ address 0x0000B364, Size = 2
Read 2 bytes @ address 0x0000B2E2 (Data = 0x0000)
Read 2 bytes @ address 0x0000B2EC (Data = 0x0000)
Setting breakpoint @ address 0x0000B2E2, Size = 2, BPHandle = 0x0003
Setting breakpoint @ address 0x0000B2EC, Size = 2, BPHandle = 0x0004
Setting breakpoint @ address 0x0000B364, Size = 2, BPHandle = 0x0005
Starting target CPU...

 

The Segger control panel shows the following...

johngreenjets_1-1683040880638.png

 

The LED on the Segger looks to be orange/red (its hard to tell) which means its either in reset or there's a fault.

A screenshot of the IDE during debugging is shown below...

johngreenjets_2-1683040880639.png

 

I was expecting the IDE to stop at that breakpoint so I could step through the lines of code.

0 Kudos
Reply
1 Solution
2,724 Views
johngreenjets
Contributor III

Thanks Daniel

I installed the correct SDK...

Picture3.jpg

And used the can_pal_s32k146 example and this worked correctly (after a few minor tweaks to the software)...

Picture2.jpg

Thanks for your help

View solution in original post

0 Kudos
Reply
8 Replies
2,879 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Could you help us sharing the last image with higher quality? We are not able to distinguish the red text on the one you have provided.

Also, we are seeing that Segger may not have support for our IDE:

J-Link: Supported IDEs Overview (segger.com)

Since the UCAN platform contains an S32K1 MCU, these are commonly bundled with either PE Micro or an OpenSDA connection, but not a JLink.

By seeing your log, it seems that the JLink could not halt the MCU, which does not allow to debug. Have you previously used this tool with an S32K1 MCU? Or is this the first time?

Please, let us know.

0 Kudos
Reply
2,868 Views
johngreenjets
Contributor III

Thanks Daniel

Apologies for the poor resolution images, please find better images attached

This is the first time I have used the Segger with this IDE and S32K processor.

I have only previously used the Segger with the MCUXpresso IDE and K66 processor.

0 Kudos
Reply
2,857 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Thanks for your feedback.

Since UCAN board seems to have a different connector, could be that the pin mapping of the debugger is not as the UCAN needs it.

Can you help us probe the S32_RST_N signal when you try to use the JLink? Below will be an image of the schematic:

DanielAguirre_0-1683143595603.png

You could probe the signal wherever you have access to. If the RST signal is being controlled by the JLink, then you should see a toggle on the RST signal.

Also, are you using an example for this?

Please, let us know.

0 Kudos
Reply
2,852 Views
johngreenjets
Contributor III

Hi Daniel

I dont have access to an oscilloscope so I'm unable to probe the reset pin.

The example code I am using is this...

https://nxp.gitbook.io/ucans32k1/s32k1-sdk/sdk-example-with-libuavcan

 

 

0 Kudos
Reply
2,827 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Thanks for your feedback.

How are you building the application? We are seeing there are different build configurations.

Also, how are you configuring the "Main", "Debugger" and "Startup" tabs inside the debug configuration window?

Under the S32K1 provided SDK's there seems to be ready to use JLink configurations, which should provide you with a usable debug configuration. You could try and use one of the out-of-the-box examples to see if the behavior remains the same.

Please, let us know.

0 Kudos
Reply
2,820 Views
johngreenjets
Contributor III

I build as shown in the screenshot below (Node_A_Debug)...

johngreenjets_3-1683283433325.png

The "Main", "Debugger" and "Startup" tabs inside the debug settings is shown below...

johngreenjets_0-1683283347455.png

 

johngreenjets_1-1683283373248.png

johngreenjets_2-1683283383889.png

I downloaded and installed "S32_SDK_S32K1xx_RTM_4.0.3" and imported the example '\adc_low_power' but this won't even build as it gives the error "/bin/sh: arm-none-eabi-gcc: command not found"...

johngreenjets_4-1683283769044.png

 

It shouldn't be this difficult to get example code working on a development board !

Could someone from NXP contact me to arrange a screen share session to help resolve the problem ?

 

 

 

 

0 Kudos
Reply
2,805 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Thanks for your feedback.

The SDK that you are trying to import into S32DS for ARM v2.2 is not compatible with that IDE, it is compatible with S32 Design Studio v3.4. That should be why you are seeing that error.

The one that it is compatible with S32DS for ARM v2.2 should be provided with the IDE, image below:

DanielAguirre_1-1683324597184.png

Within the examples provided with the SDK, the following configurations should be provided:

DanielAguirre_0-1683324543465.png

In our specific case, we use the FreeRTOS project as an example. This should be ready to use.

Please, let us know.

0 Kudos
Reply
2,725 Views
johngreenjets
Contributor III

Thanks Daniel

I installed the correct SDK...

Picture3.jpg

And used the can_pal_s32k146 example and this worked correctly (after a few minor tweaks to the software)...

Picture2.jpg

Thanks for your help

0 Kudos
Reply