I have a S32K148EVB-Q144 board with which I have been toying for some time. I'm using Keil IDE and ULINKpro to develop and download/debug software. Up until now, everything was working fine.
But today I tried to configure the CLKOUT pin to mirror the clock signal from PLL. After that, I could no longer download or erase the program flash in Keil IDE using ULINKpro programmer. I tried every available SW clock, but no luck.
I remember a similar problem with a LPC1769 MCU, where the chip entered an unstable state right after reset and I could no longer reprogram it nor erase it either. I was able to solve this by erasing the entire flash using the FlashMagic software. However, FlashMagic does not support the S32K148.
I looked into the manual and found the following:
In addition, the entire flash memory can be erased from the external SWJ-DP debug port
according to this sequence:
1. Set MDM-AP Control.
2. MDM-AP Status sets to indicate the mass erase command has been accepted.
3. MDM-AP Status clears when the mass erase completes.
But I have no idea how to perform these steps.
Please, help me solve this issue!