ELLCC for bare-metal ARM Core-M3 on Windows

Home Forums Forum ELLCC for bare-metal ARM Core-M3 on Windows

This topic contains 9 replies, has 2 voices, and was last updated by  Maurizio 9 years, 2 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #23133

    Maurizio

    Hi all, I would like to use ellcc to generate code for my ARM core-M3 target.
    Due to very limited resources I need to be bare-metal without any additional library.

    I did a few initial tests by cross-compiling a sample test program on a Windows host but I get some strange errors related to duplicate file inclusions, missing type definitions etc. The same example complies and runs perfectly with gcc 4.7 and gcc 4.9 so I’m a bit confused.

    Any suggestions? Is the window version of ellcc reliable or is it better to use the linux one?

    Thanks
    Maurizio

    #23135

    rich
    Keymaster

    Hi Maurizio,

    I’d also like to see Cortex-M3 supported by ELLCC. Could you post an example of what you’re trying to compile? I’ll take a look to see how we can start folding at least some bare metal functionality in for Cortex-M. It is probably just a matter of creating the appropriate config file.

    -Rich

    #23138

    Maurizio

    Hi Rich, thanks for your reply.

    Actually I have two different issues:
    1) understanding if the code generated is suitable for a bare-metal CortexM3. At the moment I’m compiling with -target arm-elk-engeabi -mthumb -mcpu=cortex-m3
    Not sure if this is enough or I also have to modify some config file.

    2) The compile-time errors I was mentioning in my previous post. I did a few more investigations, it seems they are related to the#pragma once directive. If I replace them with the good old #ifndef myfileneme / #define myfilename .. #endif compilation is ok.

    Thanks for any suggestion
    Maurizio

    #23170

    rich
    Keymaster

    Hi Maurizio,

    A quick status update. I’m working on the Cortex-M3 in my spare time. Here’s what I have so far. I created a config file called thumb-linux-engeabi (in ellcc/libecc/config):

    based_on: arm-ellcc-linux
    compiler:
      options:
        - -target arm-ellcc-linux
        - -mthumb
        - -mcpu=cortex-m3
        - -mfpu=none
        - -mfloat-abi=softfp
    linker:
      static_crt1: $R/lib/thumb-linux-engeabi/crt1.o
      dynamic_crt1: $R/lib/thumb-linux-engeabi/Scrt1.o
      crtbegin: $R/lib/thumb-linux-engeabi/crtbegin.o
      crtend: $R/lib/thumb-linux-engeabi/crtend.o
      library_paths:
        - -L$R/lib/thumb-linux-engeabi

    I modified ellcc/libecc/src/musl/configure by adding the following line:
    thumb*) ARCH=arm ;;

    Then in the ellcc/libecc directory, I can try to make the C library:
    make thumb-linux-engeabi
    If I disable building assembly language files, all the C files compile. Now it is a matter of modifying the assembly code to be thumb compatible.
    I plan to use this Linux library for testing, and then add support for standalone ELK.

    -Rich

    #23173

    Maurizio

    Thanks Rich, I’m also working on this in background, I’ll try to follow what you are doing..
    -m

    #23255

    rich
    Keymaster

    Hi Maurizio,

    Version 0.1.10 has preliminary Cortex-M support. Any feedback appreciated.

    -Rich

    #23283

    Maurizio

    Hi Rich, that’s great! I will give it a try when I have a moment…!

    Best regards
    Maurizio

    #23294

    Maurizio

    Hi Rich, I’ve seen the new thumb-linux-engeabi configuration..
    One thing is not clear to me: can I try to use this version for my bareboard target or the libraries are somehow linux-specific?

    Thanks
    -m

    #23295

    rich
    Keymaster

    Hi Maurizio,

    I haven’t finished the bare-metal support for the M3 yet. I’m hoping to get it done, or at least usable by the end of the weekend.

    -Rich

    #23299

    Maurizio

    I’m in no hurry, we are using GCC at the moment and it is fine. I just wanted to evaluate if with an llvm-based compiler we could get enough advantages in term of code optimizations that would justify the transition.
    Have a nice weekend!
    -m

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.