nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[HELP] Optimization Level -O2 issue for NXP's S32K148

Open harishn6 opened this issue 2 months ago • 5 comments

Description

Hi,

Iam trying to run few examples or Applications on NXP's S32K148 hardware by using NuttX RTOS. These Applications or examples mainly for Performance related, So i configured optimization options as below. CONFIG_DEBUG_CUSTOMOPT=y CONFIG_DEBUG_OPTLEVEL="-O2"

with this configuration if i generate binary and flash on S32K148 during pin configuration or uart configuration triggering exception_common handler. Please check attached screenshot for more details.

Image

Could you please let me know how to configure optimization level O2 properly or is it a known issue?

Thanks, Harish Nayineni

Verification

  • [x] I have verified before submitting the report.

harishn6 avatar Oct 08 '25 04:10 harishn6

@PetervdPerk since you worked on this port, do you have some idea why is he facing this issue?

acassis avatar Oct 08 '25 21:10 acassis

@harishn6 which board are you using? If possible could switch frame to the s32K1xx_pinconfig function and see if you can get the port and the pin numbers where the crash occurs? Most likely it could that for your board the peripheral_clock_config_s the clock for the port you use is turned off.

PetervdPerk-NXP avatar Oct 10 '25 09:10 PetervdPerk-NXP

@harishn6 which board are you using? If possible could switch frame to the s32K1xx_pinconfig function and see if you can get the port and the pin numbers where the crash occurs? Most likely it could that for your board the peripheral_clock_config_s the clock for the port you use is turned off.

Hello @PetervdPerk-NXP I am working on the same issue along with @harishn6 Board is S32K148 evolution board

Image

please find the s32K1xx_pinconfig Here i doubt regval, does is suppose to be 0?. (values are visible in watch window)

Image > also one more stack call trace down

keykur111 avatar Oct 14 '25 05:10 keykur111

I traced memory for putreg32 try to update the port control registers as per my understanding. I can observed no memory location is getting updated. I kept the screenshot for both configuration runtime at the same point. Note: to solve above optimization of regval i have made it volatile for -O2 case

Image

with Os configuration (default)

Image Image

with O2 configuration (optimized)

Image Image

keykur111 avatar Oct 14 '25 06:10 keykur111

@harishn6 which board are you using? If possible could switch frame to the s32K1xx_pinconfig function and see if you can get the port and the pin numbers where the crash occurs? Most likely it could that for your board the peripheral_clock_config_s the clock for the port you use is turned off.

Hi @PetervdPerk-NXP for peripheral_clock_config_s do you have any control register or memory to read or some way to check if it is enabled or not.

keykur111 avatar Oct 14 '25 09:10 keykur111