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.

tms320f2808指令跳转

Other Parts Discussed in Thread: TMS320F2808

我应用的控制芯片是TMS320F2808,有如下问题,等待您的帮助,我想通过自己写的can_bootloader引导程序来烧写dsp程序

1、  我在程序中应用了指针跳转指令,我想问下LB和LCR的区别是什么

2、  在应用跳转指令是不是可以任意跳到设想的区域啊,我遇到一个问题是跳到指定区域后,程序就跑飞了,不能正常的向下运行,我想问下,应用跳转指令时需要遵循什么原则吗,不同的flash区域之间跳转如何实现?

比如当我用LCR       _BOOT_MAIN指令时,跳不进这个_BOOT_MAIN函数,反而跳到如下的地址开始运行:

000066 0000        ITRAP0    

000067 0000        ITRAP0

  • 指令说明可以查找这个文档TMS320C28x Assembly Language Tools v6.2.pdf (spru513f.pdf).

    下面代码给你参考,跳转到其他地址的。

    Eric


    .ref _c_int00
    .global code_start

    ***********************************************************************
    *Function : codestart section
    *
    *Description : Branch to code starting point
    ***********************************************************************

    .sect "codestart"

    code_start:
    LB check ; LB _c_int00 ;Branch to start of boot.asm in RTS library
    ; end codestart section

    .sect ".text"
    check:
    MOVL XAR0, #0x13F780 ; left 2k for mark in sector A
    CMP *XAR0, #0xFFFF ; never update before
    B app, EQ
    LB search
    addPTR:
    ADDB XAR0, #0x4 ;#1 or #4 or#8
    search:
    CMP *XAR0, #0xFFFF
    B addPTR, NEQ
    SUBB XAR0, #0x4
    CMP *XAR0, #0xFFF0
    B app, EQ
    LB _c_int00
    app:
    MOVL XAR7, #0x13A000 ;jump to user app code
    LB *XAR7
    .end

  • 麻烦你能给我说下,不同flash区段之间的跳转指令,需要遵循什么样的原则吗

  • 这个汇编跳转我也没常用,但是用LB是可以的,你可以查看SPRU430E这个文档的汇编指令。

    Eric