This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: Flash Program to non-aligned address(not 64 or 128 bit aligned address)

Part Number: TMS320F28388D

Hello, Experts,

I have a problem to program a ceatain data to memory which is not 128-bit aligned address.

For example,  I've already known that a max of two words can be programmed at a time under the address is "128-bit aligned address + 6".

If I should program 2 words to the address, 0x0009801E, like below,

I've end up with failure when write the code as shown below

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uint16_t SrcBuffer[8] = {0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}
SrcBuffer[0] = PROGRAM_WORD1;
SrcBuffer[1] = PROGRAM_WORD2;
uint32_t u32startAddr = 0x0009801E;
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32startAddr, SrcBuffer,
2, 0, 0, Fapi_AutoEccGeneration);
//
// Wait until the Flash program operation is over
//
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
if(oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
return -1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

How do I use the flash api, Fapi_issueProgrammingCommand, to program the supplied data to not-aligned memory address in the right way?

  • Hi ,

    Please search for below questions in this Flash API FAQ: e2e.ti.com/.../faq-faq-on-flash-api-usage-for-c2000-devices

    Why do you have different programming modes for Flash programming function (Fapi_issueProgrammingCommand())?

    When using Fapi_AutoEccGeneration mode, what is the minimum number of 16-bit words that can be programmed?

    When using Fapi_AutoEccGeneration mode, for a given 128-bit aligned memory, can I program lower 64-bits at one time and upper 64-bits at another time?

    Thanks and regards,
    Vamsi

  • Thanks for your reply.

    Actually I've just referred to the flash examples C2000 provided as same as below.

    Should I set the Fapi mode as Fapi_DataOnly?

    "Fapi_DataOnly: Programs only the data without ECC"

    Unfortunatly I looked for the FAQ but couldn't find a suitable example. Could you provide a simple example about wrting any data to not-aligned memory?

    I guess It's difficult to understand clearly because there is only an explanation without examples.

  • Hi Seunghan,

    If you program using Fapi_DataOnly without ECC, you will get ECC errors.  You need to program all the 64-bits (aligned on 64-bit boundary) together along with the ECC.

    Thanks and regards,
    Vamsi

  • I wish the start address could be 64-bit or 128-bit aligned.

    But the output image file with the binary format created a block not 128-bit aligned so I can't help but write one or two words as I mentioned.

    I've already known that it would be better to write data in 64 bit unit with ECC. 

  • Seunghan,

    I know that you are aware of the alignment requirement for programing.  

    I am saying that Fapi_DataOnly is not the solution if ECC is already programmed for the partial 64-bits.

    I replied to your other post on this related binary format output.  Please check.

    Thanks and regards,

    Vamsi

  • Hello, Vamsi

    I'll check the posting you mentioned right away.

    Thanks.