我使用的Flash_Writem函数按每次16位(2字节)烧写,主程序main中的烧写代码是
#include <c6x.h>
#include <csl.h>
#include <stdio.h>
#include <stdlib.h>
#include "Flash.h"
#include "BSP.h"
#include "boot.h"
#include "text.h"
main()
{
/* Init PLL EMIF ... */
BSP_init();
/* Fetch data from file */
/* Erase flash memory. */
Flash_Erase(0x90000000,0x10);
printf("\nErase Flash ok.");
/* Write flash memory. */
Flash_Writem(0x90000000, (uint16_t *)boot, sizeof(boot)<<1);
printf("\nWrite .boot ok.");
Flash_Writem(0x90000000+(0x200<<1), (uint16_t *)text, sizeof(text)<<1);
printf("\nWrite .text ok.");
printf("\nBurn to flash ok.");
}
注意上面的Flash_Writem调用格式,二级boot_loader被烧写到Flash起始地址为0x90000000的地址空间,用户应用程序被烧写到Flash起始地址为0x90000400的地址空间。
烧写成功,请看下文,
更多烧写内容请参考[2],里面是我烧写程序用的CCS工程,烧写不同的应用程序只需要替换里面的text.h和boot.h即可。
后注:烧写Flash要注意以上的任何一个细节,某个细节出错都可能造成烧写不成功!
5 参考
[1] Creating a Second-Level Bootloader for FLASH Bootloading on TMS320C6000 Platform With Code Composer Studio
[2] My Flash burn CCS project
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-34190-6.html
美国靠得住
希望能武统
MV拍得很美~歌好听~