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.

28335串口在线升级



麻烦请教一下各位大神,最近再用串口做28335在线升级的引导程序,发现接收到全部的应用程序后再去刷写可以成功,但是分块接收刷写不成功,不知道这是为什么,请各位大神指点一下!!!

下面是我分块接收刷写的程序,请各位指导!

if(Length > PROG_BUFFER_LENGTH)                                 // Length 为应用程序大小
{
for(j = 0; j < (Length / PROG_BUFFER_LENGTH); j++)
{
for(i = 0; i < PROG_BUFFER_LENGTH; i++)
{
wordData = SCIC_GetOnlyWordData();
Buffer[i] = wordData;
}
status = Flash_Program(Flash_ptr, Buffer, PROG_BUFFER_LENGTH, &FlashStatus);
if(status != STATUS_SUCCESS)
{
Example_Error();
}
SCI_SendStatus("Processor is 0k1.\n\r");
Flash_ptr += PROG_BUFFER_LENGTH;
}

for(k = 0; k < (Length % PROG_BUFFER_LENGTH); k++)
{
wordData = SCIC_GetOnlyWordData();
Buffer[k] = wordData;
}
status = Flash_Program(Flash_ptr, Buffer, (Length % PROG_BUFFER_LENGTH), &FlashStatus);
if(status != STATUS_SUCCESS)
{
Example_Error();
}
SCI_SendStatus("Processor is 0k2.\n\r");

}