Skip to content

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

Open

Description

@harishn6

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

  • I have verified before submitting the report.

Activity

  1. added
    Community: Question
    on Oct 8, 2025
  2. acassis commented on Oct 8, 2025

    @acassis
    Contributor

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

  3. PetervdPerk-NXP commented on Oct 10, 2025

    @PetervdPerk-NXP
    Contributor

    @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.

  4. keykur111 commented on Oct 14, 2025

    @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.

    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
  5. keykur111 commented on Oct 14, 2025

    @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
  6. keykur111 commented on Oct 14, 2025

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Community: Question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions