Hi Daniel,
1. I attempted unlocking using all register combinations mentioned in the Reference Manual, including:
PFLASH.PFCBLK_SSPELOCK[0].R = 0x00000000U; //PFlash Block0
PFLASH.PFCBLK_SSPELOCK[1].R = 0x00000000U; //PFlash Block1
FLASH.SPELOCK.R = 0x00000000U;
FLASH.SSPELOCK.R = 0x00000000U;
FLASH.XSPELOCK.R = 0x00000000u;
FLASH.XSSPELOCK.R = 0x00000000u;
PFLASH.PFCBLK_SPELOCK[0].R = 0x00000000U;
PFLASH.PFCBLK_SPELOCK[1].R = 0x00000000U;
PFLASH.PFCBLK_SPELOCK[2].R = 0x00000000U;
PFLASH.PFCBLKU_SPELOCK[0].R = 0x00000000U; // UTEST block lock
However, DFlash always remains locked, and any erase/program attempt sets PES=1 .
Could you please clarify:
The correct register and register index for D-Flash block on S32K311.
Whether D-Flash on S32K311 requires a special unlock mechanism (UTEST fuse, FCCU, life-cycle state, etc.).
Any reference example showing successful D-Flash unlock + write.
2. Unable to unlock last 256 KB of P-Flash:
Anything at or above 0x004B0000 – 0x004FFFFF remains locked even after using all register combinations mentioned above.
Is this region controlled by a different lock block (Block 2?) or shared with D-Flash?