DSP编写注意事项Word版_第1页
DSP编写注意事项Word版_第2页
DSP编写注意事项Word版_第3页
DSP编写注意事项Word版_第4页
DSP编写注意事项Word版_第5页
已阅读5页,还剩14页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、传播优秀word版文档 ,希望对您有帮助,可双击去除!关于tms320f28xx启动代码使用方法共18页传播优秀word版文档 ,希望对您有帮助,可双击去除!链接warnning选项-w选项最好选上,有助于编译器在用户没有显式指定某一section的链接方式时报warnning。the -w option can be selected in code composer studio on the project build_options menu, linker tab, select the advanced category, and then check the -w option

2、box.内存大小端模式it is important that the large memory model be used with the c-compiler (as opposed to the small memory model). small memory model requires certain initialized sections to be linked to non-volatile memory in the lower 64kw of addressable space. however, no flash memory is present in this

3、region on any current f28xx devices, and this will likely be true for future f28xx devices aswell. therefore, large memory model should be used. in code composer studio, the large memory model is on the project build_options menu. select the compiler tab, choose the advanced category, and check the

4、-ml option box. for non-dsp/bios projects, one should include the large memory model ccompiler runtime support library, rts2800_ml.lib, into their code project (as opposed to rts2800.lib, which is for the small memory model). for dsp/bios projects, dsp/bios will take care of including the required l

5、ibrary. the user should not include the rts2800_ml.lib (or rts2800.lib) library into a dsp/bios project.传播优秀word版文档 ,希望对您有帮助,可双击去除!non-dsp/biosprojects链接位置图表 1 link传播优秀word版文档 ,希望对您有帮助,可双击去除!dsp/bios projects链接位置传播优秀word版文档 ,希望对您有帮助,可双击去除!图表 2 linktable 2 notes:1. the .trcdata section must be copied

6、 by the user from its load address (specified on theload_address tab) to its run address (specified on the bios_data tab) at runtime. see section4.3 for details on performing this copy.2. the pievect ram is a specific block of ram associated with the peripheral interruptexpansion (pie) peripheral. o

7、n current f28xx devices, the pie ram is a 256x16 block startingat address 0x000d00 in data space. for other devices, confirm the address in the devicedatasheet. the memory section manager in the dsp/bios configuration tool should alreadyhave a pre-defined memory named pievect. the .hwi_vec section m

8、ust be copied by the userfrom its load address (specified on the memory section manager load_address tab) to its runaddress (specified on the memory section manager bios_code tab) at runtime. see section4.2 for details on performing this copy.3. the specific flash memory selected as the load address

9、 for this section should be the sameflash memory selected previously as the run address for the section (e.g., on the bios_data,bios_code, or compiler_sections tab).传播优秀word版文档 ,希望对您有帮助,可双击去除!拷贝中断向量(non-dsp/bios only)调用initpievecttable函数完成中断向量拷贝,函数原型位于dsp280x_pievect.c。拷贝硬件向量(dsp/bios only)图表 3 拷贝中断

10、向量拷贝.trcdata(dsp/bios only)第一步:需要如下图配置。传播优秀word版文档 ,希望对您有帮助,可双击去除!图表 4 配置编译器第二步:代码实现。图表 5 拷贝trcdata代码实现传播优秀word版文档 ,希望对您有帮助,可双击去除!flash控制寄存器初始化(dsp/bios and non-dsp/bios)图表 6 flash控制器初始化caution:the flash control registers are protected by the code security module (csm). if the csm is secured, you mu

11、st run the flash register initialization code from secured ram (e.g., l0 or l1 saram) or the initialization code will be unable to access the flash registers. note that the csm is always secured at device reset, although the rom bootloader will unlock it if you are using dummy passwords of 0xffff.传播

12、优秀word版文档 ,希望对您有帮助,可双击去除!图表 7 secureramfuncs定义图表 8 将代码从加载域拷贝到运行域拷贝到运行域提高速度(dsp/bios and non-dsp/bios)the on-chip ram memory on current f28xx devices provides code execution performance of 150 mips (millions of instructions per second) at 150 mhz on f281x devices, and 100 mips at 100 mhz on f280x dev

13、ices. however, the on-chip flash memory on these devices provides effective code execution performance that is slightly less: roughly 90 100 mips on f281x devices, and roughly 85 90 mips on f280x devices.传播优秀word版文档 ,希望对您有帮助,可双击去除!拷贝常量到运行域提高速度(dsp/bios and non-dsp/bios)方法一所有const变量的运行域都在ram,优点操作简单,缺

14、点内存开销大。non-dsp/bios projects图表 9 常量运行域都在ram的操作.econst是系统标识符。dsp/bios projects在这个模式下,虽然也可以单独指定.econst的加载地址和运行地址,但是不会生成相应的可以被程序引用的符号,因此还是需要用户配置link文件指定。与non-dsp/bios projects相比较多出一个步骤,即需要指定用户link文件先于系统link文件编译。通过传播优秀word版文档 ,希望对您有帮助,可双击去除!project build_options, selecting the link_order tab,可以指定编译顺序,如下

15、图所示。图表 10 指定用户的link文件优先于系统link文件.econst是系统标识符。方法二(dsp/bios and non-dsp/bios projects)用户指定的部分常量,通过用户link文件分配到指定的flash加载,在指定的ram运行。这种方法的好处就是节省内存开销。利用data_section关键字用户可以指定一个section,注意这个section不是.econst。将用户指定的常量的运行域指定到section。传播优秀word版文档 ,希望对您有帮助,可双击去除!密码保护模式在开发阶段一般不需要密码保护,开发完成后为了方式嵌入式代码被非法拷贝,tms32028xx

16、提供了密码保护机制,就是所说的csm模式。tms32028xx的片内flash、otp memory以及l0、l1 ram都是csm保护的。当处于有密码保护的状态时,受csm保护的ram之间可以互相访问,未受csm保护的内存中的代码无法访问那些受csm保护的区域。csm使用16字节的密码锁,地址是0x3f7ff8至0x3f7fff。在开发阶段,最好通过擦除flash的方法将密码置为空(0xffff就是空密码)。开发完毕后,如果需要设置密码需要进行两步操作:1、往0x3f7ff8至0x3f7fff写入密码(不可以全为0,否则将永久锁定);2、将0x3f7f80至0x3f7ff5置为0。传播优秀w

17、ord版文档 ,希望对您有帮助,可双击去除!non-dsp/bios projects写入密码方法:用汇编语言写个简单的文件passwords.asm,用户替换0xffff为其它想要的密码。图表 11 汇编写csm密码除了上述步骤外,还需要在用户link文件中指定“passwords”和“csm_rsvd”的地址,如下图所示:图表 12 用户link文件中配置地址dsp/bios projects利用dsp/bios configuration tool定义内存地址,例如名称为passwords和csm_rsvd传播优秀word版文档 ,希望对您有帮助,可双击去除!。传播优秀word版文档 ,希望对您有帮助,可双击去除!传播优秀word版文档 ,希望对您有帮助,可双击去除!图表 13 汇编写密码图表 14 用户link定义变量地址复位后从flash执行程序f28xx dsp具备bootloader,能在执行完bootloader后跳转到flash执行,地址是0x3f7ff6。用户需要在该地址写入一条跳转指令,一般跳转到库函数执行c运行环境初始化函数_c_int00。不过,用户可以根据实际需求跳转到汇编指令处,但需要记住不可以在调用_c_int00之前跳转到c程序。dsp/bios和non-dsp/bios在操作上有所区别。non-dsp/bios图表 15 跳转指令传播优秀wo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论