cannot read system data from XML file

最近在使用ccs进行debug仿真时,不知道为什么一直报错,或者偶尔能够正常下载程序。一些报错情况如下:

One or more sections of your program falls into a memory region that is not writable. 

Invalid Target Configuration file 

有可能是根本进不去debug:

或者是进入debug界面之后,开始仿真和暂停仿真的按钮都是灰色的

 但是不知道是哪里的问题,咨询了普中客服说,可能是文件位置不正常,但我认为之前很长一段时间都是可以正常下载程序的,应该不是文件位置的位置,况且以前的经验是,如果位置有问题,在编译的时候就会提醒找不到头文件。然后第二种方法是,关闭开发板电源,断开下载器和开发板以及电脑的连接,然后打开开发板,看指示灯是否闪烁,然后将下载器插到开发板上,最后下载器连接电脑,这个做法我记得刚开始有一个工程是可以正常下载了,但是几次之后还是不行,这个问题苦恼了很久。网上也有一些说法,比如说是cmd文件中,有些区域的内存不够大,也试过了还是不行,最重要的一点是,这个问题之前在我的博客中说过,如何使用大数组那块,如果内存分配不合理的话,在编译的时候就不会通过了。

今天我重新建了一个工程,导入了最简单的流水灯程序,发现试了很多次都是可以正常下载的,然后我觉得之前不能成功下载的工程应该不是代码本身的问题。不能下载一定是debug设置的问题。然后我将两个工程的debug进行比较。(可以正常下载的工程叫做工程1,不能正常下载的工程叫做工程2)

---------------------------------------------------------------------------------------------------------------------------------

首先我们进入设置的debug页面进行比对:点击project,然后点击properties。然后点击debug

 工程1的界面如下:可以看到是有仿真器介绍的

 但是工程2界面如下:很明显看到有报错Invalid Target Configuration file (查了很多资料,当时也不知道这个问题怎么解决,总想着新建仿真器xxcml那块的器件型号啥的都是正确的)

-------------------------------------------------------------------------------------------------------------------------------- 

 然后我们接着比对debug设置:点击run,点击debug configurations,然后逐一比对

 工程1界面如下:

 

工程2界面如下:

---------------------------------------------------------------------------------------------------------------------------------

 所以可以看到是是debug设置的问题,大家可以打开一个自己以前可以正常下载的界面去更改,或者比对一下我下面这个正常的界面去更改,然后再开始debug就可以了:

1.删除多余的debug仿真

 2.在target configuration处更改为:${target_config_active_default:Example24_DSP2833x_SCI_echoback}

