S32k311 not working when Debugger is disconnected

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

S32k311 not working when Debugger is disconnected

1,469 Views
kiran5
Contributor I

Hi NXP Team,

I am using S32k311 microcontroller for our project. When I flash in the Debug mode the software is working fine. When i remove the Debugger the software is not working.

 

I thought it might be due to some code issue. So just used a gpio pin to toggle inside a while loop.

During this also while in debug mode, i am able to see the toggling of the PIN. Once i reset the power and it comes out if the Debug mode the MCU is not working.

I flashed  the Software in Debug Flash PNE mode.

I used the same method while using NXP KEA series controllers. It worked fine.

Want to know if any new settings are to be done in order to keep the code running once we come out of the Debug mode.

 

Thanks

Kiran.

 

0 Kudos
Reply
5 Replies

1,384 Views
kiran5
Contributor I

Hi Daniel

I created a new application project and just making a pin as output and toggling.

SIUL2.MSCR[1].B.OBE = 1;

while(1)

{

 

SIUL2.GPDO1.B.PDO_N =1;

for(int i=0; i<250;i++)

{

 

}

 

SIUL2.GPDO1.B.PDO_N =0;

 

Here the clock configuration is default. Still i am not able to observe the toggle when debugger is disconnected.

HSE clock is configured half of the core clock. Still code is not working.

 

Thanks

Kiran

0 Kudos
Reply

1,361 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Kiran,

 

Is the HSE_FW installed on the MCU?

 

Thank you

0 Kudos
Reply

1,355 Views
kiran5
Contributor I

Hi Daniel,

I am not sure about the HSE_FW or how it should be installed in the MCU.

Another behaviour is observed during our testing.

When i use the Example code in the s32ds for Uartk311 and remove the code in the main and add my simple toggling of the PIN using the SIUL register it works fine  in both debug and release mode. The testing is done on the development board.

kiran5_0-1753355791250.png

 

Same code when i use it with a newly created application project it is working only in the debug mode.

kiran5_1-1753355843675.png

 

Is there any changes which has to be done to start the code in ram in release mode?

One of my collegue is using s32k144 and he faced the same issue. It was resolved by updated the start address to main in the startup.s file.

 

 

Thanks

0 Kudos
Reply

1,351 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kiran5,

The HSE firmware (HSE_FW) is not installed by default.
It must be manually installed by the user.
The firmware is available in the S32K3xx Secure Files, which are accessible under NDA.

You can reconnect the debugger to the MCU.
In S32 Design Studio (S32DS), using the PE Micro plugin, attach the debugger and halt the core.

danielmartynek_0-1753364423664.png

Then, check the Configurable Fault Status Register (CFSR) to identify any fault exceptions.
https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-control-block/Configu...

A common issue may be incorrectly initialized ECC in volatile memory.
When using a debugger, memory is typically initialized automatically by the debugger.
However, when the MCU runs standalone, the application must handle memory initialization in the startup code.

 

Regards,

Daniel 

 

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2134134%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32k311%20not%20working%20when%20Debugger%20is%20disconnected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2134134%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20NXP%20Team%2C%3C%2FP%3E%3CP%3EI%20am%20using%20S32k311%20microcontroller%20for%20our%20project.%20When%20I%20flash%20in%20the%20Debug%20mode%20the%20software%20is%20working%20fine.%20When%20i%20remove%20the%20Debugger%20the%20software%20is%20not%20working.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20thought%20it%20might%20be%20due%20to%20some%20code%20issue.%20So%20just%20used%20a%20gpio%20pin%20to%20toggle%20inside%20a%20while%20loop.%3C%2FP%3E%3CP%3EDuring%20this%20also%20while%20in%20debug%20mode%2C%20i%20am%20able%20to%20see%20the%20toggling%20of%20the%20PIN.%20Once%20i%20reset%20the%20power%20and%20it%20comes%20out%20if%20the%20Debug%20mode%20the%20MCU%20is%20not%20working.%3C%2FP%3E%3CP%3EI%20flashed%26nbsp%3B%20the%20Software%20in%20Debug%20Flash%20PNE%20mode.%3C%2FP%3E%3CP%3EI%20used%20the%20same%20method%20while%20using%20NXP%20KEA%20series%20controllers.%20It%20worked%20fine.%3C%2FP%3E%3CP%3EWant%20to%20know%20if%20any%20new%20settings%20are%20to%20be%20done%20in%20order%20to%20keep%20the%20code%20running%20once%20we%20come%20out%20of%20the%20Debug%20mode.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EKiran.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E