Unable to start debug session after STM0 counter rolls over at FFFF_FFFFh to 0000_000 in S32K344

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

Unable to start debug session after STM0 counter rolls over at FFFF_FFFFh to 0000_000 in S32K344

Jump to solution
935 Views
wyzykpimot
Contributor II

Hello, 

I am currently using S32K3X4EVB-Q172. The the issue was found while learning how to configure STM in the project without SDKs. I am not sure if this issue still exists with SDKs.

How to reproduce this issue:

  1. Make a new workspace
  2. Make new project without SDKs, with I/O support for Debugger Console.
  3. Configure the STM0 (I also configured the source of the timer to FXOSC, but the issue still exists with FIRC)
  4. Build the Debug_RAM version
  5. Debug in the Debug_RAM configuration
  6. Wait for the counter to overflow (changing the value of the counter in the registers will make it faster and should not change the outcome)
  7. Try to begin new debug session (it does not matter if the debug session is resumed, suspended or terminated.
  8. After these steps, the issue of not being able to debug is in every project in workspace, even in projects that worked before.

The only workaround I found is to make a new workspace.

The workarounds that did not work are:

  1. Changing debug hardware to Multilink Universal
  2. Changing S32K3X4EVB-Q172 to S32K3X4EVB-T172
  3. Making new project
  4. Reinstalling S32DS

I would be very thankful for any help in this matter.

Kind Regards,
Aleksander

1 Solution
793 Views
wyzykpimot
Contributor II

While preparing an example project I found out that the workspaces were breaking only if I used console routed to Telnet (set by default) and added STM0 related registers to Watch Registers .

For me, the problem is solved: I need  to route console to GDB client.

The only problem that still persists is that it is still uknown, what corrupts the workspaces and how to repair them.

I don't know if it will be still useful but:

Can you share the project so that I can test it on my side?

I attached exampleproject.zip file with an example project folder.

To achieve the error you need to route console to Telnet and add STM0 registers to Watch Registers

View solution in original post

0 Kudos
9 Replies
908 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Aleksander,

Can you share a screenshot of the error message?

In windows, Task Manager, can you locate PEMmicro gdb and end the task?

Does it happen when you use Debug_Flash?

 

Regards,

Daniel

 

0 Kudos
879 Views
wyzykpimot
Contributor II

Can you share a screenshot of the error message?

After suspenging I get those errors:

wyzykpimot_0-1689917564973.png

wyzykpimot_1-1689917575489.png

After terminating I get this error:

wyzykpimot_2-1689917603469.png

In windows, Task Manager, can you locate PEMmicro gdb and end the task?

I assume this is the task you wanted me to end:

wyzykpimot_3-1689919599844.png

Ending the task does not resolve the issue. After relaunching the problem still exists.

Does it happen when you use Debug_Flash?

Yes. To get the full picture you should know, that flashing program is done succesfully. After restarting the board, LED from Dio_Example blinks ten times but debugging is still impossible.

Kind Regards,

Aleksander

0 Kudos
874 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @wyzykpimot,

Still not sure what can be the root cause.

But you said that you reset the MCU after it has been flashed, and debugging after that is not possible.

Do you attach the debugger back to the MCU after the reset?

danielmartynek_0-1689937516148.png

 

Was the HSE_FW installed on the MCU?

 

BR, Daniel

0 Kudos
866 Views
wyzykpimot
Contributor II

But you said that you reset the MCU after it has been flashed, and debugging after that is not possible.

Little misunderstanding because of my wording. What I meant was:

After Debug_Flash the problem still exists. What I do know is that at least part of the debug session worked. Why? Because after I reset microcontroller, it starts executing the program I flashed in Debug_Flash. I cannot connect to the microcontroller after resetting too.

 

Do you attach the debugger back to the MCU after the reset?

After using the configuration you suggested and connecting to the MCU after the reset I get following informations:

wyzykpimot_0-1689939109990.png

wyzykpimot_1-1689939129165.png

When I suspend the debug session, it always shows this line of code:

wyzykpimot_2-1689939193622.png

Which is located in startup_cm7.s

 

Was the HSE_FW installed on the MCU?

It was not. I only tested the functionality of basic peripherials on this board.

 

Kind Regards,

Aleksander

0 Kudos
862 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Can you post the 3rd image once again, the resolution is very low.

 

Thanks

0 Kudos
858 Views
wyzykpimot
Contributor II

I pasted the first line:

    /*BKPT #1 - removed to avoid debug fault being escalated to hardfault when debugger is not attached or on VDK*/ /* last instruction for the debugger to dump results data */

wyzykpimot_0-1689940586379.png

Kind Regards,

Aleksander

 

0 Kudos
809 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @wyzykpimot,

It is hard to say.

Can you share the project so that I can test it on my side?

If you don't want to share it here, you can create a ticket.

 

Regards,

Daniel

 

0 Kudos
794 Views
wyzykpimot
Contributor II

While preparing an example project I found out that the workspaces were breaking only if I used console routed to Telnet (set by default) and added STM0 related registers to Watch Registers .

For me, the problem is solved: I need  to route console to GDB client.

The only problem that still persists is that it is still uknown, what corrupts the workspaces and how to repair them.

I don't know if it will be still useful but:

Can you share the project so that I can test it on my side?

I attached exampleproject.zip file with an example project folder.

To achieve the error you need to route console to Telnet and add STM0 registers to Watch Registers

0 Kudos
388 Views
Rexyz
Contributor I

Hello wyzykpimot,

I have the same problem. Did you resolve the issue?.

 

0 Kudos