Hi,
I am writing to report an issue we are facing with the S32K118 microcontroller related to DEPART register and D Flash programming.
We previously enabled the Program Partition command in our firmware with the following configuration:
FTFC->FCCOB[3] = 0x80; /* FCCOB0 = Program Partition command */
FTFC->FCCOB[6] = 0x03; /* FCCOB5 = 0x03, no data flash, 32k(all) EEPROM backup */
This set the DEPART register to 0x03, configuring the FlexNVM as full EEPROM backup with no Data Flash.
Unable to Flash D Flash Region:
In certain cases, we need to flash the OpenBLT bootloader to the D Flash (Data Flash) region of the S32K118. However, when attempting to program this region using S32DS with the debug/flash option, we receive the following error:
Calculated CRC-16 does not match block. (File = $CEA2, Device = $0000)
Current content of flash does not match application to be programmed
We suspect this error is caused by the DEPART register being set to 0x03 (no Data Flash available), which prevents programming of the D Flash region entirely.
DEPART Register Not Changing:
We attempted to reset the DEPART register back to its default value (0x00) by running the full Program Partition command sequence again with the updated FCCOB5 value. However, the DEPART register value does not change.
However, we tested the exact same procedure on the S32K144, and the DEPART register changed successfully as expected.
Questions:
Is our above suspicion correct regarding the CRC error and DEPART being the root cause?
Is there a recommended procedure to reset the DEPART register to its default value (0x0) on an already-partitioned S32K118 device?
- What is the correct approach to flash the D Flash region when DEPART is already set to 0x03 on S32K118?
Environment:
- Device: S32K118
- IDE: S32DS
- Bootloader: OpenBLT
- FCCOB values used: FCCOB0 = 0x80, FCCOB4 = 0x03, FCCOB5 = 0x03
Please advise on the correct approach to resolve this issue.