SPRAD51A December 2023 – April 2024 F29H850TU , F29H859TU-Q1 , TMS320F2800157 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28P659DK-Q1
The F28P55x MCAN flash kernel allows the user to specify which flash banks and flash sectors should be erased before the application is loaded to flash. Within the flash_kernel_ex4_can_flash_kernel.c file, there are four 32-bit unsigned integer arrays that control the flash banks and sectors erased by the kernel.
uint32_t Flash_Banks_To_Erase[5] = {0,1,2,3,4};
uint32_t CMD_WE_Protection_A_Masks[5] = {0,0,0,0,0};
uint32_t CMD_WE_Protection_B_Masks[5] = {0,0,0,0,0};
uint32_t CMD_WE_Protection_UO_Masks[5] = {0,0,0,0,0};
Within Flash_Banks_To_Erase, the flash bank numbers should be entered. Within CMD_WE_Protection_A_Masks, the Write/Erase Protection Masks corresponding the sectors 0-31 for each bank in Flash_Banks_To_Erase should be entered. As shown above, flash sectors 0-31 of each bank will be erased. Within CMD_WE_Protection_B_Masks, the Write/Erase Protection Masks corresponding the sectors 32-127 for each bank in Flash_Banks_To_Erase should be entered. As shown, flash sectors 32-127 will be erased in each bank. For more information about these masks, see the device-specific Flash API Guide. Similarly, CMD_WE_Protection_UO_Masks should be filled with the desired masks for each bank's OTP. Note that configuring this array will not result in OTP being erased, but rather enable the device to program a flash bank's OTP during the application load.
Additionally, CMD_WE_Protection_A_Masks and CMD_WE_Protection_B_Masks is used when programming the application to flash. The proper masks are determined based on the target address of the data being programmed.
Once these arrays are configured as desired, recompile the flash kernel and generate the new kernel image.