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.

F021 issueProgramming error on F28377D



I am writing a custom bootloader, such that the bootloader code all resides in one flash segment, and the remaining flash area is upgraded with new code (from an external serial flash).

I am using the F021 Flash API, and it almost works. After DSP restart, I am able to erase each flash segment, and I am able to reprogram (and verify) almost all of the flash. There is a particular flash area -- all within one segment, and only a partial portion of that segment, that the Fapi_issueProgrammingCommand always returns Fapi_Error_AsyncIncorrectDataBufferLength.

My data buffer lengths are constant (8 bytes), and as I wrote much of Flash is successfully reprogrammed, so this error must also have other meaning -- can you detail what other causes for this error might be?

Also I assume this is relevant, but I don't know why yet -- the programming errors start at the address associated with .text, which is also RamfuncsLoadEnd. I wonder if there is some FlashProtection module that is locking me out of this area. Note, nothing is running from this area at this time (I relocated c_int00 and args_main to be sure).

Thanks,

Jim

  • Jim,

    You can program 128bits (eight 16-bit words) at a time using Fapi_issueProgrammingCommand() function.  However, this is true only when the address (provided for programming) starts on a 128-bit boundary.  For example, take the Flash address 0x80000.  If you provide this as the address for programming, then you can provide a max of eight 16-bit words for the programming function and they will get programmed at the addresses from 0x80000 to 0x80007.  If you provide address 0x80001 for programming, then you can provide a max of only seven 16-bit words for programming and they will get programmed from 0x80001 to 0x80007.  

    Extended explanation:

    If the address is 0x80000, then you can provide a max of eight 16-bit words for programming.

    If the address is 0x80001, then you can provide a max of seven 16-bit words for programming.

    If the address is 0x80002, then you can provide a max of six 16-bit words for programming.

    If the address is 0x80003, then you can provide a max of five 16-bit words for programming.

    If the address is 0x80004, then you can provide a max of four 16-bit words for programming.

    If the address is 0x80005, then you can provide a max of three 16-bit words for programming.

    If the address is 0x80006, then you can provide a max of two 16-bit words for programming.

    If the address is 0x80007, then you can provide a max of one 16-bit word for programming.

    Above is mentioned in the Flash API reference guide as "The supplied starting address to program at plus the data buffer length cannot exceed the bank data width".  Data bank width for F28377D is 128bits - which is eight 16-bit words.  

    Hope this helps.

    Thanks and regards,

    Vamsi