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.

F28335 Zone6外扩Ram,在线仿真调试时出现“No source available for "c_int00() at 0x102b47"



具体情况是这样的,我打算把程序下载到Flash中,然后上电时将程序全部拷贝到Ram运行,当我在CMD文件中选择将.text段的运行地址设为L0 SRAM时,可以正常调试仿真,也能够不在Debug模式下正常运行,但是,当把CMD文件中.text段的运行地址设为ZONE6A时,在线仿真调试就会出现“No source available for "c_int00() at 0x102b47" 。有人说需要在“DSP2833x_CodeStartBranch.asm”中添加Xintf初始化,但是,添加之后仍然出现“No source available for "c_int00() at 0x102b47" ,请大家解惑?

  • /*############################################################################

    FILE: DSP2833x_nonBIOS_flash.cmd

    DESCRIPTION: Linker allocation for all sections.
    ############################################################################
    Author: Tim Love
    Release Date: March 2008
    ############################################################################*/


    MEMORY
    {
    PAGE 0: /* Program Memory */
    /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */

    ZONE0 : origin = 0x004000, length = 0x001000 /* XINTF zone 0 */
    RAM_L0L1L2L3: origin = 0x008000, length = 0x004000 /* on-chip RAM */
    OTP : origin = 0x380400, length = 0x000400 /* on-chip OTP */
    ZONE6A : origin = 0x100000, length = 0x080000 /* XINTF zone 6 */
    //ZONE7A : origin = 0x200000, length = 0x00FC00 /* XINTF zone 7 - program space */
    FLASHH : origin = 0x300000, length = 0x008000 /* on-chip FLASH */
    FLASHG : origin = 0x308000, length = 0x008000 /* on-chip FLASH */
    FLASHF : origin = 0x310000, length = 0x008000 /* on-chip FLASH */
    FLASHE : origin = 0x318000, length = 0x008000 /* on-chip FLASH */
    FLASHD : origin = 0x320000, length = 0x008000 /* on-chip FLASH */
    FLASHC : origin = 0x328000, length = 0x008000 /* on-chip FLASH */
    FLASHA : origin = 0x338000, length = 0x007F80 /* on-chip FLASH */
    CSM_RSVD : origin = 0x33FF80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
    BEGIN_FLASH : origin = 0x33FFF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
    CSM_PWL : origin = 0x33FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */
    ADC_CAL : origin = 0x380080, length = 0x000009 /* Part of TI OTP */
    IQTABLES : origin = 0x3FE000, length = 0x000b50 /* IQ Math Tables in Boot ROM */
    IQTABLES2 : origin = 0x3FEB50, length = 0x00008c /* IQ Math Tables in Boot ROM */
    FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 /* FPU Tables in Boot ROM */
    ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
    RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
    VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */


    PAGE 1 : /* Data Memory */
    /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
    /* Registers remain on PAGE1 */

    BOOT_RSVD : origin = 0x000000, length = 0x000080 /* on-chip RAM block M0 */
    RAMM0 : origin = 0x000080, length = 0x000400 /* Part of M1, BOOT rom will use this for stack */
    RAMM1 : origin = 0x000480, length = 0x000380 /* on-chip RAM block M1 */
    RAML4 : origin = 0x00C000, length = 0x001000 /* on-chip RAM block L4 */
    RAML5 : origin = 0x00D000, length = 0x001000 /* on-chip RAM block L5 */
    RAML6 : origin = 0x00E000, length = 0x001000 /* on-chip RAM block L6 */
    RAML7 : origin = 0x00F000, length = 0x001000 /* on-chip RAM block L7 */
    ZONE6B : origin = 0x180000, length = 0x080000 /* XINTF zone 6 */
    //ZONE7B : origin = 0x20FC00, length = 0x000400 /* XINTF zone 7 - data space */
    }

    /**************************************************************/
    /* Link all user defined sections */
    /**************************************************************/
    SECTIONS
    {

    /*** Code Security Password Locations ***/
    csmpasswds : > CSM_PWL PAGE = 0
    csm_rsvd : > CSM_RSVD PAGE = 0

    /*** User Defined Sections ***/
    codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
    wddisable : > FLASHA, PAGE = 0
    copysections : > FLASHA, PAGE = 0

    /* Allocate IQ math areas: */
    IQmath : > FLASHC PAGE = 0 /* Math Code */
    IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
    //IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
    FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD

    /* Allocate DMA-accessible RAM sections: */
    DMARAML4 : > RAML4, PAGE = 1
    DMARAML5 : > RAML5, PAGE = 1
    DMARAML6 : > RAML6, PAGE = 1
    DMARAML7 : > RAML7, PAGE = 1

    /* Allocate 0x400 of XINTF Zone 7 to storing data */
    //ZONE7DATA : > ZONE7B, PAGE = 1

    /* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
    .adc_cal : load = ADC_CAL, PAGE = 0, TYPE = NOLOAD

    /* .reset is a standard section used by the compiler. It contains the */
    /* the address of the start of _c_int00 for C Code. /*
    /* When using the boot ROM this section and the CPU vector */
    /* table is not needed. Thus the default type is set here to */
    /* DSECT */
    .reset : > RESET, PAGE = 0, TYPE = DSECT
    vectors : > VECTORS PAGE = 0, TYPE = DSECT

    /*** Uninitialized Sections ***/
    .stack : > RAMM0 PAGE = 1
    .ebss : > ZONE6B PAGE = 1
    .esysmem : > RAMM1 PAGE = 1

    /*** Initialized Sections ***/
    .cinit : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = ZONE6A , PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_cinit_loadstart),
    RUN_START(_cinit_runstart),
    SIZE(_cinit_size)

    .const : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = RAM_L0L1L2L3 , PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_const_loadstart),
    RUN_START(_const_runstart),
    SIZE(_const_size)

    .econst : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = RAM_L0L1L2L3, PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_econst_loadstart),
    RUN_START(_econst_runstart),
    SIZE(_econst_size)

    .pinit : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = RAM_L0L1L2L3, PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_pinit_loadstart),
    RUN_START(_pinit_runstart),
    SIZE(_pinit_size)

    .switch : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = RAM_L0L1L2L3, PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_switch_loadstart),
    RUN_START(_switch_runstart),
    SIZE(_switch_size)

    .text : LOAD = FLASHA, PAGE = 0 /* can be ROM */
    RUN = ZONE6A , PAGE = 0 /* must be CSM secured RAM */
    LOAD_START(_text_loadstart),
    RUN_START(_text_runstart),
    SIZE(_text_size)
    }

    /******************* end of file ************************/

    出错的CMD文件贴在上面,请大家解惑

  • 你的程序还是放在内部FLASH里的,只是通过copy的方式搬运到外部RAM上运行,从.cmd文件上看,好像没有什么问题,所以你有在程序里进行memory copy吗?

  • 你好,我在程序中并没有添加MemoryCopy()函数,但是添加了DSP28xxxSectionCopy_nonBIOS.asm,并且对DSP2833xCodeStartBranch.asm文件进行了修改,两个文件的内容,我贴在下面,请指教

    CodeStartBranch.asm文件

    ***********************************************************************

    WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0

    .ref copy_sections
    .global code_start
    .ref _InitSysCtrl
    .ref _InitXintf

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

    .sect "codestart"

    code_start:
    .if WD_DISABLE == 1
    LB wd_disable ;Branch to watchdog disable code
    .else
    LB copy_sections ;Branch to copy_sections
    .endif

    ;end codestart section

    ***********************************************************************
    * Function: wd_disable
    *
    * Description: Disables the watchdog timer
    ***********************************************************************
    .if WD_DISABLE == 1

    .sect "wddisable"
    wd_disable:
    SETC OBJMODE ;Set OBJMODE for 28x object code
    EALLOW ;Enable EALLOW protected register access
    MOVZ DP, #7029h>>6 ;Set data page for WDCR register
    MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
    EDIS ;Disable EALLOW protected register access
    LB copy_sections ;Branch to copy_sections

    .endif

    ;end wd_disable

    .end

    ;//===========================================================================
    ;// End of file.
    ;//===========================================================================

    SectionCopy_nonBIOS.asm文件

    .ref _c_int00
    .global copy_sections
    .global _cinit_loadstart, _cinit_runstart, _cinit_size
    .global _const_loadstart, _const_runstart, _const_size
    .global _econst_loadstart, _econst_runstart, _econst_size
    .global _pinit_loadstart, _pinit_runstart, _pinit_size
    .global _switch_loadstart, _switch_runstart, _switch_size
    .global _text_loadstart, _text_runstart, _text_size

    ***********************************************************************
    * Function: copy_sections
    *
    * Description: Copies initialized sections from flash to ram
    ***********************************************************************

    .sect "copysections"

    copy_sections:

    MOVL XAR5,#_const_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_const_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_const_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    MOVL XAR5,#_econst_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_econst_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_econst_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    MOVL XAR5,#_pinit_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_pinit_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_pinit_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    MOVL XAR5,#_switch_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_switch_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_switch_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    MOVL XAR5,#_text_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_text_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_text_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    MOVL XAR5,#_cinit_size ; Store Section Size in XAR5
    MOVL ACC,@XAR5 ; Move Section Size to ACC
    MOVL XAR6,#_cinit_loadstart ; Store Load Starting Address in XAR6
    MOVL XAR7,#_cinit_runstart ; Store Run Address in XAR7
    LCR copy ; Branch to Copy

    LB _c_int00 ; Branch to start of boot.asm in RTS library

    copy:
    B return,EQ ; Return if ACC is Zero (No section to copy)

    RPT AL ; Copy Section From Load Address to
    || PWRITE *XAR7, *XAR6++ ; Run Address

    return:
    LRETR ; Return

    .end

  • 有上面的汇编代码完成拷贝就可以了,但是好像没有看到XINTF的初始化?而且它需要在copy代码之前。

  • 是的,上面CodeStartBranch.asm文件中确实没有对XINTF进行初始化,请问怎么样才能在拷贝代码之前对XINTF进行初始化。我当时是在CodeStartBranch.asm文件中

    .if WD_DISABLE == 1

    .sect "wddisable"
    wd_disable:
    SETC OBJMODE ;Set OBJMODE for 28x object code
    EALLOW ;Enable EALLOW protected register access
    MOVZ DP, #7029h>>6 ;Set data page for WDCR register
    MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
    EDIS ;Disable EALLOW protected register access

    LCR _initsysctrl ;

    LCR _initXintf ;对XINTF进行初始化

    LB copy_sections ;Branch to copy_sections

    .endif

    但是,程序并不能正常运行

  • 参考类似的语句有对XINTF初始化即可:

    MOVZ DP, #7029h>>6 ;Set data page for WDCR register
    MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD

    你可以单步调试看看是否正常跳转。

  • 多谢耐心指教!如果想用这种方式对XINTF初始化,必须采用汇编指令才可以是吗?如果是这样的话,我能否从《SPRU430 ‐ TMS320C28x CPU和指令集参考指南》中,找到一些关于这方面的汇编指令信息,或者TI的官方文档中,有没有这方面的描述。

  • 是的,建议在执行copy之前通过汇编进行XINTF的初始化,并没有那么复杂,只需要按照上面提到的方式,先找到对应寄存器所在的页(DP, data page),然后通过偏移量寻址的方式对该寄存器写入初始化值即可。同时确保在此之前对应的XINTF引脚也已经通过GPIO初始化为XINTF的功能,而不是保持默认的GPIO状态。

  • 好的,多谢,我先试一试,争取不再麻烦你。

  • 没事,你先看看,还有问题欢迎回来继续讨论,只要尽可能提供多的信息就好,方便大家集思广益。