Tool/software: Code Composer Studio
Dear team,
I have the same question.
I am doing online upgrade function. The byte size of the updated file is not a multiple of 4, but FlashProgram(uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count) This function address and the number of bytes must both be multiples of 4. What should I do?
Below is the description taken from peripheral driver library pdf :
FlashProgram
Programs flash.
Prototype:
int32_t
FlashProgram(uint32_t *pui32Data,
uint32_t ui32Address,
uint32_t ui32Count)
Parameters:
pui32Data is a pointer to the data to be programmed.
ui32Address is the starting address in flash to be programmed. Must be a multiple of four.
ui32Count is the number of bytes to be programmed. Must be a multiple of four.
Description:
This function programs a sequence of words into the on-chip flash. Each word in a page of
flash can only be programmed one time between an erase of that page; programming a word
multiple times results in an unpredictable value in that word of flash.
Because the flash is programmed one word at a time, the starting address and byte count
must both be multiples of four. It is up to the caller to verify the programmed contents, if such
verification is required.
This function does not return until the data has been programmed.
April 11, 2013 99
Flash
Returns:
Returns 0 on success, or -1 if a programming error is encountered.
Please help.