I have code that used to be run on Arduino that runs EEPROM.put/get with uint16 and uint32.
I assume with the FEE MCAL drivers that I need to split these into 2/4 uint8 byte chunks to pass through to the FEE_Write and if I just give it a uint16 array it will not work, but I wanted to ask to make sure.
Similarly for Read that if I gave it a pointer to a uint16 array that it will not give me the full 16 bits and that I need to have an uint8 array of double the length that I then realign into a single value.
Hi @pb632146
You are supposed to configure your Fee Blocks in the configurator like this:
One Fee Block is a record which you will update when calling Fee_Write function.
The size can be set from 1 - 65535 bytes:
The maximum 65535 is theoretical value only, it's limited by sector size. But Fee is usually used for small blocks of data, so it doesn't matter. You can use any size.
And you are simply passing pointer to uint8. It doesn't matter what kind of arrays or data structure you have, you just need to pass the pointer.
In case of Fee_Read, you are also just passing uint8 pointer. In addition, you are allowed to read only part of the record - this is specified by offset and length:
Regards,
Lukas
Thank you, so regardless of I pass it a uint8 variable or an array(like in fee_example_s32k344) it will properly write the correct amount of bytes
1. Also is there an easier way to generate large amounts of Fee Blocks? I am looking to store up to 100 sensor info with 50 calibration points of 23 bytes and while I can make the blocks 23 bytes for the calibration points it would be nice to avoid having to manually add 5000 fee config blocks, as well as be able to adjust the ratio of sensors and calibration points more easily. Something like giving it an XML sheet?
2. In the worst case I could make each sensor be a block 1000 bytes large as I do not need to calibrate often, but how do I actually assign Memsector batches properly?
To do so I would like to make one large sector batch of about 120kb. The memsector batches are made in 8kb physical sectors so I would need to connect multiple. Is it just increasing the "Mem number of sectors" to however many continuous sectors I need and increasing the erase size to 120k? Or do I add multiple batches of sequential physical sectors?
3. Also I have been trying to convert the FEE_Example_S32K344 to run on my 342, but it just hard faults during FEE_init().
Any help on what to do to fix this would be greatly appreciated.
1. The only option I can see is to edit the *.mex file. You need to add structures like this:
2. I already shared this screenshot here on this community to understand how the flash sector assignment works. See attached Fee_config.png.
You are not allowed to create continuous segment and you are not allowed to use too large data blocks. The limitation is given by sector size. Take a look at this thread:
https://community.nxp.com/t5/S32K/s32k312-FEE/m-p/1965182
3. It's caused by read-while-write error, most likely. Try to enable this option, so the code modifying the flash is running from RAM memory:
Regards,
Lukas
I did find this post of yours about the MemAcc config variant and even after checking both mine and the provided example both are on Variant-Pre-Compile and neither initialize properly https://community.nxp.com/t5/S32K/s32k312-FEE/m-p/1965649/highlight/true#M41530
and the mem load access option is not available to me
I have followup to 2 and 3
For 2, I understand that each sector has a 8192 byte size and how to assign cluster to memacc, but there is also a setting labeled "number of sectors" which in RTD_MEM_43_INFLS_UM.pdf is stated to be "number of contiguous sectors with identical values," would this not be for creating a MemSectorBatch larger than a single sector? If not, what does Mem Number Of Sectors actually do?
For 3 the issue appears to be that the example code from FEE_Example_S32K344 initializes both FEE and MemAcc with NullPtrs which means it never initializes. I have found MemAcc_BOARD_InitPeripherals_Config for memacc in MemAcc_BOARD_InitPeripherals_PBcfg.h but I cannot find the Fee_ConfigType define for Fee_Init in Fee_Cfg.h or Fee_features.h, where would it be found? I cannot find it in the example code either