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.

Simulation error "Trouble running Target CPU: Can't write to data memory 0x801"

Other Parts Discussed in Thread: TMS320F2808, CCSTUDIO, TMS320F2812

Hi,

I am trying to simulate my code in code composer studio. I am using TMS320F2808.
When I start running my code(in simulator) I am getting message "Trouble running Target CPU: Can't write to data memory 0x801, check memory config".
Every time I press F5 (run) key it shows can't write to data memory.

I have included "sim2808.gel" file in my project. I am having one cmd file which is not reffering to 0x800 location.

Please let me know, if I have specify problem in more detail.

Please help me out.

Regards,
PanShi

  • Hi,

    maybe you're missing this step: after compile your code, in CCS you have to load the program (.out file): "File -> Load program".

    Many informations here.

  • Hi,

    Thanks for your immediate reply.

    After loading program it is showing following error message. "Can't Run the Indicated Number of Instructions on the Target CPU: Can't write to data memory 0xAEC0, check memory config [-2184] ".

    I am going through the link you have mention.

    Regards,

    panshi

     

     

  • There's a problem with memory mapping, maybe in the .cmd file or in the sim*.cfg or some differences between them.. try to compare the memory definitions of these two files. The sim28xx.cfg is in <CCSpath>\drivers\.

    Which is the instruction or portion of your code that gives you this error?

  • Hi,

    I could not see which instruction are at address 0xaec0., but my memory map file shows,

    .ebss      1    00008040    00002f00     UNINITIALIZED
                       00008040    00002e66     BL_InitSettings.obj (.ebss)
                       0000aea6    00000004     rts2800_ml.lib : _lock.obj (.ebss)
                       0000aeaa    00000001                    : errno.obj (.ebss)
                       0000aec0    00000080                    : exit.obj (.ebss)
      

    In my sim2808.gel file it shows that,

        /* Data memory maps */
        GEL_MapAdd(0x0,1,0x400,1,1);                 /* M0 SARAM        */
        GEL_MapAdd(0x400,1,0x400,1,1);               /* M1 SARAM        */
        GEL_MapAdd(0x800,1,0x800,1,1);               /* PF0             */
        GEL_MapAdd(0x6000,1,0x1000,1,1);             /* PF1             */
        GEL_MapAddStr(0x7000,1,0x1000,"R|W|AS2",0);  /* PF2             */
        GEL_MapAdd(0x8000,1,0x1000,1,1);             /* L0 SARAM        */
        GEL_MapAdd(0x9000,1,0x1000,1,1);             /* L1 SARAM        */
        GEL_MapAdd(0xa000,1,0x2000,1,1);             /* H0 SARAM Mirror */
        GEL_MapAdd(0x3d7800,1,0x800,1,0);            /* OTP             */
        GEL_MapAdd(0x3e8000,1,0x10000,1,0);          /* FLASH           */
        GEL_MapAdd(0x3f8000,1,0x1000,1,1);           /* L0 SARAM Mirror */
        GEL_MapAdd(0x3f9000,1,0x1000,1,1);           /* L1 SARAM Mirror */
        GEL_MapAdd(0x3fa000,1,0x2000,1,1);           /* H0 SARAM        */
        GEL_MapAdd(0x3ff000,1,0x1000,1,0);           /* BOOT ROM        */

    And in my custom cmd file definations are like  this,

    PAGE 1 :   /* Data Memory */
       RAMM0       : origin = 0x000000, length = 0x000800     /* on-chip RAM block M0 */
       RAML1       : origin = 0x008030, length = 0x03FD0     /* on-chip RAM block L1 */
       RAMH0       : origin = 0x3FA000, length = 0x002000     /* on-chip RAM block H0 */

    SECTIONS

       /* Allocate program areas: */
       .cinit              : > FLASHA      PAGE = 0
       .pinit              : > FLASHA,     PAGE = 0
       .text               : > FLASHA      PAGE = 0
       .stack              : > RAMM0       PAGE = 1
       .ebss               : > RAML1       PAGE = 1 
       .esysmem            : > RAMH0       PAGE = 1  

       .reset              : > RESET,      PAGE = 0, TYPE = DSECT
       vectors             : > VECTORS     PAGE = 0, TYPE = DSECT    
    }

    From this defination I understood that, in sim2808.gel file my H0 SRAM placed at 0xA000 to 0xC000 but in my custom cmd file H0 sram placed at 0x3fa000.

    Is this thing causing problem?

    I have tried to relocate memory section im my .cmd file to match with sim2808.gel file bit it doesn't work. It is giving compile error such as memory overlap. 

    Thanks,

    Regards,

    panshi

  • Hi,

    you have the object "exit" mapped at that location. I think the problem it's the incoherence of your definition with the simulator config (not the .gel file but sim28xx.cfg).

    You have the following cmd:

      RAMM0 : origin = 0x000000, length = 0x000800 /* on-chip RAM block M0 */
      RAML1 : origin = 0x008030, length = 0x03FD0 /* on-chip RAM block L1 */

    try to replace that with the following, 'cause RAML1 should go from 0x9000 to 0x9FFF and RAMM0 from 0x0 to 0x3FF while RAMH0 definition is correct:

      RAMM0 : origin = 0x000000, length = 0x000400 /* on-chip RAM block M0 */
      RAML1 : origin = 0x009000, length = 0x001000 /* on-chip RAM block L1 */

     

    Raffa

  • Hi,

    I have modify my custom cmd file for

    RAMM0 : origin = 0x000000, length = 0x000400 /* on-chip RAM block M0 */
    RAML1 : origin = 0x009000, length = 0x001000 /* on-chip RAM block L1 */

    After doing this I am getting following error message,

    >>   error: can't allocate .ebss, size 00002f00 (page 1) in RAML1 (avail:
                00001000)
    >>   error: errors in input - ./Debug/ACB0052.out not built

    >> Compilation failure

    This means that ebss size ( which I have placed in RAML1) is excedding the 4K.

    How I can reduce ebss size so that it will fit in to RAML1?

    You said " I think the problem it's the incoherence of your definition with the simulator config (not the .gel file but sim28xx.cfg)." but I am not using this file in my project. It is there in C:\CCStudio_v3.1\drivers.

    Is it require to modify this file so as to match with my custom.cmd file?

    Thanks,

    panshi

  • Hi,

    I am still stuck with the same problem.

    Please help me out.

    Let me know if you need more description of the problem.

    Now In custom cmd file I have define HO SARAM memory section as,

    RAMH0       : origin = 0x009000, length = 0x003000     /* on-chip RAM block H0 */( I have done so because if I am defineing this memory from 0xa000 to 0xC000 and mapping my ebss to this section then it is giving compiler error i.e. memory overlop.)

    From my memory map I can conclude that my ebss section memory requirement is 0x2f00.

           "   name                       origin         length      used    attr    fill

             RAMH0                   00009000   00003000  00002f00  RWIX    " 

    When I am starting simulation, and doing go to main action it shows "Can't write to data memory 0xBE80, check memory config [-2184]" message. 

    If my required memory is 0x9000 to 0x2f00, and in map it is showing that this much meory is allocated then what could be the reason for error?

    One more point I have notice in map file,

    "

    .ebss      1   00009000    00002f00     UNINITIALIZED
                      00009000    00002e66     BL_InitSettings.obj (.ebss)
                      0000be66    00000004     rts2800_ml.lib : _lock.obj (.ebss)
                      0000be6a    00000001                    : errno.obj (.ebss)
                      0000be80    00000080                    : exit.obj (.ebss) "

    exit is located at 0xbe80 lcoation for which I am getting error.

    Regards,

    panshi

     

  • Hi,

    My simulation problem is now solved.

    You was right Raffa, there was config difference in sim28xx.cfg file.

    Other problem I am facing is that, I am using cycle simulator (since my controller is TMS320F2808) and I have some device configuration (such as PIE) in my code.

    Cycle simulator is not supporting peripheral debug and it is giving message "Can't read from data memory 0xCE0" while debugging. What could be the other way I debug my entire code with simulator.

    Regards,

    panshi

     

  • The F28xx cycle simulator does not support peripheral debug as you have seen. The sim28xx.cfg will show you the memory regions the simulator has access to. Since it does not have access to 0xCE0 you are seeing the "Can't read from data memory" message when debugging. You would need hardware like eZdsp to debug peripheral code.

  • Hi Panshi, I have exactly the same problem, are you able to paste in more details of what you did to fix the problem? thanks Dave

  • In my case, it was memory configuration (mismatch) issue.

    Please look for your .cfg file.

    Ensure that you are refering right .cfg file.

    In .cfg file ensure that OTP memory and other memory type is properly mapped.

    panshi

  • Thanks Panshi, I found my issue to be similar. The memory map in my *.cmd file did not match that in the simulators *.cfg file (F28xx simulator ). It was a simple fix. I changed the location of my high data memory in the *.cmd file to match that which was in the simulators *.cfg. The simulator is working great now. Cheers Dave

  • Hi Panshi, I have exactly the same problem, but my memory configuration is correct.

    I would like to use the Pin Connect tools of the Code Cmposer, and an interrupt is happened then I gave this message.

    Lekvar

  • Hi There,

    Seems we all have the same problem, however it seems you found the answer. Can I ask someone to post here his *.cmd file and his *.pjt (to see the build options) ?

    I cannot manage to have the simulator running. Should be a simple thing but it's not clear to me. I did not change anything in the sim28x.cfg (should I ?), so what should my cmd file looks like ?

  • Hi There

    Maybe there are different reasons possible for this error message. I have the same:

    Message: "Error: Can't write to data memory 0x801, check memory config [-2184]"

    CCS: Version 3.3.38

    Simulator: F2812 Device Simulator

     

    I searched for differences between the memory definitions of "f2812_sim.ccs" and "F2812_EzDSP_RAM_lnk.cmd" but it was consistent.

    The instruction where the error appears is "MOV  AL,@35" belonging to "while(PieCtrlRegs.PIEIFR1.all != 0x0000 ){}"

    Thanks for any inputs.

  • In a previous post someone reported the error, and a TI employee answered there was a "bug" in the sim file, and that only F28335 will be supported in the future. In CCSv4 only F28335 will be supported.

    Sorry to say that but I simply stopped using the simulator and now work only with hardware connected :-(

  • Hello André. I get it. With HW connected it's better. I just tried to by-pass the time 'til the emulator arrives, by simulating the code. Thanks for your fast answer.

  • Hi,

    I have the same problem of Error: Can't write to data memory 0x800, check memory config [-2184] , when i run my program this error appears.  Please i need help in clearing this error. I need help in fixing thisproblem 

    I am working on Timer0 interrupt ( PIE related) once i run my program this error appears and i tried to debug my program with break points the code jumps to ITRAP0 ( OPCODE 0X0000) and after after this still i continued debugging to check what is status of my timer0 counter value ( in memory window) it continues to decrements and rolls over to zero and then sets TIE bit in TIMER0 control register and if i still continue debugging after some time Stack point register crosses 0X800 value and causing Error message in message window. 

    I tried all the solutions mentioned in the earlier replies of this post but nothing is working out. I don't have hardware right now to connect, is connecting hardware fixes this problem?  Ti Me can you please tell me how did you cleared your problem?.

    In my main code i encounter ITRAP0  just one instruction after EINT ( INTM is cleared i.e global interrput bit set). i am attaching my main() function .c file

    the file " Example_281xCpuTimer.c" which has function main() and ISR function. i am attaching for reference

    0312.Example_281xCpuTimer.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // TI File $Revision: /main/3 $
    // Checkin $Date: July 2, 2007 11:33:22 $
    //###########################################################################
    //
    // FILE: Example_281xCpuTimer.c
    //
    // TITLE: DSP281x Device Getting Started Program.
    //
    // ASSUMPTIONS:
    //
    // This program requires the DSP281x V1.00 header files.
    // As supplied, this project is configured for "boot to H0" operation.
    //
    // Other then boot mode configuration, no other hardware configuration
    // is required.
    //
    // DESCRIPTION:
    //
    // This example configures CPU Timer0 and increments
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    .

    my linker files are 

    MEMORY

    {
    PAGE 0 :

    RAMM0 : origin = 0x000000, length = 0x000400
    BEGIN : origin = 0x3F8000, length = 0x000002
    PRAMH0 : origin = 0x3F8002, length = 0x000FFE
    RESET : origin = 0x3FFFC0, length = 0x000002


    PAGE 1 :

    /* For this example, H0 is split between PAGE 0 and PAGE 1 */

    RAMM1 : origin = 0x000400, length = 0x000400
    DRAMH0 : origin = 0x3f9000, length = 0x001000
    }


    SECTIONS
    {

    codestart : > BEGIN, PAGE = 0

    ramfuncs : > PRAMH0 PAGE = 0
    .text : > PRAMH0, PAGE = 0
    .cinit : > PRAMH0, PAGE = 0
    .pinit : > PRAMH0, PAGE = 0
    .switch : > RAMM0, PAGE = 0
    .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

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


    }

    i also referred  document  on "TMS320f2812_errata" to fix if any stack over flow  and tried to change M1 memory and tried to a lower its size but even those fixes did not work.

    please help to fix this problem.

    Thanks,

    Sangeetha