DSP TMS320C6713工程如何bootload下载记录

同事留下的程序,没研究通呢,下flag下操作
程序:链接:https://pan.baidu.com/s/1L4VxQJpsNSv9VSD0mSUtQw
提取码:9jok
(1)程序分两个个工程:先用下面的工程生产bin文件,然后将bin文件拆分两部分,放在BOOT_OK程序里,生产新的程序并且下载。在这里插入图片描述
(2)编译文件:
主工程会生成的 boot 代码 和 程序代码 保存为 hex 格式 ,添加在 BOOT_OK 里面,boot 程序负责将主程序的代码写入flash 里面
第一步要知道生成的代码大小:找到map文件.
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
如图上面的位置为 text 代码段的数据大小(截图只示意位置)
我生产程序的大小为:0x4f10+0x00+0x54C+0x420+0x200+0x1B0 =5C1C
这就是数据的由来:

第二步:
在这里插入图片描述
找到生成的boot_c671x.s62.修改代码长度是5c1c
在这里插入图片描述

计算 5C1C指的是代码大小,在内存中占 5C1C (23580) ÷ 4 = 5895 字节

(2)下载文件到DSP,在调试模式下可以save Memory
保存boot 地址起始为0x00000000 大小 100
在这里插入图片描述

保存:text 地址:0x00000400 大小: 5895
在这里插入图片描述

把boot 和text 的文本重新整理到 BOOT_OK 的程序里面合成一个新的程序。
在这里插入图片描述
在这里插入图片描述
重新编译下载,就完成了bootload.

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
/********************************************************************************\ \* DEC6713_FLASH.c V2.00 *\ \* Copyright 2004 by SEED Electronic Technology LTD. *\ \* All rights reserved. SEED Electronic Technology LTD. *\ \* Restricted rights to use, duplicate or disclose this code are *\ \* granted through contract. *\ \* Designed by: Hongshuai.Li \* Discription: Erase, write and read the whole chip. \* Date: Modified 05.10.2005 *\ \********************************************************************************/ #include #include #include #include #include #include #include "DEC6713_FLASH.h" #include /********************************************************************************/ Uint32 i; Uint16 TempData; Uint32 Src_StartAdd; Uint32 Dst_StartAdd; extern far void vectors(); /********************************************************************************/ /********************************************************************************/ void main() { Src_StartAdd = 0x90000000; /* Initialize CSL, must when using. */ CSL_init(); /* Initialize DEC6713 board. */ DEC6713_init(); /* Configure interrupt. */ IRQ_setVecs(vectors); IRQ_nmiEnable(); IRQ_globalEnable(); /* Erase flash memory. */ Flash_Erase(0x90000000,0x10); printf("\nErase flash ok."); /* Write flash memory. */ for(i=0;i<0x40000;i++) { Flash_Writes(Src_StartAdd+2*i,fmod(i,0x10000)); } printf("\nWrite flash ok."); /* Read flash memory. */ for(i=0;i<0x40000;i++) { TempData = Flash_Reads(Src_StartAdd+2*i); if(TempData != fmod(i,0x10000)) { printf("\n Testing is Failure!"); printf("\nAddress 0x%x is error!",i); exit(0); } } printf("\nOpereation is success."); } /********************************************************************************\ \* Flash function difine. *\ \********************************************************************************/ /********************************************************************************\ \* Flash erase function. *\ \********************************************************************************/ Uint32 Flash_Erase(Uint32 addr,Uint16 type) { Uint32 i,j; *FLASH_5555 = FLASH_UL1; //first *FLASH_2AAA = FLASH_UL2; //second *FLASH_5555 = FLASH_UL3; //third *FLASH_5555 = FLASH_UL4; *FLASH_2AAA = FLASH_UL5; switch(type) { case 0x50: //block erase *(Uint16 *)addr = type; while((*(Uint16 *)addr & 0x80) != 0x80); for(i = 0; i < BLOCK_SIZE; i++) { if(*(Uint16 *)(addr + i) != 0xffff) { j = 0; break; } } j = 1; break; case 0x30: //sector erase *(Uint16 *)addr = type; while((*(Uint16 *)addr & 0x80) != 0x80); for(i = 0; i < SECTOR_SIZE; i++) { if(*(Uint16 *)(addr + i) != 0xffff) { j = 0; break; } } j = 1; break; case 0x10: //chip erase // for(;;) // { *FLASH_5555 = type; // } while((*FLASH_5555 & 0x80) != 0x80); for(i = 0; i < CHIP_SIZE; i++) { if(*(Uint16 *)(addr + i) != 0xffff) { j = 0; break; } } j = 1; break; default: break; } return (j); } /********************************************************************************\ \* Write a single data. *\ \********************************************************************************/ void Flash_Writes(Uint32 addr,Uint16 data) { //Uint16 TempData=0; *FLASH_5555 = FLASH_UL1; *FLASH_2AAA = FLASH_UL2; *FLASH_5555 = FLASH_PROGRAM; //for(;;) //{ *(Uint16 *)addr = data; //TempData = *(Uint16 *)(addr); //} //TempData = *(Uint16 *)(addr); while(*(Uint16 *)addr != data); } /********************************************************************************\ \* Write the certain length data. *\ \********************************************************************************/ void Flash_Writem(Uint32 addr,Uint16 *ptr,Uint32 length) { Uint32 i; for(i = 0; i < length; i++) { // for(;;) // { Flash_Writes(addr+2*i,*(ptr+i)); // } } } /********************************************************************************\ \* Read a single data. *\ \********************************************************************************/ Uint32 Flash_Reads(Uint32 addr) { return (*(Uint16 *)addr); } /********************************************************************************\ \* Read the certain length data. *\ \********************************************************************************/ void Flash_Readm(Uint32 addr,Uint16 *ptr,Uint32 length) { Uint32 i; for(i = 0; i < length; i++) { *(ptr + i) = Flash_Reads(addr+2*i); } } /********************************************************************************\ \* End of DEC6713_FLASH.C *\ \********************************************************************************/

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值