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.

Not enough memory

Other Parts Discussed in Thread: TMS320F28335

I'm currently writing my first application for the TMS320F28335 DSC for a voltage booster application.  If this project goes well, we plan to add more responsibilities to this DSC (motor control, etc.).

I began development on the eZdsp board provided by Spectrum Digital.

Now after only 1-2 weeks, I encoutered my first link error message:

>>   error: can't allocate .text:5, size 000001e7 (page 0) in RAML0 (avail:
            00000002), RAML1 (avail: 00000000), RAML2 (avail: 00000001)
>>   error: errors in input - ./Debug/Booster.out not built

I fixed the problem by modifying the following line of my linker command file:

.text            : >> RAML0|RAML1|RAML2|RAML3,     PAGE = 0    /* Split program in 4 internal RAM sections */

I'm re-using TI's code examples (header files) for which I created a Code Composer project file to build in a library.  My project is done in C++ to try to maximize re-usability of components for future projects.  FYI, I know that it easily fits in memory if I compile my project in Release configuration but I would like to continue development in Debug because it is simpler to Debug, eheheh!

Regarding our application basic modules, we plan to have the following:

  1. 3 fast PIDs control loops to for current regulation.
  2. 1 slow PID control loop for voltage regulation.
  3. A serial console to customize the booster behaviors (customized parameters are written to internal flash memory).

What I want to know is if I should consider began using overlays or if this application should fit in 16 Kwords of memory?  I would prefer to avoid to manage memory manually...

Are there other sections that can be used for program memory that I could have missed?

Also, in our production board, should I recommend our hardware designer to add external memory (for overlays)?  We want our board size to be as small as possible.

Regards,

  • Hi Hugo,

    do you really need to allocate everything of your program in RAM?

    You could store your program on flash and then copy only what you really need to RAM instead of loading everything.

    You should not add ext memory if the program is composed of the 3 items you described.

    Regards,

     

    Raffaele

  • Hi,

    for debugging purposes you may wish to make use of the 256kB external RAM of the eZdsp board.

    Regards,

    Johannes

     

  • I was thinking of doing just that.

    Could you please indicate where I should start my reading to learn how to do this?

    I am currently reading an example of how to execute code from external RAM (Example_2823xCodeRunFromXintf.c) and I understand that code is first loaded in SARAM and then copied to external RAM while the program is executing which is not what I want to do:

    [excerpt from linker command file]

    xintffuncs       : LOAD = RAML1,
                          RUN = ZONE7A,
                          LOAD_START(_XintffuncsLoadStart),
                          LOAD_END(_XintffuncsLoadEnd),
                          RUN_START(_XintffuncsRunStart),
                          PAGE = 0

    [excerpt from Example_2823xCodeRunFromXintf.c]

    MemCopy(&XintffuncsLoadStart, &XintffuncsLoadEnd, &XintffuncsRunStart);

    I modified my linker command file to look like this:

    .text            : >> RAML1|RAML2|RAML3|ZONE7A, PAGE = 0

    When I try to load using code composer studio, I get the following error message which I dont know how to resolve:

    Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x00200046 
    Trouble Removing Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-2044 Error during: Break Point,  No breakpoint at 0x00200046 
    Trouble Setting Breakpoint with the Action "Terminate GEL_Go()" at 0x2007a6: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x002007A6 
    Breakpoint Manager: Retrying with a Legacy Hardware breakpoint
    Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x00200046 
    Breakpoint Manager: Retrying with a Legacy Hardware breakpoint

    Also, since I'm doing my application in C++, in am wondering how to specify in which section a C++ class is to be loaded since the example is shown for a C function as follows:

    #pragma CODE_SECTION(cpu_timer0_isr,"xintffuncs");

    Regards,

  • Hi Hugo,

    HTrudel said:

    I was thinking of doing just that.

    Could you please indicate where I should start my reading to learn how to do this?

    First you need to enable the external interface. This can be done using the function XINTF_Enable() from f28335.gel.

    Then you need to modify your linker command file such that the not-so-time-critical parts of your code and data will be located in external memory.

    Then, when downloading your out-file via JTAG, everything should end-up in the right place.

    HTrudel said:

    I am currently reading an example of how to execute code from external RAM (Example_2823xCodeRunFromXintf.c) and I understand that code is first loaded in SARAM and then copied to external RAM while the program is executing which is not what I want to do:

    [excerpt from linker command file]

    xintffuncs       : LOAD = RAML1,
                          RUN = ZONE7A,
                          LOAD_START(_XintffuncsLoadStart),
                          LOAD_END(_XintffuncsLoadEnd),
                          RUN_START(_XintffuncsRunStart),
                          PAGE = 0

    [excerpt from Example_2823xCodeRunFromXintf.c]

    MemCopy(&XintffuncsLoadStart, &XintffuncsLoadEnd, &XintffuncsRunStart);

    I don't see a need to manually copy stuff to external RAM as long as you download code via JTAG.

    Simply put .text to ZONE7A and define another section "foo" where you put your time-critical functions in.

          .text : > ZONE7A, PAGE = 0

          foo : > RAML0, PAGE = 0

    HTrudel said:

    I modified my linker command file to look like this:

    .text            : >> RAML1|RAML2|RAML3|ZONE7A, PAGE =0

    I don't think this allows you to control which part of section .text ends up where.

     

    HTrudel said:

    When I try to load using code composer studio, I get the following error message which I dont know how to resolve:

    Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x00200046 
    Trouble Removing Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-2044 Error during: Break Point,  No breakpoint at 0x00200046 
    Trouble Setting Breakpoint with the Action "Terminate GEL_Go()" at 0x2007a6: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x002007A6 
    Breakpoint Manager: Retrying with a Legacy Hardware breakpoint
    Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x200046: Error 0x00000008/-1066 Error during: Break Point,  Cannot set/verify breakpoint at 0x00200046 
    Breakpoint Manager: Retrying with a Legacy Hardware breakpoint

    Also, since I'm doing my application in C++, in am wondering how to specify in which section a C++ class is to be loaded since the example is shown for a C function as follows:

    #pragma CODE_SECTION(cpu_timer0_isr,"xintffuncs");

    Sorry, I've never seen that error message. For the #pragma, please read spru514c.pdf, Section 6.9.2.

    Regards

    Johannes

     

     

  • johannes said:
    Sorry, I've never seen that error message. For the #pragma, please read spru514c.pdf, Section 6.9.2.

    It seems there may be a problem with my eZdsp f28335 board.  I used Code Composer Studio to fill address 0x200000 with zeros.  WhenI read back the memory, it was filled with 8s.  I manually wrote 1 to an adress location and the value read was 9.  It seems like the GPIO76 of my board is stuck to 1.

    I also tried loading the Example_2823xCodeRunFromXintf.c from TI and it produced the same kind of error message.

    Thank for the reference, it will be usefull when I will be ready to execute from flash.

  • Hi Hugo ,

    I have experienced the same problem here.

    By opening the socket, and pushing the DSP a bit harder into his socket worked here.

    I had to open the socket multiply times before it was solved.

     

     

  •  

    Leo said:

    Hi Hugo ,

    I have experienced the same problem here.

    By opening the socket, and pushing the DSP a bit harder into his socket worked here.

    I had to open the socket multiply times before it was solved.

    I had our hardware designer (I did not feel comfortable manipulating the DSP in its socket) check this and by removing and reinserting the DSP (bending a little more GPIO76), he solved the problem.

    Thanks.