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.

2812往Flash里固化时添加哪个库,可以更改么



我的程序在ram调试的时候用的是rts2800_ml.lib库,而想要往Flash里固化则必须改成rts2800n.lib这个库,可更改成这个库后在线调试条用的一些字符串函数就不能用了,请问想Flash里固化的库是固定的么 和什么有关系 怎么更改

  • 使用rts2800_ml.lib也可以往flash里烧写程序,您在使用rts2800_ml.lib烧写程序到flash时出现的是什么问题?

  • 显示烧写成功 但是重新上电后并不运行 步骤和使用rts2800n.lib的一样,但是只有使用rts2800n.lib上电后能运行

  • 把你的FFTFLASH.cmd文件发过来看一下吧

  • MEMORY
    {
    PAGE 0 : 
       OTP         : origin = 0x3D7800, length = 0x000800
       FLASHJ      : origin = 0x3D8000, length = 0x002000
       FLASHI      : origin = 0x3DA000, length = 0x002000 
    
       FLASHH      : origin = 0x3DC000, length = 0x006000	
    /*
       FLASHH      : origin = 0x3DC000, length = 0x004000     
       FLASHG      : origin = 0x3E0000, length = 0x004000
       														*/
       FLASHP	   : origin = 0x3E4000, length = 0x013FF6		
    /*   
       FLASHF      : origin = 0x3E4000, length = 0x004000
       FLASHE      : origin = 0x3E8000, length = 0x004000 
       FLASHD      : origin = 0x3EC000, length = 0x004000
       FLASHC      : origin = 0x3F0000, length = 0x004000
       FLASHB      : origin = 0x3F4000, length = 0x002000 
       FLASHA      : origin = 0x3F6000, length = 0x001FF6   */  
       
       BEGIN       : origin = 0x3F7FF6, length = 0x000002
       PASSWDS     : origin = 0x3F7FF8, length = 0x000008
       ROM         : origin = 0x3FF000, length = 0x000FC0
       VECTORS     : origin = 0x3FFFC2, length = 0x00003E      
    
             
    PAGE 1 : 
       /* SARAM                     */     
       RAMM0    : origin = 0x000000, length = 0x000400
       RAMM1    : origin = 0x000400, length = 0x000400
    
       /* Peripheral Frame 0:   */
       DEV_EMU    : origin = 0x000880, length = 0x000180
       FLASH_REGS : origin = 0x000A80, length = 0x000060
       CSM        : origin = 0x000AE0, length = 0x000010
       XINTF      : origin = 0x000B20, length = 0x000020
       CPU_TIMER0 : origin = 0x000C00, length = 0x000008
       CPU_TIMER1 : origin = 0x000C08, length = 0x000008		 
       CPU_TIMER2 : origin = 0x000C10, length = 0x000008		 
       PIE_CTRL   : origin = 0x000CE0, length = 0x000020
       PIE_VECT   : origin = 0x000D00, length = 0x000100
    
       /* Peripheral Frame 1:   */
       ECAN_A     : origin = 0x006000, length = 0x000100
       ECAN_AMBOX : origin = 0x006100, length = 0x000100
    
       /* Peripheral Frame 2:   */
       SYSTEM     : origin = 0x007010, length = 0x000020
       SPI_A      : origin = 0x007040, length = 0x000010
       SCI_A      : origin = 0x007050, length = 0x000010
       XINTRUPT   : origin = 0x007070, length = 0x000010
       GPIOMUX    : origin = 0x0070C0, length = 0x000020
       GPIODAT    : origin = 0x0070E0, length = 0x000020
       ADC        : origin = 0x007100, length = 0x000020
       EV_A       : origin = 0x007400, length = 0x000040
       EV_B       : origin = 0x007500, length = 0x000040
       SPI_B      : origin = 0x007740, length = 0x000010
       SCI_B      : origin = 0x007750, length = 0x000010
       MCBSP_A    : origin = 0x007800, length = 0x000040
    
       /* CSM Password Locations */
       CSM_PWL    : origin = 0x3F7FF8, length = 0x000008
    
       /* SARAM                    */     
       DRAMH0     : origin = 0x3f8000, length = 0x002000  
       RAML0L1    : origin = 0x008000, length = 0x002000
       
       ZONE2tf    : origin = 0x084000, length = 0x001FFF   
    
    }
     
     
    SECTIONS
    {
       /* Allocate program areas: */
       .reset              : > BEGIN       PAGE = 0
       vectors             : > VECTORS     PAGE = 0
       .cinit              : > FLASHJ      PAGE = 0  
       .text               : > FLASHP      PAGE = 0
    
       /* Allocate data areas: */
       
      
           
       
    
       .stack              : > RAMM1     PAGE = 1
       .ebss               : > RAML0L1     PAGE = 1
       .econst			   : > FLASHH      PAGE = 0	
    
       .esysmem            : > RAML0L1      PAGE = 1
       
       /* Allocate IQ math areas: */
       IQmath              : > FLASHI      PAGE = 0   /* Math Code   flashi*/
       IQmathFastTables    : > FLASHI      PAGE = 0   /* Math Tables in fast memory  flashi*/
       IQmathTables        : > OTP         PAGE = 0   /* Math Tables In ROM */
      
       /* Allocate Peripheral Frame 0 Register Structures:   */
       DevEmuRegsFile    : > DEV_EMU,    PAGE = 1
       FlashRegsFile     : > FLASH_REGS, PAGE = 1
       CsmRegsFile       : > CSM,        PAGE = 1
       XintfRegsFile     : > XINTF,      PAGE = 1
       CpuTimer0RegsFile : > CPU_TIMER0, PAGE = 1      
       CpuTimer1RegsFile : > CPU_TIMER1, PAGE = 1      
       CpuTimer2RegsFile : > CPU_TIMER2, PAGE = 1      
       PieCtrlRegsFile   : > PIE_CTRL,   PAGE = 1      
       PieVectTable      : > PIE_VECT,   PAGE = 1
    
       /* Allocate Peripheral Frame 2 Register Structures:   */
       ECanaRegsFile     : > ECAN_A,      PAGE = 1   
       ECanaMboxesFile   : > ECAN_AMBOX   PAGE = 1
    
       /* Allocate Peripheral Frame 1 Register Structures:   */
       SysCtrlRegsFile   : > SYSTEM,     PAGE = 1
       SpiaRegsFile      : > SPI_A,      PAGE = 1
       SciaRegsFile      : > SCI_A,      PAGE = 1
       XIntruptRegsFile  : > XINTRUPT,   PAGE = 1
       GpioMuxRegsFile   : > GPIOMUX,    PAGE = 1
       GpioDataRegsFile  : > GPIODAT     PAGE = 1
       AdcRegsFile       : > ADC,        PAGE = 1
       EvaRegsFile       : > EV_A,       PAGE = 1
       EvbRegsFile       : > EV_B,       PAGE = 1
       ScibRegsFile      : > SCI_B,      PAGE = 1
       McbspaRegsFile    : > MCBSP_A,    PAGE = 1
    
       /* CSM Password Locations */
       CsmPwlFile      : > CSM_PWL,     PAGE = 1
    
       FFTipcb3  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTipcb4  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTmag                 :  >  DRAMH0    PAGE=1
       FFTtf                  :  >  ZONE2tf     PAGE=1
    
    }
    


  • MEMORY
    {
    PAGE 0 :
       OTP         : origin = 0x3D7800, length = 0x000800
       FLASHJ      : origin = 0x3D8000, length = 0x002000
       FLASHI      : origin = 0x3DA000, length = 0x002000

       FLASHH      : origin = 0x3DC000, length = 0x006000 
    /*
       FLASHH      : origin = 0x3DC000, length = 0x004000    
       FLASHG      : origin = 0x3E0000, length = 0x004000
                     */
       FLASHP    : origin = 0x3E4000, length = 0x013FF6  
    /*  
       FLASHF      : origin = 0x3E4000, length = 0x004000
       FLASHE      : origin = 0x3E8000, length = 0x004000
       FLASHD      : origin = 0x3EC000, length = 0x004000
       FLASHC      : origin = 0x3F0000, length = 0x004000
       FLASHB      : origin = 0x3F4000, length = 0x002000
       FLASHA      : origin = 0x3F6000, length = 0x001FF6   */ 
      
       BEGIN       : origin = 0x3F7FF6, length = 0x000002
       PASSWDS     : origin = 0x3F7FF8, length = 0x000008
       ROM         : origin = 0x3FF000, length = 0x000FC0
       VECTORS     : origin = 0x3FFFC2, length = 0x00003E     

            
    PAGE 1 :
       /* SARAM                     */    
       RAMM0    : origin = 0x000000, length = 0x000400
       RAMM1    : origin = 0x000400, length = 0x000400

       /* Peripheral Frame 0:   */
       DEV_EMU    : origin = 0x000880, length = 0x000180
       FLASH_REGS : origin = 0x000A80, length = 0x000060
       CSM        : origin = 0x000AE0, length = 0x000010
       XINTF      : origin = 0x000B20, length = 0x000020
       CPU_TIMER0 : origin = 0x000C00, length = 0x000008
       CPU_TIMER1 : origin = 0x000C08, length = 0x000008  
       CPU_TIMER2 : origin = 0x000C10, length = 0x000008  
       PIE_CTRL   : origin = 0x000CE0, length = 0x000020
       PIE_VECT   : origin = 0x000D00, length = 0x000100

       /* Peripheral Frame 1:   */
       ECAN_A     : origin = 0x006000, length = 0x000100
       ECAN_AMBOX : origin = 0x006100, length = 0x000100

       /* Peripheral Frame 2:   */
       SYSTEM     : origin = 0x007010, length = 0x000020
       SPI_A      : origin = 0x007040, length = 0x000010
       SCI_A      : origin = 0x007050, length = 0x000010
       XINTRUPT   : origin = 0x007070, length = 0x000010
       GPIOMUX    : origin = 0x0070C0, length = 0x000020
       GPIODAT    : origin = 0x0070E0, length = 0x000020
       ADC        : origin = 0x007100, length = 0x000020
       EV_A       : origin = 0x007400, length = 0x000040
       EV_B       : origin = 0x007500, length = 0x000040
       SPI_B      : origin = 0x007740, length = 0x000010
       SCI_B      : origin = 0x007750, length = 0x000010
       MCBSP_A    : origin = 0x007800, length = 0x000040

       /* CSM Password Locations */
       CSM_PWL    : origin = 0x3F7FF8, length = 0x000008

       /* SARAM                    */    
       DRAMH0     : origin = 0x3f8000, length = 0x002000 
       RAML0L1    : origin = 0x008000, length = 0x002000
      
       ZONE2tf    : origin = 0x084000, length = 0x001FFF  

    }
     
     
    SECTIONS
    {
       /* Allocate program areas: */
       .reset              : > BEGIN       PAGE = 0
       vectors             : > VECTORS     PAGE = 0
       .cinit              : > FLASHJ      PAGE = 0 
       .text               : > FLASHP      PAGE = 0

       /* Allocate data areas: */

       .stack              : > RAMM1     PAGE = 1
       .ebss               : > RAML0L1     PAGE = 1
       .econst      : > FLASHH      PAGE = 0 

       .esysmem            : > RAML0L1      PAGE = 1
       
         /* Allocate Peripheral Frame 0 Register Structures:   */
       DevEmuRegsFile    : > DEV_EMU,    PAGE = 1
       FlashRegsFile     : > FLASH_REGS, PAGE = 1
       CsmRegsFile       : > CSM,        PAGE = 1
       XintfRegsFile     : > XINTF,      PAGE = 1
       CpuTimer0RegsFile : > CPU_TIMER0, PAGE = 1     
       CpuTimer1RegsFile : > CPU_TIMER1, PAGE = 1     
       CpuTimer2RegsFile : > CPU_TIMER2, PAGE = 1     
       PieCtrlRegsFile   : > PIE_CTRL,   PAGE = 1     
       PieVectTable      : > PIE_VECT,   PAGE = 1

       /* Allocate Peripheral Frame 2 Register Structures:   */
       ECanaRegsFile     : > ECAN_A,      PAGE = 1  
       ECanaMboxesFile   : > ECAN_AMBOX   PAGE = 1

       /* Allocate Peripheral Frame 1 Register Structures:   */
       SysCtrlRegsFile   : > SYSTEM,     PAGE = 1
       SpiaRegsFile      : > SPI_A,      PAGE = 1
       SciaRegsFile      : > SCI_A,      PAGE = 1
       XIntruptRegsFile  : > XINTRUPT,   PAGE = 1
       GpioMuxRegsFile   : > GPIOMUX,    PAGE = 1
       GpioDataRegsFile  : > GPIODAT     PAGE = 1
       AdcRegsFile       : > ADC,        PAGE = 1
       EvaRegsFile       : > EV_A,       PAGE = 1
       EvbRegsFile       : > EV_B,       PAGE = 1
       ScibRegsFile      : > SCI_B,      PAGE = 1
       McbspaRegsFile    : > MCBSP_A,    PAGE = 1

       /* CSM Password Locations */
       CsmPwlFile      : > CSM_PWL,     PAGE = 1

       FFTipcb3  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTipcb4  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTmag                 :  >  DRAMH0    PAGE=1
       FFTtf                  :  >  ZONE2tf     PAGE=1

    }

  • 您好,请将源文件“DSP281x_CodeStartBranch.asm”添加到工程中,并且在CMD文件的section部分添加语句“codestart           : > BEGIN       PAGE = 0”。

  • 烧完以后Flash锁住了

  • 添加的.asm文件


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

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

        .ref _c_int00

    ***********************************************************************
    * 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 _c_int00         ;Branch to start of boot.asm in RTS library
        .endif

    ;end codestart section


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

        .text
    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 _c_int00         ;Branch to start of boot.asm in RTS library

        .endif

    ;end wd_disable

     

     .end
     
    ; end of file CodeStartBranch.asm

  • 具体是什么情况?编译工程的时候有没有把“DSP281x_CSMPasswords.asm”添加到工程中去,在操作flash programmer有没有改变密码区的值?除了这两种情况,在烧写的时候电源不稳定也会导致flash被锁。

  • ;// TI File $Revision: /main/2 $
    ;// Checkin $Date: April 29, 2005   11:11:32 $
    ;//###########################################################################
    ;//
    ;// FILE:  DSP281x_CodeStartBranch.asm 
    ;//
    ;// TITLE: Branch for redirecting code execution after boot.
    ;//
    ;//###########################################################################
    ;// $TI Release: DSP281x Header Files V1.11 $
    ;// $Release Date: September 26, 2007 $
    ;//###########################################################################

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

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

        .ref _c_int00

    ***********************************************************************
    * 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 _c_int00         ;Branch to start of boot.asm in RTS library
        .endif

    ;end codestart section


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

        .text
    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 _c_int00         ;Branch to start of boot.asm in RTS library

        .endif

    ;end wd_disable

     

     .end
     
    ; end of file CodeStartBranch.asm

     

     

    只添加了这个和修改了你所说的CMD文件

  • ;// TI File $Revision: /main/2 $
    ;// Checkin $Date: April 29, 2005   11:11:32 $
    ;//###########################################################################
    ;//
    ;// FILE:  DSP281x_CodeStartBranch.asm 
    ;//
    ;// TITLE: Branch for redirecting code execution after boot.
    ;//
    ;//###########################################################################
    ;// $TI Release: DSP281x Header Files V1.11 $
    ;// $Release Date: September 26, 2007 $
    ;//###########################################################################

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

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

        .ref _c_int00

    ***********************************************************************
    * 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 _c_int00         ;Branch to start of boot.asm in RTS library
        .endif

    ;end codestart section


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

        .text
    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 _c_int00         ;Branch to start of boot.asm in RTS library

        .endif

    ;end wd_disable

     

     .end
     
    ; end of file CodeStartBranch.asm

     

    只加了这个文件

     

    查内存3f7ff8到3f7fff全是0

  • 如果芯片被锁,所有地址都会显示为0。试试这种方法:  Try holding the processor in reset state (if you have a "reset" button for example) while you are connecting to it with the JTAG. After you have been connected, leave the "reset" button and program the flash as general。

  • 现在解锁了,要改哪里下次不会锁呢

  • 最后是怎么解锁的?通常不修改CSMPasswords.asm里的密码,保持全为F就不会被锁。建议使用CCSV5看是否还会被锁。

  •  好像还是和库有关系

  •  一运行就写入数据了

  • 这还是CMD文件的问题,试试用我附件中发过去的CMD文件。

  • 是不是加了DSP281x_CSMPasswords.asm这个文件,仿真的时候view memory里都是FFFF,不加的话就全是0,哪个对

  • 加了DSP281x_CSMPasswords.asm的话,密码区的密码就和DSP281x_CSMPasswords.asm中的密码一样,不加的话就默认是全F。换了CMD文件后是否还有问题?

  • 烧进去程序不运行

  • cmd文件里有把flash里的载入到ram里运行,我参照官网的例程改了,还加了DSP281x_Headers_nonBIOS.cmd这个文件

     

     

    #include "DSP28_Device.h"
    
    #pragma CODE_SECTION(ISRTimer0, "ramfuncs");
    
    unsigned int *LedADDR  = (unsigned int *) 0x2800;	//8个发光二极管寄存器地址
    
    unsigned int Count,Flag;
    /////////////////对应位低电平点亮该位发光二极管
    const	Uint16	LedCode[9]={0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE,0xFF};
    
    interrupt void ISRTimer0(void);
    
    
    void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)
    {
        while(SourceAddr < SourceEndAddr)
        { 
           *DestAddr++ = *SourceAddr++;
        }
        return;
    }
    	 	
    void main(void)
    {
    	InitSysCtrl();					//初始化系统
    
    	DINT;						//关中断
    	IER = 0x0000;
    	IFR = 0x0000;
    
    	InitPieCtrl();					//初始化PIE
    	InitPieVectTable();				//初始化PIE中断矢量表
    	InitPeripherals();				//初始化外设
        InitGpio();
    	EALLOW;	
    	PieVectTable.TINT0 = &ISRTimer0;
    	EDIS;   
    	
     	Count = 0;					//初始化变量
        Flag=0;
    	ConfigCpuTimer(&CpuTimer0, 10, 1000000);	//设置CPU
     	StartCpuTimer0();
        
    
    	MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    
    // Call Flash Initialization to setup flash waitstates
    // This function must reside in RAM
        InitFlash();
    
    	IER |= M_INT1;					//开中断
    	PieCtrl.PIEIER1.bit.INTx7=1;
    
    	EINT;						// 允许INTM
    	ERTM;						// 允许DBGM
    
    	*LedADDR = 0x00;					// 点亮全部8个LED灯
    	for(;;)
    	{	;	}
    
    } 	
    
    interrupt void ISRTimer0(void)
    {
    	PieCtrl.PIEACK.bit.ACK7=1;
    	*LedADDR = LedCode[Count];			//依次点亮灯,置相应位低电平
    	if (Flag==0) Count++; else Count--;
    	if (Count>=8)//循环	
    	{
    	   Flag=1;  }
    	if (Count<=0)//循环	
    	{
    	   Flag=0;
    	   }		
    }

  • 在程序中再添加一句#pragma CODE_SECTION(InitFlash, "ramfuncs");

  • 好了 谢谢你,如果我把整个程序都放到RAM里运行,是不是把所有的函数

    #pragma CODE_SECTION(Ifunctionname, "ramfuncs");就可以了

  • 把程序放到RAM中的是函数MemCopy,#pragma CODE_SECTION用于把指定的函数分配到指定段。先将要放到ram运行的程序分配到某一段,然后再将该段内容copy到ram中,最后再运行copy到ram的某一个函数。

  • 我把自己写的函数都加载到RAM里运行没问题吧
    #include "DSP28_Device.h"
    #include "fft.h"
    #include "math.h"
    #pragma CODE_SECTION(fft_init, "ramfuncs");
    #pragma CODE_SECTION(fft_subroutine, "ramfuncs");
    #pragma CODE_SECTION(Print_Str, "ramfuncs");
    #pragma CODE_SECTION(Uarta_PutChar, "ramfuncs");
    #pragma CODE_SECTION(send_message, "ramfuncs");
    #pragma CODE_SECTION(usart_receive, "ramfuncs");
    #pragma CODE_SECTION(wave_judge, "ramfuncs");
    #pragma CODE_SECTION(wave_choose, "ramfuncs");
    #pragma CODE_SECTION(warn_test, "ramfuncs");
    #pragma CODE_SECTION(wave_send, "ramfuncs");
    #pragma CODE_SECTION(ad, "ramfuncs");
    #pragma CODE_SECTION(scia_receive, "ramfuncs");
    #pragma CODE_SECTION(eva_timer1_isr, "ramfuncs");
    #pragma CODE_SECTION(eva_timer2_isr, "ramfuncs");
    #pragma CODE_SECTION(evb_timer3_isr, "ramfuncs");
    #pragma CODE_SECTION(ISRTimer0, "ramfuncs");

  • 没有问题,不过需要在MemCopy调用了之后再调用这些函数,这些函数才能真正的在RAM里运行。

  •  烧写的时候出现这个,是不是说明我还有函数没有放到RAM里,有没有例程可以把整个程序放到RAM里运行,现在的实验现象和在线RAM调试有点区别,我想是不是速度不够,因为用到了FFT

  • 从信息提示来看,好像要需要将某一部分数据也搬移到RAM中。如果程序不是太大的话,也可以将整个程序都搬移到RAM中,可以通过MemCopy .text段实现,具体操作方法请参考以下内容:http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spraau8&docCategoryId=1&familyId=4 。

  • 我原来在RAM里调试的时候CMD文件做了修改,添加了下面自己定义分配的段都是在RAM里,现在是把它们都放到FLASH里搬移还是和原来的一样就放在RAM里就可以

    MEMORY
    {
    PAGE 0 :      
       ZONE2      : origin = 0x080000, length = 0x03ffff 
             
    PAGE 1 : 
       /* .....          */     
       
       DRAMH0     : origin = 0x3f9800, length = 0x000700  
       ZONE2ipcb  : origin = 0x080000, length = 0x001FFF
       ZONE2mag   : origin = 0x082000, length = 0x001FFF
       ZONE2tf    : origin = 0x084000, length = 0x001FFF   
       ZONE2      : origin = 0x0C0000, length = 0x03ffff  
    }
     
     
    SECTIONS
    {
       /*......*/
    
       FFTipcb1  ALIGN(2048)   : {}   >  ZONE2ipcb   PAGE=1
       FFTipcb2  ALIGN(2048)   : {}   >  ZONE2ipcb   PAGE=1
       FFTipcb3  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTipcb4  ALIGN(256)   : {}   >  DRAMH0   PAGE=1
       FFTmag                 :  >  DRAMH0    PAGE=1
       FFTtf                  :  >  ZONE2tf     PAGE=1
    
    }
    

  • 需要先分配到flash中,然后再搬移到ram中,分配到RAM中掉电易失。

  •  官网的例程编译出现警告,前两个是这些段没用到吧,后一个是怎么回事,起始地址改变了?单纯烧FLASH和搬移的例程里,一个添加的是DSP281x_CodeStartBranch.asm一个是DSP28xxx_CodeStartBranch.asm,两个里面codestart的地方是不一样的,是这个原因么,还是我的CCS没配置对还是下的例程有问题

  • 那是不是还需要要修改一些asm文件,和配置.cinit一样,它的_cinit_loadstart,_cinit_runstart,_cinit_size都在汇编文件里。

    .cinit   : LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
                      RUN = RAM_H0,    PAGE = 0    /* Run section from RAM */
                      LOAD_START(_cinit_loadstart),
                      RUN_START(_cinit_runstart),
          SIZE(_cinit_size)

     

     RAMCMD:

    FFTipcb3  ALIGN(256)   : {}   >  RAM_H0   PAGE=1
       FFTipcb4  ALIGN(256)   : {}   >  RAM_H0   PAGE=1
       FFTmag                 :  >  RAM_H0    PAGE=1
     

     

     

    FFTipcb3  ALIGN(256)   : {}  LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
                      RUN = RAM_H0,    PAGE = 0    /* Run section from RAM */
                      LOAD_START(_fftipcb3_loadstart),
                      RUN_START(_ftipcb3_runstart),
          SIZE(_ftipcb3_size)

    FFTipcb4 ALIGN(256)   : {}  LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
                      RUN = RAM_H0,    PAGE = 0    /* Run section from RAM */
                      LOAD_START(_fftipcb4_loadstart),
                      RUN_START(_ftipcb4_runstart),
          SIZE(_ftipcb4_size)


       FFTmag                 :  LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
                      RUN = RAM_H0,    PAGE = 0    /* Run section from RAM */
                      LOAD_START(_fftmag_loadstart),
                      RUN_START(_fftmag_runstart),
          SIZE(_fftmag_size)

     

    DSP28xxx_SectionCopy_nonBIOS.asm里添加

    .global _fftipcb3_loadstart, _fftipcb3runstart, _pfftipcb3_size
     .global _sfftipcb4loadstart, _fftipcb4_runstart, _fftipcb4_size
     .global _fftmag_loadstart, _fftmag_runstart, _fftmag_size

    是这么改的吗?

  • 好像我的FFT烧到flash里运行有问题

  • 在下边的copy_sections部分有没有也添加相应的代码?

  • MOVL XAR5,#_fftipcb3_size    ; Store Section Size in XAR5
     MOVL ACC,@XAR5      ; Move Section Size to ACC
     MOVL XAR6,#_fftipcb3_loadstart   ; Store Load Starting Address in XAR6
        MOVL XAR7,#_fftipcb3_runstart   ; Store Run Address in XAR7
        LCR  copy 

  • 添加这些代码后仍不能运行吗?其实不添加这些自定义的段,这些函数会被自动分配到text段,搬移text段就相当于搬移所有代码。

  • FFT的值得到的都是0

  • 先不要添加FFTipcb3  ALIGN(256),FFTipcb4 ALIGN(256),FFTmag这些段,直接使用例程的F281x_nonBIOS_flash.cmd和DSP28xxx_SectionCopy_nonBIOS.asm文件,不用做任何修改。        

  • 你是说直接用官网的例程,不进行FFT算法?

  • 把FFT的相关部分全部去掉,CMD和程序里用到的

     fft.ipcbptr = ipcb;
     fft.magptr = mag;
     fft.init(&fft);

    RFFT32_brev(ipcb,ipcb,N);

       fft.calc(&fft);
       fft.split(&fft);
       fft.mag(&fft);都去掉

    其他的都可以正常运行

  • 我的意思是参考例程,使用例程的F281x_nonBIOS_flash.cmd和DSP28xxx_SectionCopy_nonBIOS.asm文件,FFT代码照样添加上跟在RAM中运行的一样。

  • 我直接使用的F281x_nonBIOS_flash.cmd没改动,编译不过去,我不明白,不给FFT分配空间,FFT就不能使用啊,我使用的是官网的FFT库

    >> warning: creating output section FFTtf without SECTIONS specification