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.

Port Stellaris startup file from armasm to gnu asm (gas)

Hi everyone,

I have a modified startup file from a Stellarisware example project. However, I need to port this project to compile with the gcc toolchain. The problem is that the startup file is so complex that it takes days to port it to gas syntax.

Is there an automated way of producing a corresponding startup file with gas syntax?

Thanks

  • Hello Andre,

    This may be helpful

    http://www.bitbanksoftware.com/tinytools.html

    It would not be 100% as the web site indicates but better than manual. Hope it meets what you were looking for.

    Regards

    Amit

  • Hi,

    Why do you need to work with gas? the startup_gcc.c file is written in C and no need to return to .asm for gas. Cortex-M software was specially crafted to avoid .asm in startup.

    However, if you really need that, the startup_rmvdk.S is in .asm and with minimal effort can be converted for gas.

    Petrei

  • Petrei said:
    Why do you need to work with gas?

    Bravo Petrei!  Too often poster's objective proves less than fully thought, fully sound.  Note too that the justification for such "group assist" is rarely (i.e. never) provided.  Takes guts to identify as such...

    Beyond so noting - 2 alternative paths to poster's goal are listed - hard to see how this response could be improved...

  • @Amit: thanks a lot! I will try as soon as I get back to work!

    @Petrei: Well, we need to work on ASM because of several reasons: first we need to access the SRAM before it is cleared (i.e. due setup of the stack) and we need to operate without writing to RAM, i.e. only using registers. Furthermore, we need to work with gcc, because we are working with LLVM's IR language, which happens to only support gcc and not arm cc. We are already working with the startup_rmvdk.S, however a lot of code was added, which makes a manual conversion cumbersome. This is why I asked for an automated way.

  • Hi,

    There is a startup file for gcc, written in .asm in Tiva/boot_loader/bl_startup_gcc.S file. Still does not understand your first claim of "complex" startup - but it is your choice...

    Are you sure you need to work with IR in LLVM? do you work in OSX or try to expand to Cortex-M? because if you need to work with Tiva in OSX you can do it without LLVM.

    Petrei

  • Thanks, this sounds perfect. I will check it out on Monday. Maybe complex was the wrong wording. There is just loads of added code in it.

    Yes, we need to work with LLVM since we need to transform native code to an intermediate level and we want to make use of LLVM's code obfuscator.


    We are working on Linux and we are indeed adding functionality to the startup file. Basically, we try to exploit the SRAM PUF instance on the Stellaris to bind hardware to the platform as a PoC.

  • André Schaller said:
    Is there an automated way of producing a corresponding startup file with gas syntax?

    The following thread contains a 'convert_ti_to_gcc.py' script which looks like it might do the job - GCC / GNU assembler and startup code

    [I haven't tried it myself]