Hello,
How shall we control the alignment of code and data in TMS570LS20216 ?
Is it by using the using the palign(n) in the sys_link.cmd file ? Please correct me if i am wrong.
.intvecs : palign(4), fill = 0xffffffff {} > VECTORS
.text : palign(4), fill = 0xffffffff {} > FLASH0
.const : palign(4), fill = 0xffffffff {} > FLASH0
.cinit : palign(4), fill = 0xffffffff {} > CINIT
.pinit : palign(4), fill = 0xffffffff {} > FLASH0
This is because i need all data to be flashed aligned to 32 bit boundary.
When i try Flash API - Flash_Prog_B((void *)Start_Address , (UINT32 *)Data, FlashDataSize, Bank_Val, REdelay,(FLASH_ARRAY_ST)0xfff87000, &status);
i observed that Start_Address required to be aligned to 32 bit boundary and FlashDataSize also as number of 32 bit words. Hope it is right.
So when we have to flash a code part by part i did not always get exactly at the 32 bit boundary( maybe due to alignment issue ) . In that case how we can ensure that still we are able to flash the data ?
An example may make the picture more clear.
Please follow the sequence below.
step 1: Address is 0x80000(Flash Bank1) and number of data is 6 bytes. When we call the Flash_Prog_B API we gave Start_Address = 0x80000 and FlashDataSize = round to upper(6/4) = 2. Then it will get flashed into the sections from 0x80000 to 0x80007.
step2. Address is 0x80007(Flash Bank1) and number of data is 1 byte. This will not get written into flash as already the 0x80000 - 0x80007 section has been written by a previous write operation . If we need to write again we have to erase(convert to 0xFFFFFFFF) the 0x80000 - 0x80007(32 bit boundary) and rewrite it.
How can i solve this issue to write to 0x080007 ?
Thanks in advance,
Regards,
Renjith George