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.

Move code/ISR to internal SDRAM

Genius 5820 points

 Hi,

I'm running a small application that is loaded by MLO bootloader from SD-card to address 0x80000000 (DDR-RAM of BeagleBone Black). 

Is there a way to use the internal SDRAM too? Means move some pieces of code (especially an interrupt service routine and some data) to that internal RAM and run it there instead in DDR-RAM?

The code I want to run there is of course small enough to fit into these 64 KBytes.

Thanks!

 

 

 

  • Hi,

    Please refer the files slpWkup_gcc.S and demo.lds of demo project  which demonstrate the relocation of function saveRestoreContext() to internal memory.

    Regards,

    Ramesh D

  • Hi Ramesh,

    I tried to do something similar for my C-code and the TI-compiler. That's what I added to the .cmd-file:

        GROUP
        {
             IRAM_CODE : { }
             IRAM_DATA : { }
        }load=DDR_MEM, run=INT_MEM, START(iram_start), SIZE(iram_size), RUN_START(relocstart)
    
        .text:DMTimerIsr : load > IRAM_CODE

    Here DMTimerIsr is C-function I want to place in internam SD-RAM. Unfortunately the compiler complains with

    #10099-D program will not fit into

    The funny thing: not only my function DMTimerIsr() but also the whole program is smaller than 0xFFFF, so it definitely should fit.

    What am I doing wrong here?

    Thanks!

     

  • Hello Hans,

    I believe you are trying to find a solution to the dmtimer ISR issue. Access times for code placed in Cache and SRAM should be similar and hence moving the ISR to SRAM may not solve your problem. I had tried to run the EVMSK example which turns on the ICache and hence the ISR (or at least part of it) should be placed in the cache butcould not get the 5us periodicity that you wanted. 

    As stated in that mail I will get back to you on this shortly.

  • Hi Vineeth,

    I'm doing these tests not only for the speed issue of the ISR but in preparation of some other things I have to do.

    So for the other issue: take yout ime, I'm waiting patiently :-)

    Hans

  • To clarify my question a bit: the linker command file uses some variables iram_start, iram_size and relocstart which itself are used for copying later. What I did not found in demo-application: where are these variables defined and filled with data?

    When I adapt my own .cmd-file according to what is done in demo.cmd and define the same external variables I still get a warning

    #10097 memory range not found: gpioLEDBlink.cmd /gpioLEDBlink line 87

    and an error


    #10099-D program will not fit into gpioLEDBlink.cmd /gpioLEDBlink line 87

     where I define to load my C-code to internal ram with

        .text:DMTimerIsr : load > IRAM_CODE

    Thanks!