${target_config_active_default:后面的内容为工程name,也就是上面框出的name,大家可以直接复制过去

3.设置program

 4.然后点击apply,点击debug就可以开始正常仿真了。

ps:我们这个时候再回去看project的properties,就可以看到debug页面是没有错误的

---------------------------------------------2023.5.24新增-------------------------------------------------------------

One or more sections of your program falls into a memory region that is not writable. 

关于这个错误,我发现根据上面的步骤,还是不能完全成功,最后我突发奇想将数组变小,发现就可以下载了,我们仔细看一下这边报错,其实意思是有一些内存地址写失败了,也就是写的程序占用的内存空间或者数据空间很大,但其实编译的时候并没有报错,但可能会进入到一些不能写的内存地址,所以可以重新整合一下内存分配,或者扩大一点内存分配,多一点冗余地址

可以看到地址并不是连续可用的:

 我们可以看一下下面官方的地址分配:

MEMORY
{
PAGE 0 :
   /* BEGIN is used for the "boot to SARAM" bootloader mode      */

   BEGIN      : origin = 0x000000, length = 0x000002     /* Boot to M0 will go here                      */
   RAMM0      : origin = 0x000050, length = 0x0003B0
   RAML0      : origin = 0x008000, length = 0x001000
   RAML1      : origin = 0x009000, length = 0x001000
   RAML2      : origin = 0x00A000, length = 0x001000
   RAML3      : origin = 0x00B000, length = 0x001000
   ZONE7A     : origin = 0x200000, length = 0x00FC00    /* XINTF zone 7 - program space */
   CSM_RSVD   : origin = 0x33FF80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
   CSM_PWL    : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA            */
   ADC_CAL    : origin = 0x380080, length = 0x000009
   RESET      : origin = 0x3FFFC0, length = 0x000002
   IQTABLES   : origin = 0x3FE000, length = 0x000b50
   IQTABLES2  : origin = 0x3FEB50, length = 0x00008c
   FPUTABLES  : origin = 0x3FEBDC, length = 0x0006A0
   BOOTROM    : origin = 0x3FF27C, length = 0x000D44


PAGE 1 :
   /* BOOT_RSVD is used by the boot ROM for stack.               */
   /* This section is only reserved to keep the BOOT ROM from    */
   /* corrupting this area during the debug process              */

   BOOT_RSVD  : origin = 0x000002, length = 0x00004E     /* Part of M0, BOOT rom will use this for stack */
   RAMM1      : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
   RAML4      : origin = 0x00C000, length = 0x001000
   RAML5      : origin = 0x00D000, length = 0x001000
   RAML6      : origin = 0x00E000, length = 0x001000
   RAML7      : origin = 0x00F000, length = 0x001000
   ZONE7B     : origin = 0x20FC00, length = 0x000400     /* XINTF zone 7 - data space */
}


SECTIONS
{
   /* Setup for "boot to SARAM" mode:
      The codestart section (found in DSP28_CodeStartBranch.asm)
      re-directs execution to the start of user code.  */
   codestart        : > BEGIN,     PAGE = 0
   ramfuncs         : > RAML0,     PAGE = 0
   .text            : > RAML1,     PAGE = 0
   .cinit           : > RAML0,     PAGE = 0
   .pinit           : > RAML0,     PAGE = 0
   .switch          : > RAML0,     PAGE = 0

   .stack           : > RAMM1,     PAGE = 1
   .ebss            : > RAML4,     PAGE = 1
   .econst          : > RAML5,     PAGE = 1
   .esysmem         : > RAMM1,     PAGE = 1

   IQmath           : > RAML1,     PAGE = 0
   IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD

   /* Uncomment the section below if calling the IQNexp() or IQexp()
      functions from the IQMath.lib library in order to utilize the
      relevant IQ Math table in Boot ROM (This saves space and Boot ROM
      is 1 wait-state). If this section is not uncommented, IQmathTables2
      will be loaded into other memory (SARAM, Flash, etc.) and will take
      up space, but 0 wait-state is possible.
   */
   /*
   IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
   {

              IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)

   }
   */

   FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD

   DMARAML4         : > RAML4,     PAGE = 1
   DMARAML5         : > RAML5,     PAGE = 1
   DMARAML6         : > RAML6,     PAGE = 1
   DMARAML7         : > RAML7,     PAGE = 1

   ZONE7DATA        : > ZONE7B,    PAGE = 1

   .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used                    */
   csm_rsvd         : > CSM_RSVD   PAGE = 0, TYPE = DSECT /* not used for SARAM examples */
   csmpasswds       : > CSM_PWL    PAGE = 0, TYPE = DSECT /* not used for SARAM examples */

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

}

其实我们真正能使用的其中在RAMM、RAML、SARAM这三大块,所以可以将他们地址拼接在一起,如下:

MEMORY
{
PAGE 0 :
   /* BEGIN is used for the "boot to SARAM" bootloader mode      */

   BEGIN      : origin = 0x000000, length = 0x000002     /* Boot to M0 will go here                      */
   ZONE7A     : origin = 0x200000, length = 0x00FC00    /* XINTF zone 7 - program space */
   CSM_RSVD   : origin = 0x33FF80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
   CSM_PWL    : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA            */
   ADC_CAL    : origin = 0x380080, length = 0x000009
   RESET      : origin = 0x3FFFC0, length = 0x000002
   IQTABLES   : origin = 0x3FE000, length = 0x000b50
   IQTABLES2  : origin = 0x3FEB50, length = 0x00008c
   FPUTABLES  : origin = 0x3FEBDC, length = 0x0006A0
   BOOTROM    : origin = 0x3FF27C, length = 0x000D44


PAGE 1 :
   /* BOOT_RSVD is used by the boot ROM for stack.               */
   /* This section is only reserved to keep the BOOT ROM from    */
   /* corrupting this area during the debug process              */

   BOOT_RSVD  : origin = 0x000002, length = 0x00004E     /* Part of M0, BOOT rom will use this for stack */


	RAMM1      : origin = 0x000050, length = 0x0007B0
	RAML4      : origin = 0x008000, length = 0x008000
	ZONE7B     : origin = 0x20FC00, length = 0x002000
}


SECTIONS
{
   /* Setup for "boot to SARAM" mode:
      The codestart section (found in DSP28_CodeStartBranch.asm)
      re-directs execution to the start of user code.  */
   codestart        : > BEGIN,     PAGE = 0
   ramfuncs         : > RAMM1,     PAGE = 1   //RAML0
   .text            : > RAML4,     PAGE = 1   //RAML1
   .cinit           : > RAMM1,     PAGE = 1   //RAML0
   .pinit           : > RAMM1,     PAGE = 1  //RAML0
   .switch          : > RAMM1,     PAGE = 1   //RAML0

   .stack           : > RAMM1,     PAGE = 1
   .ebss            : > RAML4,     PAGE = 1
   .econst          : > RAMM1,     PAGE = 1   //RAML5
   .esysmem         : > RAMM1,     PAGE = 1

   IQmath           : > RAMM1,     PAGE = 1   //RAML1
   IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD

   /* Uncomment the section below if calling the IQNexp() or IQexp()
      functions from the IQMath.lib library in order to utilize the
      relevant IQ Math table in Boot ROM (This saves space and Boot ROM
      is 1 wait-state). If this section is not uncommented, IQmathTables2
      will be loaded into other memory (SARAM, Flash, etc.) and will take
      up space, but 0 wait-state is possible.
   */
   /*
   IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
   {

              IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)

   }
   */

   FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD

//   DMARAML4         : > RAML4,     PAGE = 1
//   DMARAML5         : > RAML5,     PAGE = 1
//   DMARAML6         : > RAML6,     PAGE = 1
//   DMARAML7         : > RAML7,     PAGE = 1

   ZONE7DATA        : > ZONE7B,    PAGE = 1

   .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used                    */
   csm_rsvd         : > CSM_RSVD   PAGE = 0, TYPE = DSECT /* not used for SARAM examples */
   csmpasswds       : > CSM_PWL    PAGE = 0, TYPE = DSECT /* not used for SARAM examples */

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

}

猜你喜欢

转载自blog.csdn.net/qq_43811597/article/details/130820628