This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Eclipse Managed Make Project for nRF52

I'm using nRF52 + SDK11.0.0 + s132 and following this tutorial and this blog to make a Managed Make project using the ble_hrs esample.

As I was going through the directory structure, I noticed that ble_app_hrs_gcc_nrf52.ld in the Eclipse project directory is exactly the same as armgcc_s132_nrf52832_xxaa.ld (located in the components\softdevice\s132\toolchain\armgcc subdirectory) but armgcc_s132_nrf52832_xxaa.ld is not being used. Why are there essentially two copies of this file?

Also, I am trying to match up the Managed Makefile flags with the Standard (tutorial's) Makefile flags and would like clarifications on:

  1. --gc-sections is optional in the Standard build: Standard: -Wl,--gc-sections vs Managed: --gc-sections. Is this an issue?

  2. -Map is optional in the Managed build: Standard: -Map=nrf52.map vs Managed: -Wl,-Map,"nrf52.map". Is this an issue?

  3. not linking libc and libnosys does not cause errors in the Managed Build. Are these necessary?

  • 1,2) Those are just two different forms of the same "option", both have the same effect (e.g. the gc-sections effect) -Wl,foo just says the option foo is passed to the compiler but understood by the linker. Maybe Eclipse managed make is passing the option directly to the linker instead of to the compiler which then invokes the linker.

    1. Not necessary until your app uses a function from those libraries. The link phase of the build would fail otherwise.

    I use Eclipse managed make. It seems fine but does require you to learn the GUI of Eclipse i.e. build configurations, project properties, etc. Also requires you to extract options and paths from the Nordic example makefiles.

  • I assume that the linker script in the toolchain folder is the template that was used to generate the linker scripts for each individual project.

  • My mistake; the files are actually different for the RAM regions. I believe the one listed in the project directory accounts for the softdevice: RAM (rwx) : RAM (rwx) : ORIGIN = 0x20002080, LENGTH = 0xdf80 vs ORIGIN = 0x20000000, LENGTH = 0x10000. But since the template .ld file is in the softdevice\toolchain directory, I would have guessed that the template would already account for this.

Related