MCU: S32K116
Desired Functionality: UDS-based bootloader and EEPROM enablement.
Questions:
1.Where should the UDS-based bootloader be stored? According to AN12218, the bootloader is stored in DFlash. However, the Unified Bootloader User Guide, Rev. 2 describes the bootloader being stored in PFlash.2.If EEPROM needs to be enabled, at least 24KB of the 32KB FlexNVM must be allocated to E-Flash. Can the remaining 8KB store the UDS bootloader?
3.If the bootloader can be stored in PFlash, can the desired functionality be fully supported?
4.If not, which MCU should be used to achieve both functionalities? For example, S32K144?
Yes, your understanding is correct.
We have this application note which talks about A/B swap and using CAN:
https://www.nxp.com/docs/en/application-note/AN12323.pdf
https://www.nxp.com/docs/en/application-note-software/AN12323SW.zip
There are two use-cases - one for S32K144 which has one read partition only on program flash, so the application cannot run during the update. And then for S32K146 which has two read partitions, the application still runs during the update.
The first use-case could be used also on S32K116 but it's all about the memory size. If you are able to squeeze everything to 128KB, it's possible.
Regards,
Lukas
Hi @whale
1. Both options are possible, it depends on your needs.
Generaly, it's usually all about read partitions. Devices S32K11x, S32K142 and S32K144 have only one read partition on program flash. So, the code must run from RAM or from data flash when programming the program flash. This is the main limitation. Devices S32K146 and S32K148 has more read partitions (2 and 3), so the bootloader can run from first partition while programming second or third partitionn and there won't be troubles with read-while-write errors.
2. Yes, 8KB data flash can be used for any purpose. I recommend to check section "36.5.9.4 Allowed simultaneous flash operations" in the S32K1 reference manual.
3. As mentioned above, the only limitation is that you can't access program flash while it is being programmed or erased.
4. If it is not acceptable for you, an option is to select S32K146 which has two 512KB read partitions in program flash.
Regards,
Lukas