[SOLVED] compiling with "armgcc" ( Nordic Example)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] compiling with "armgcc" ( Nordic Example)

    I have a nordic example ( uart ) which I've integrated embos into. program runs well when compiling in Segger Studio ( SES ) .
    However - trying to compile the code in "armgcc" ( from cmd line and make ) gives me the following error :

    ../../../../../../external/embOS/Lib/libos_v7m_t_vfpv4h_le_r.a(OS_StackInfo.o): In function `OS_STACK_GetSysStackBase':
    OS_StackInfo.c:(.text.OS_STACK_GetSysStackBase+0x4): undefined reference to `__stack_start__'
    ../../../../../../external/embOS/Lib/libos_v7m_t_vfpv4h_le_r.a(OS_StackInfo.o): In function `OS_STACK_GetSysStackSize':
    OS_StackInfo.c:(.text.OS_STACK_GetSysStackSize+0x8): undefined reference to `__stack_start__'
    OS_StackInfo.c:(.text.OS_STACK_GetSysStackSize+0xc): undefined reference to `__stack_end__'

    Seems like those symbols are not defined for armgcc, embos is looking for them .
  • Dear Ran,

    __stack_start_ and __stack_end_ are linker symbols which are used by embOS.
    Which linker file are you using?
    With Embedded Studio the GCC linker file is generated from the flash_placement.xml and nRF52840_xxAA_MemoryMap.xml when you build the project.
    You might want to copy the Start_nRF52840.ld from the \Output folder to e.g. the \Setup folder and use it from there.

    Does that solve your issue?

    Best regards,
  • Hi Ran,

    wrani wrote:

    Note that I see those symbols in ses_startup_nrd52840.s :"_vectors:
    .word __stack_end__"

    but not in ses_startup_nrd52840.s which is used when building from "armgcc"

    This is correct. With the armcc startup code, __initial_sp is used instead of __stack_end__. Hence, you will find a line like

    Source Code

    1. __Vectors DCD __initial_sp ; Top of Stack

    in the armcc startup.

    Yet, both __initial_sp and __stack_end__ are linker created symbols, respectively. Since embOS for Cortex-M and Embedded Studio does rely on __stack_end__, using the armcc startup unfortunately is not possible. Now, you may modify that file accordingly, but would run into further problems later on. Therefore, the best approach would be to simply use embOS for Cortex-M and Keil ARM instead of embOS for Cortex-M and Embedded Studio. However, using armcc shouldn't be necessary at all for your use case, which I think is what your next question targets as well:

    wrani wrote:

    Also - he reason I even want to try compiling for ARM is because I need the project to build nightly on our automation server.
    Is there a way to compile a SES studio project from command line ? ( no UI, eclipse has this )

    Yes, it's possible to do so of course. Whether armcc or gnuarm is used, both may be utilized via command line.
    Also, Embedded Studio allows for creating makefiles via the UI: simply right-click on the project in the project explorer and select "Export Makefile". Subsequently, that makefile may be used to perform nightly builds using GCC via command line.

    Does this answeryour question? Please let me know if I can be of any further help.

    Best regards,