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.

RTS assembly

I have a bare-metal application for the Cortex-A9 processor Core 0 in the OMAP4460 (PandaBoard ES).  The starting point for my application (which I can run on the board through the debugger) was the "Basic" Hello World example for the Pandaboard ES (I had to modify the target to a Generic Cortex-A8 in order to get things working properly).  I need to modify the default RTS code that gets linked to set up an IRQ stack and to clear the CPSR "I" bit (among other things).  Any helpful tips on doing this?  I located and extracted the rtssrc.zip file in the CCS 5 installation.  I could iteratively try to include and compile the individual sources one by one (starting with boot.asm), but there has to be a better way. 

I really don't want to be wasting time re-writing assembly.  If something already exists along these lines I would be very happy to use it.

I originally posted this question on the OMAP4 forum, but was referred here.

Thanks,

Errett

 

  • Hi Errett,

    If you are looking to modify the RTS code, the experts in the compiler forum can help you best. I will move this thread to that forum

    Thanks

    ki

  • Errett Hogrefe said:
    I need to modify the default RTS code that gets linked to set up an IRQ stack and to clear the CPSR "I" bit (among other things). 

    I can't help you with that level of technical detail.

    Errett Hogrefe said:
    I located and extracted the rtssrc.zip file in the CCS 5 installation.  I could iteratively try to include and compile the individual sources one by one (starting with boot.asm), but there has to be a better way. 

    This approach has been taken by many before you ... Extract boot.asm from rtssrc.zip and make it a source file in your project like any other.  Then add your changes in system initialization to it.  I don't see why you need to modify any other file besides boot.asm.

    Thanks and regards,

    -George

  • Thanks - this worked for me.  I was initially trying to do this by checking the "disable automatic RTS selection" option, unchecking the "reread libraries" option, and importing everything manually, like I have had to do with other toolsets.  Once I restored the default settings and did as you suggested, things worked.

    If you don't mind, could you explain what is actually happening when the tool is set to enable auto RTS selection and re-read the libraries?  Does the linker simply pick what it needs from the existing "libc.a" after assembling the modified code (e.g. the modified boot.asm file in the project)?  What I am trying to say is that I am interested in how the tool avoids the conflict between the modified code and the library code.

    I know I'll have more questions about the assembly, but I'll start new threads for these.

    Thanks,

    Errett

  • Errett Hogrefe said:
    I am interested in how the tool avoids the conflict between the modified code and the library code.

    You are probably linking with the option --rom_model, though you might be using --ram_model.  Either of those options instructs the linker to adopt the conventions for linking C/C++ code.  Among those conventions is that the entry point of the program is the symbol c_int00.  (On COFF ABI builds, the symbol is _c_int00.)  This symbol is defined in the module boot.obj in the compiler RTS library.  Normally, that module is brought in from the library to satisfy the reference.  However, in your case, c_int00 is defined in the boot.obj module from your project.  Since, the symbol c_int00 is already defined, it is not brought in from the compiler RTS library.

    Thanks and regards,

    -George

  • George,

    I am trying to enable Neon core inside Cortex A8. Based on the info I got from TIE2E, I will need to modify the boot.asm in RTS library to keep the Cortex A8 in "SPV Mode" in stead of "User Mode" after early stages of runtime initialization (at the boot.asm file). My previous conversation regarding enabling Neon is in this link http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/364387.aspx.

    My questions are

    1) Should I take the whole RTSSRC.zip source files to build a whole new RTS library, then add this RTS lib into my linker configuration to use it?

    2) A little more detail about which part of boot.asm to be modified to initialize the ARM to SPV (supervisor) mode instead of User mode.

    Thank you in advance,

    Xiaofeng

  • 1) No, just modify boot.asm and add that to your project

    2) Look at the source code for boot.asm; you will see a block of code that is commented "SET TO USER MODE;" either move this block to a later point, or remove it entirely.