I'm using FTFE flash in a MK22FX512VLL12 device and have kludged in some capabilities for FlashX support in MQX based on FTFL drivers.
From the reference manual for the MK22FX device, the Data Flash 0 IFR section should have the EEPROM and DEPART codes at the following locations:
For the Data Flash 0 IFR, our resource select code is 0x00 and the local address range is 0x80_0000–0x80_03FF.
Data in FTFE is big-endian, and the flash address must be 64-bit aligned, which means I need to read at 0x8003F8 to get the start of my block that will index into the IFR.
According to the reference manual (again), the following FCCOB registers highlight the corresponding data returned:
Using a DSTREAM ICE, the corresponding FCCOB registers that are returned from a previously partitioned device are:
The indices in command_array (above) correspond directly to the FCCOB number, so FCCOB = 0x03, which is the Read Resource command. The address is 0x8003F8, and so forth. I am reading in the full 12-bytes from FCCOB.
Since I expect my data to be at 0x03FC, 0x03FD, and my 8-byte buffer (now in FCCOB) starts at 0x03F8, I should expect my data to be in FCCOB and FCCOB (right?). Yet, looking at FCCOB and FCCOB, above, we see that these are 0xFF bytes. It almost appears that the actual EEPROM data size (and split) and DEPART codes are stored at FCCOB[A] and FCCOB[B].
Note: reading the SIM_FCFG1 register gives me valid results for EESIZE and DEPART, and I can start to use that to determine if the partition is created, but all of our other code relies on the Read Resource command and I'd like to understand this better anyway...
(For completeness, I've included the EESIZE and DEPART codes so it can be seen that command_array, command_array might actually contain valid partition codes.)
My goal is for EESPLIT to be 0x3 (1/2A + 1/2B), EESIZE to be 4096 Bytes (EEPROM code = 0x32), and for the partition code to be 64 kB Data Flash and 64 kB EEPROM Backup (16x 4 kB) (DEPART = 0x4).
Thanks for any insights, Freescale Community