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 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.
Update: It 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
How do I resolve the problem?
Thanks,
Arush
已解决! 转到解答。
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.
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------