Hello,
I am trying to find a way to stop the core of the S32M244 on the S32M24xEVB-L064 evaluation board. I am connected to the board via PJTAG. The plan is to perform a memory mass erase, stop the core, load a RAM bootloader, then start the core to execute the RAM bootloader. The procedure is done as follows:
1. Drive reset low
2. Perform a mass erase with MDM_AP
3. Stop the CPU
1. Set MDM_CONTROL debug request
2. Release reset
3. Stop CPU with DHCSR
4. Drive reset high
5. Check if CPU is stopped
6. Clear the MDM_CONTROL register
4. Drive reset high
5. Load bootloader code into RAM
6. Start bootloader
This procedure works in about 60% of the time. Sometimes an error occurs when checking if the CPU is stopped. After that it seems like the connection is broken, because the register readouts all return the same value, which appears to be buffered in the DAP.
Setting the MDM_CONTROL debug request should force the CPU to stop, which doesn't happen. The core can only be stopped by setting the bits in the DHCSR directly.
Has anyone experienced this problem or knows of a straightforward procedure to stop the core without any errors?