我们选择的 GPIO 引脚错误、Rx=9、TX=84、这不是允许的对之一。 因此、我将尝试仿真该代码的功能。 串行闪存编程器尝试下载闪存内核并且 SCI_Boot()接收到它。 在检查关键字并删除16个保留字节 CopyData()后,将调用它以接收文件。 文件以11个块的形式发送、但我不理解为什么所有块都具有相同的目标、因为块之间没有明显的处理。
BlockSize:2 destination:29184 BlockSize:24 destination:29184 BlockSize:1188 destination:29184 BlockSize:2 destination:29184 BlockSize:24 destination:29184 BlockSize:1188 destination:29184 BlockSize:307 destination:29184 BlockSize:4 destination:29184 BlockSize:4096 destination:29184 BlockSize:4096 destination:29184 BlockSize:1943 destination:29184
X
这是 bootloader_shared_funcs.c 中的代码
void CopyData(void)
{
struct HEADER {
uint32_t DestAddr;
uint16_t BlockSize;
} BlockHeader;
uint16_t wordData;
uint16_t i;
//
// Get the size in words of the first block
//
BlockHeader.BlockSize = (*GetWordData)();
//
// While the block size is > 0 copy the data
// to the DestAddr. There is no error checking
// as it is assumed the DestAddr is a valid
// memory location
//
while(BlockHeader.BlockSize != (uint16_t)0x0000U)
{
BlockHeader.DestAddr = GetLongData();
// Added for debugging
printf("\r\nBlockSize:%d destination:%d", BlockHeader.BlockSize, BlockHeader.DestAddr);
for(i = 1; i <= BlockHeader.BlockSize; i++)
{
wordData = (*GetWordData)();
*(uint16_t *)BlockHeader.DestAddr = wordData;
BlockHeader.DestAddr+=1U;
}
//
// Get the size of the next block
//
BlockHeader.BlockSize = (*GetWordData)();
}
return;
}