s32k118 code lost on reboot

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

s32k118 code lost on reboot

跳至解决方案
388 次查看
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

标记 (1)
0 项奖励
回复
1 解答
341 次查看
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 项奖励
回复
1 回复
342 次查看
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 项奖励
回复