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.

TMS570LS3137 - F021 Flash API Version 2.00.00 Fapi_issueProgrammingCommand

Other Parts Discussed in Thread: TMS5703137, HALCOGEN

Hello,

TRM spnu499a on the page 245 states:

• bw - Normal data space bank data width of a Flash bank. The bw is 128 bits (144 bits including the error correction bits).
• bwe - EEPROM emulation bank is 128 bit wide (144 bits including the error correction bits).

Flash API reference spnu501d on the page 16 (Fapi_issueProgrammingCommand()) states:

Fapi_DataOnly – This mode will only program the data portion in Flash at the address specified. It can program from 1 byte up to the bank width (8,16,32) bytes based on the bank architecture.

Based on the above mentioned information I would assume that the function Fapi_issueProgrammingCommand() can write from 1 up to 16 Bytes (128 bits + 2*8 ECC bits) on the TMS5703137. But I have got following results:

relative address length in Bytes programming mode function return remark
write sequence A
0x01 16 Fapi_DataOnly Fapi_Error_AsyncIncorrectDataBufferLength in contrary to the above mentioned?
0x17 3 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
0x1A 5 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
write B
0x04 16 Fapi_AutoEccGeneration Fapi_Error_AsyncIncorrectDataBufferLength in contrary to the above mentioned?
write sequence C
0x01

8

Fapi_DataOnly Fapi_Status_Success OK, data length up to (or equal to?) bank width
0x09 3 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
0x0C 5 Fapi_DataOnly Fapi_Error_AsyncIncorrectDataBufferLength oops, why?

Any ideas?

Thanks a lot for your comments in advance,

cheers, Jiri

  • Hell Jiri,

    Since these questions are directly related to the API, I have asked our API expert to respond. He should get back with you in a short time.

  • Hello Jiri,

    Here is the revised information from the latest draft of SPNU501 (D in the document name refers to the revision of the document).

    Programming modes:
    Fapi_DataOnly – This mode will only program the data portion in Flash at the address specified. It can program from 1 byte up to the bank width (8,16,32) bytes based on the bank architecture. The supplied starting address to program at plus the data buffer length cannot exceed the bank data width. (Ex. Programming 14 bytes on a 16 byte wide bank starting at address 0x4 is not allowed.)
    Fapi_AutoGeneration – This will program the supplied data portion in Flash along with automatically generated ECC. ECC is calculated on 64-bit aligned addresses up to the data width of the bank. Data not supplied is treated as 0xFF. For example, on a device with a 144-bit wide bank width, if data is written only to bytes 0x0-0x7 (or 0x8-0xF), then the ECC will only be calculated for those 64 bits. If the data supplied crosses a 64-bit boundary, ECC will be calculated for both 64-bit words. For example, on a
    device with a 144-bit wide bank width, data is written to bytes 0x4 - 0xB, the 2 bytes of ECC data will be calculated. The data restrictions for Fapi_DataOnly also exist for this option.
    Fapi_DataAndEcc – This will program both the supplied data and ECC in Flash at the address specified. The data supplied must be aligned on a 64-bit word and the length of data must correlate to the supplied ECC. (For example, data buffer length is 8 bytes, the ECC buffer must be 1 byte).
    Fapi_EccOnly – This mode will only program the ECC portion in Flash at the address specified. It can program from 1 byte up to the bank ECC width (1, 2, 4) bytes based on the bank architecture. The supplied starting address to program at plus the ECC buffer length cannot exceed the bank ECC width (programming 3 bytes on a 2 byte ECC wide bank starting at address 0x0 is not allowed).

    NOTE: Reading a Flash memory location from the bank that an program command is currently being performed will stall the CPU until the program command finishes and the FMSTAT register indicates the FSM is not busy.
    The length of pu8DataBuffer and pu8EccBuffer cannot exceed the bank width of the current active bank. For bank width information, see the F021 Flash Module chapter in the device specific technical reference manual.

    relative address length in Bytes programming mode function return remark
    write sequence A
    0x01 16 Fapi_DataOnly Fapi_Error_AsyncIncorrectDataBufferLength

    in contrary to the above mentioned?

    Expected result as this would cross over a bank width boundary

    0x17 3 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
    0x1A 5 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
    write B
    0x04 16 Fapi_AutoEccGeneration Fapi_Error_AsyncIncorrectDataBufferLength

    in contrary to the above mentioned?

    Expected result as this would cross over a bank width boundary

    write sequence C
    0x01

    8

    Fapi_DataOnly Fapi_Status_Success OK, data length up to (or equal to?) bank width
    0x09 3 Fapi_DataOnly Fapi_Status_Success OK, data length up to bank width
    0x0C 5 Fapi_DataOnly Fapi_Error_AsyncIncorrectDataBufferLength

    oops, why?

    Expected result as this would cross over a bank width boundary

    Please let me know if this clears up your understanding of this function.

  • Hello Chuck and John,

    thanks for your quick support and explanation!

    Clear - in all three failed cases the 64-bit alignment is broken. Sorry, I have overseen the important text in brackets (Ex. Programming 14 bytes on a 16 byte wide bank starting at address 0x4 is not allowed.) - that says it all ;-)

    Thanks a lot,

    cheers, Jiri

  • Hello John/Chuck,

    Where do I get spnu501d.pdf file and Flash API Version 2.0.0 as mentioned in this e2e mail?

    Thank you.
    Regards
    Pashan

     

  • Hello Pashan,

    FlashAPI version 2.0.0 and spnu501d.pdf are installed in conjunction with Halcogen 3.05.02.