s32k118 code lost on reboot

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

s32k118 code lost on reboot

Jump to solution
261 Views
ArushThomas
Contributor II

Hello,

I was writing a project for an s32k118 48pin microcontroller on custom hardware, when I came across an unexpected problem; the code I flash to the MCU does not appear to be persistent. When I power-cycle the board, the previously running code does not execute. I need to reupload the code for it to execute. I was expecting previously flashed code to start running, when power is supplied to the MCU.

I am using a Segger J-link debugger and SWD interface.

I'm quite confident I'm flashing code to FLASH memory, not RAM:

  • I have tried using the DEBUG_FLASH as well as the RELEASE_FLASH configurations.
  • The Generator_Configurations menu in the Components tab shows that FLASH is the active configuration.
  • Going through the project settings, I can see that the *_Flash.ld linker file is in use.

I can replicate this issue across various projects in the workspace. I can also replicate the problem on a fresh workspace. For reference, I've attached the Blinky project, which replicates the problem.

UpdateIt seems I only have this issue on "S32DS Application Projects", not on "S32DS Project from Examples". I adapted the hello_world_s32k118 project and uploaded it to the board, and the code does work after power-cycling.

I've tried both the "S32DS for ARM" and "S32DS for S32 Platform" versions of the IDE, and this behaviour is consistent across both; only Example Projects work after power-cycling. Clearly there's some configuration difference between my application projects, and the example projects. (I have previously developed on a custom s32k144 board, so I can't imagine what this difference may be)

Regardless, I am attaching "hello_world_s32k118.rar", a project which is persistent across power-cycles.

On the hardware side, the MCU is receiving stable 3.3 volts power supply. The RESET pin (PTA5) is pulled up to 3v3 by a 10k resistor. a 20MHz oscillator is connected across PTB6 and PTB7.

I've attached screenshots to show the project settings and debugger configurations

Debugger ConfigurationDebugger ConfigurationFLASH configurations selectedFLASH configurations selectedStartup ConfigurationsStartup ConfigurationsLinker file, _flash.ldLinker file, _flash.ldGeneral Linker settingsGeneral Linker settingsFLASH selected in Generator_ConfigurationsFLASH selected in Generator_Configurations

How do I resolve the problem?

Thanks,

Arush

Tags (1)
0 Kudos
Reply
1 Solution
214 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Arush,

It should be caused by not adding START_FROM_FLASH in the correct place. Please refer to the discussion in S32K188 runs with debugger, but not witout


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
215 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Arush,

It should be caused by not adding START_FROM_FLASH in the correct place. Please refer to the discussion in S32K188 runs with debugger, but not witout


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply