How to Disable Mass Erase on the FRDM-A-S32K344 have created two applications for the FRDM-A-S32K344. One application is located at address 0x00400000, and the other is located at address 0x00500000. When I flash one of the applications using the onboard debugger, it performs a mass erase and removes the other application as well. How can I disable mass erase and configure the debugger to erase only a specific flash region or section during programming? Re: How to Disable Mass Erase on the FRDM-A-S32K344 Hello,
OK, So you are able to load both binaries at once successfully.
But, you didn't mention that you will use bootloader.
What you actually want
Reset → Bootloader runs → wait for SW2 → jump to App
When using Launch Group in S32DS, each debug configuration loads its ELF and the last one determines the current PC. Therefore, the application entry point overrides the bootloader, causing it to be skipped.
To ensure correct bootloader execution, use a single debug configuration that loads both images but starts execution from the bootloader reset vector. Also disable “Run to main” to avoid skipping startup code.
After a real reset the S32K3 always starts execution from the predefined boot address (internal flash at 0x00400000), and the first valid image (typically your bootloader) is executed.
However, during debugging with S32DS, this behavior can be overridden by the debugger, which may set the program counter to the application entry point after loading ELF files, effectively bypassing the bootloader.
Best regards,
Peter Re: How to Disable Mass Erase on the FRDM-A-S32K344 Hello, Thank you for the suggestion. I created a Launch Group and added both the Bootloader and Application ELF debug configurations. However, when I start the debug session, it appears that only the application code is running, and the bootloader execution is being bypassed. My requirement is for the bootloader to execute first after reset and then jump to the application only when SW2 is pressed. Could you please advise if there are any additional Launch Group settings or debugger configurations required to ensure the bootloader runs before the application? I am using on board debugger in FRDM-A-S32K344 Re: How to Disable Mass Erase on the FRDM-A-S32K344 Hello,
In Debug Configurations, you can create a Launch Group and simply add all the ELF files you want to load. This lets you load multiple images (e.g. bootloader + application) in one go.
Best regards,
Peter Re: How to Disable Mass Erase on the FRDM-A-S32K344 Hello Can you explain how to configure S32DS so that both ELF files are loaded, but the PC is set to the bootloader Reset_Handler at 0x00400000 instead of the application entry point? Re: How to Disable Mass Erase on the FRDM-A-S32K344 Hi,
can you please check in Memory Browser (during Debug session) if the memory space from 0x00400000 is empty (has been erased by PE Micro) or there is only rewritten entry point?
The multiple .elf files are typically used with multicore MCUs. With single core it may be little bit tricky. One usable way is to have two debug session - in first one use the bootloader .elf file and second one with app, but you need to define which memory space should be preserved. PE Micro always performs mass erase, the preserve memory simply reads data from the preserved memory space, performs mass erase, write back the preserved data and write data from second .elf file.
Other possibility is use s-record tool ( https://srecord.sourceforge.net/ ) , from both .elf files create s-record and merge both s-records with this tool and use merged .srec instead of .elf. You can still use .elf files for debug and symbols.
查看全文