Hi team,
My customer use CAN_bootloader base on TMS570LS0714 platform, there are some issues need to clarify.
1. They use Fapi_BlockProgram() to do the app code update, the code is as below. Then they found that Fapi_BlockProgram just can write up to 16Bytes at a time. But after wrote 16 Bytes, the code jump to interrupt vectors, and the BOOT can't write more bytes in the flash.
Current solution: Disable interrupt, they can write bytes normally. But firstly, they use " _disable_Interrupt_() " to do the interrupt disable, it doesn't work; then if they use "vimDisableInterrupt()", it works well.
Question:
1. Is it necessary to disable interrupt when they do the Flash Update? Why?
2. What's the difference between " _disable_Interrupt_() " & "vimDisableInterrupt()", why the " _disable_Interrupt_() " can't disable the interrupt successfully?
void App_CANFlashUpdate(void)
{
UINT16 u16Lenth;
UINT32 u32TargetAddress;
UINT32 u32UpdataFlag;
UINT8 u8FlashBootInfo[24];
UINT8 u8Ret;
if(1 == g_un_SysCanCommFlag.bits.b1FlashUpdate)
{
g_un_SysCanCommFlag.bits.b1FlashUpdate = 0;
u32TargetAddress = FLASH_MODULEID_ADDR;
g_u32ModuleIDBoot = 0x1234;
g_u32BootSWVer = 0x5678;
g_u32CANIDSend = 0x109;
g_u32CANIDRcvd = 0x119;
UINT8 i = 0;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = (g_u32ModuleIDBoot>>8) & 0xFF;
u8FlashBootInfo[i++] = g_u32ModuleIDBoot & 0xFF;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = (g_u32BootSWVer>>8) & 0xFF;
u8FlashBootInfo[i++] = g_u32BootSWVer & 0xFF;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = (g_u32CANIDSend>>8) & 0xFF;
u8FlashBootInfo[i++] = g_u32CANIDSend & 0xFF;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = 0x00;
u8FlashBootInfo[i++] = (g_u32CANIDRcvd>>8) & 0xFF;
u8FlashBootInfo[i++] = g_u32CANIDRcvd & 0xFF;
u8FlashBootInfo[i++] = 0x55;
u8FlashBootInfo[i++] = 0xAA;
u8FlashBootInfo[i++] = 0x55;
u8FlashBootInfo[i++] = 0xAA;
u8FlashBootInfo[i++] = 0x55;
u8FlashBootInfo[i++] = 0xAA;
u8FlashBootInfo[i++] = 0x55;
u8FlashBootInfo[i++] = 0xAA;
u32TargetAddress = 0x30000;//FLASH_MODULEID_ADDR;
Fapi_BlockProgram((uint32)0, u32TargetAddress, (UINT32)&u8FlashBootInfo[0], 24);
}
}
2. When they use the CAN_bootloader to update the app program hex, they find the application can't be executed successfully.
Current solution: Modify the sequence of VECTORS and FLASH_API address in .cmd file.
Unavailable cmd configuration:
Available cmd configuration:
Question:
1. Why the address of FLASH_API need less than the address of VECTORS?
2. If the address allocation in "MEMORY {}" must be continuous? Or if the address of VECTORS and FLASH_API can be assigned to different sectors?
3. Now customer use the following configuration is CCS to output the HEX file of application program, is it right? Why the Specify rom width is "32"? Is there any documents to introduce how to configure the options?
4. How to get the length of receive date from CAN bus dynamically?
Thanks a lot.







