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.

can在线升级问题



大家好,我这边正在做通过用28335通过can在线升级程序功能,现在有个问题请教大家:

步骤执行到DSP2833x_CodeStartBranch.asm文件时,也即调用了_c_int00子程序后不是会跳转到main函数执行么,那么请问如果我此时在线升级代码和用户功能代码都存在flash里面时,那不是有两个main函数么?那为什么系统是跳到在线升级的代码中的main处去执行而不是用户功能代码里面的main处执行呢?

  • “步骤执行到DSP2833x_CodeStartBranch.asm文件时,也即调用了_c_int00子程序后不是会跳转到main函数执行么,那么请问如果我此时在线升级代码和用户功能代码都存在flash里面时,那不是有两个main函数么?那为什么系统是跳到在线升级的代码中的main处去执行而不是用户功能代码里面的main处执行呢?”
    Eric:
    一般来讲,在线升级代码和用户代码会分开两个工程,所以会有两个code start文件,但是一个是芯片启动的那个入口地址BEGIN,另外一个的地址你需要指定。
    那么在上电进入code start后,利用code start 在里面增加一些判断代码,如果要跳转到升级,则默认到升级的main, 如果要进入应用代码,则跳转到应用代码的入口地址。
  • 请问一下,code start中怎么增加判断代码呢?可以给一个例子吗?

  • 参考一下如下代码:

    .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

    ---ERIC