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.

关于2806x的bootloader

Other Parts Discussed in Thread: CONTROLSUITE

ControlSUITE中关于boot_rom的例程中,在"Shared_Boot.c"中有如下代码:

//#################################################
// void CopyData(void)
//-----------------------------------------------------
// This routine copies multiple blocks of data from the host
// to the specified RAM locations. There is no error
// checking on any of the destination addresses.
// That is it is assumed all addresses and block size
// values are correct.
//
// Multiple blocks of data are copied until a block
// size of 00 00 is encountered.
//
//-----------------------------------------------------

void CopyData()
{

  struct HEADER {
  Uint16 BlockSize;
  Uint32 DestAddr;
  } BlockHeader;

  Uint16 wordData;
  Uint16 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)0x0000)
  {
    BlockHeader.DestAddr = GetLongData();
    for(i = 1; i <= BlockHeader.BlockSize; i++)
    {
      wordData = (*GetWordData)();
      *(Uint16 *)BlockHeader.DestAddr++ = wordData;
    }

  // Get the size of the next block
  BlockHeader.BlockSize = (*GetWordData)();
  }
  return;
}

其中,用红色标记的一行,将接收到的数据直接存到目标地址了。

问题是,固化在ROM里的bootloader接收的升级数据不是要存到FLASH里面吗?

如是,为什么不需要调用FLASH的API呢?FLASH在什么情况下可以直接写呢?

  • bootloader接收的数据是存储在RAM中的,源文件开头的注释中就有说明“ This routine copies multiple blocks of data from the host
    // to the specified RAM locations.”

  • 哦,是我没看仔细,多谢了哈!

    我想要通过CAN进行在线的固件升级,数据size比RAM大,这个例程就不能直接用了。

    正常来说,是要把数据一段一段的转存到FLASH里面吧。

    如果是的话,设置多大的”段“比较合适呢?

    段太长,会丢数据吗?段太短,会浪费空间吗?(FLASH是按section写的吧?)

    请有经验的兄弟/姐妹介绍一下!

  • 嗯 是我没看仔细。多谢!

    如果我要通过CAN进行固件升级,代码size比RAM大,可以使用这个例程吗?其中修改一下,把RAM里的data转存到FLASH里。

  • 你可以把这部分程序改写成Flash烧写程序,将copy到RAM中的数据再分批烧写到片内Flash。

  • 如果自己磁轭bootloader程序,可以在程序中不用调用Flash_Erase\Flash_Program\Flash_Verify函数吗,如何做到的,不理解,希望得到帮助解释谢谢!

  • 你好,Can升级程序你用的什么上位机?

  • 上位机看你们熟哪种语言啦,我觉得Java相对容易些,还有就是C++.

    eric