SPRAD51A December 2023 – April 2024 F29H850TU , F29H859TU-Q1 , TMS320F2800157 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28P659DK-Q1
The F280015x and F28P65x (both the 128-bit and 512-bit programming projects) DCAN flash kernels allow the user to specify which flash banks and flash sectors should be erased before the application is loaded to flash. This section will discuss how it is implemented for the F28P65x device, but the F280015x implementation is very similar.
Within the flash_kernel_ex5_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 Application_Flash_Banks[5] = {0,1,2,3,4};
uint32_t WE_Protection_A_Masks[5] = {0,0,0,0,0};
uint32_t WE_Protection_B_Masks[5] = {0,0,0,0,0};
uint32_t WE_Protection_OTP_Masks[5] = {0,0,0,0,0};
Within Application_Flash_Banks, the flash bank numbers should be entered. Within WE_Protection_A_Masks, the Write/Erase Protection Masks corresponding the sectors 0-31 for each bank in Application_Flash_Banks should be entered. As shown above, flash sectors 0-31 of each bank will be erased. Within WE_Protection_B_Masks, the Write/Erase Protection Masks corresponding the sectors 32-127 for each bank in Application_Flash_Banks 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, WE_Protection_OTP_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, WE_Protection_A_Masks and 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.