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.

SYSBIOS executing from RAM

Other Parts Discussed in Thread: SYSBIOS

4353.app.cfg

Our device has external RAM and I am trying to get the sysbios app to load into RAM but seem to be having link issues as it appears that an automatically generated link file always wants to place SYSBIOS in flash.

At this point I have juts been trying to modify the applications linker command file.

I have verified that I have the external RAM configured correctly and can execute a RAM test on it that passes.

Can you explain what files need to be modified / added in order to get application loaded into RAM?

Are there any examples projects for SYSBIOS in RAM .

It was suggested I attach my apps cfg file so I have done so.

Thanks

Maury

  • Hi Maury,

    Can you share the applications linker cmd file, map file and the generated linker cmd file ? Please also highlight which sections are being loaded in flash ?

    The Boot module has certain helper functions for performing Flash configuration and these functions get loaded to FLASH. Line 232 (Boot.loadSegment = "FLASHA | FLASHB  | FLASHC  PAGE = 0";) in your application's cfg causes these Boot module helper functions to get loaded to FLASH. I presume you are not using the FLASH at all and so you can just disable Flash configuration. That will get rid of these functions and linker placement in the generated linker cmd file.

    app.cfg:
    
    var Boot = xdc.useModule('ti.catalog.c2800.initF2837x.Boot');
    Boot.configureFlashController = false; // Disable Flash config

    Best,

    Ashish

  • Ashish,
    Getting back to trying to solve this.
    I disabled the boot from flash in the projects app.cfg file and that resolved some of the link errors.
    line 3 from your response above is also in the cfg script file

    In a linker.cmd file that indicates it is automatically generated I get a link error for the following entry
    SECTIONS {
    .text:ti_catalog_c2800_initF2837x_flashfuncs : LOAD = FLASHA | FLASHB | FLASHC PAGE = 0,
    RUN = D01SARAM PAGE = 0,
    table(BINIT)
    }
    I see in the boot startup options in the app.cfg there is an entry that looks similar to this.
    Do I just change this to my external ram definition in the apps linker command file ?
    Thanks
    Maury
  • Ashish,
    I tried what I suggested and this removed the last linker error.
    When I try to load the application with the debugger I get mixed results it seems like the first time I load it ends up indicating suspended at location 3fe493 which indicates ESTOP in disassembly window.
    If I stop debugging and the reload sometimes it start and ends up in the abort function. As I look at the call stack in debug window it is failing in TaskSupport.c in function TaskSupportStart() indicating that for this task the task size if out of range > maximum.
    I also have some of the other segments loaded into another portion of external ram so the task stack being checked indicates it is at 0x300D00 and size is 512 and this fails the check.

    From the linker command file here is some of the interesting lines regarding this
    EXTRAM : origin = 0x300000, length = 0x040000

    .stack : > RAMM1, PAGE = 1
    .ebss : > EXTRAM PAGE = 1
    .econst : > EXTRAM PAGE = 1
    .esysmem : > RAMGS4, PAGE = 1
    .cio : > RAMLS0 | RAMLS1 | RAMLS2 PAGE = 1

    Suggestions?

    Is there a way to attach my linker command file?
    thanks
    Maury
  • Hi Maury,

    From your description it seems like the task stack is at an address that is beyond 0xFFFF. This is a problem on C28. The SP on C28 is 16-bits wide and therefore all stacks need to be within 0x0-0xFFFF address range. Can you place the heap (task stacks are allocated from heap by default) below 0xFFFF ? Alternatively, you can do the following:

    *.cfg:
    
    Task.defaultStackSection = ".customStackSect"; /* Place all task stacks in custom section */
    
    *.cmd:
    .customStackSect : > RAMM1, PAGE = 1 /* Add mapping for custom section */

    You can find the option to attach files by selecting "use rich formatting" option.

    Best,

    Ashish

  • Ashish,

    I got the heap moved and that resolved that issue. What is the default section the heap gets put into?

    The issue I have now is that the program seems to load but it does not always run.

    When I try to load the application with the debugger I get mixed results it seems like most of the time I load it ends up indicating suspended at location 3fe493 which indicates ESTOP in disassembly window.

    If I reload a few times sometimes it will run to main and I can then execute the program and set breakpoint.

    Maury

  • Ashish,
    A little more info on my issue with getting the program to load and run.
    When I do debug and it loads the program the first time I still get the No source available for 0x3fe493.
    If I look in the memory window it looks like the app is loaded at correct external RAM location specified in linker file.
    If I hit resume then the memory at the external ram location all goes to 0.
    If I now load the program it runs to main.
    This appears to work consistently so far.
    Maury
  • Hi Maury,

    Its difficult to tell why the app loads and runs sometimes but not at other times. Can you share your app's map file ? Maybe some placements are still incorrect.

    Best,
    Ashish

  • Ashish,

    I will try to insert the amp and linker file. Note it seems to be the initial load that does not work.

    If I hit resume on failure ext ram goes to zero and if I reload app it runs

    5050.tempfiles.docx

  • Hi Maury,

    Thanks for sharing the linker cmd file and map file. I looked at them and they seem out of sync. The linker script does not put any section in FLASH, but, the map file places all code in FLASH. Was a wrong map file attached by mistake ?

    Best,
    Ashish
  • Ashish,

    I must have copied the map from the wrong folder. I'll try this again

    8156.rfc link map.docx

  • Hi Maury,

    I looked at the linker script and map file and they look fine to me. Is it possible for you to share a executable that I can load and run on my end to reproduce the problem ? Maybe the same executable you have now or build a simplified application that still exhibits the issue and share the executable ?

    Best,

    Ashish

  •  attached is the out file for the application into RAM that sometimes loads. I had to rename it to get it to attache

    7077.nGen Controller.txt

  • Hi Maury,

    I unfortunately cant load your app as I dont have a board with external RAM.

    Going through the earlier posts, I have a question regarding the PC after you load the application. Does the PC point to address 0x345e31 (entry point function _c_int00) ? If not, then it seems like the loader is not initializing the PC to point to the entry point symbol as expected.

    If PC does not point to entry point after loading the app, can you hit "Reset" followed by "Restart" ? That should set PC to the right address. Let me know if doing so makes the app work consistently.

    Best,
    Ashish