Solved! Go to Solution.
Hi,
yes, those are erase and program operations. Plus Program Partition command which must be executed from RAM.
If interrupts are disabled during erase/program operations, it is sufficient to have only erase/program functions in RAM.
Regards,
Lukas
Thanks. Is it only the FLASH erase & write commands that have to go in RAM or Flex-NVM? Can we have our Bootloader at address 0 with all the serial code and S-REC decoding and simple place the FLASH erase/write commands in RAM?
Hi,
yes, those are erase and program operations. Plus Program Partition command which must be executed from RAM.
If interrupts are disabled during erase/program operations, it is sufficient to have only erase/program functions in RAM.
Regards,
Lukas
Hi,
FlexNVM is separate memory, so in total you have normal flash + FlexNVM.
Yes, you can map the bootloader anywhere including FlexNVM.
Notice that secure boot always uses start address 0. But the bootloader can be still protected by secure boot. It can be relatively easily solved by chain of trust. You can place simple piece of code to the first sector of flash. This can be protected directly by secure boot. This piece of code can check CMAC of the bootloader in FlexNVM and then jump to the bootloader. The same can be done with user application.
The vector table can be easily relocated using NVIC VTOR register.
Regards,
Lukas
Thanks. That makes sense. We will be using FlashNVM so the bootloader will go in A-FLASH. We might as well keep the bootloader starting in sector 0 and have the bootloader check?
One last question: How big are FLASH sectors?
Hi,
Yes, it's possible to keep bootloader at 0x0. However, an advantage of FlexNVM is that it's separate partition. So, you can run the code from FlexNVM while code flash is being programmed/erased.
If the bootloader is placed to 0x0, the flash commands need to be launched from RAM (or FlexNVM). Also if you need to process interrupts during the erase/program operations, the interrupt resources (interrupt vector table, handlers...) must be placed to RAM or FlexNVM too.
This is not problem when using S32K146 or S32K148 because there are more partitions in code flash.
Sector size is 2KB for devices with 256KB code flash and less or 4KB for 512KB code flash and more.
Regards,
Lukas