0

I'm modifying a simple example project (blinky) from the nRF SDK. I added a header file and a .c file in a new folder inside the project directory then added that path ./lib to the common preprocessor user include directories. I then included the header to main.c. I can compile the new library on its own but when I build the whole project, I get Build failed error with no stated reason to follow up.

Here is an image of that:

Build failed with no reason stated

Does anyone here know how to beat this?

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
  • I am not familiar with Embedded Studio but what other options are there where it says "show transcript / tasks"? IDEs often filter build logs to simplify the output - this can be unhelpful. What you need to see is the raw build log as output by the toolchain not the IDE's digest. – Clifford Mar 07 '20 at 17:27
  • Thanks @Clifford ! I looked at the raw build log and saw the problem. In the header file I added, one variable did not have the extern keyword behind it. Rookie mistake. Thank you for pointing me in the right direction. – Clarence Alucho Mar 08 '20 at 06:20
  • That pic looks a whole lot like Crossworks, I'm thinking Segger might be using that IDE and branding it as their own? In Crossworks under user include directories, you should have `$(ProjectDir)/foo` where `foo` is the name of the new directory. Also you might have to add custom libraries in there if the IDE doesn't do that automatically. – Lundin Mar 09 '20 at 07:56

1 Answers1

0

I haven't used Segger Studio specifically, but it seems to be the CrossWorks IDE underneath.

In CrossWorks, you have to do the following:

  • Download & install all relevant libs from inside the IDE, under Tools -> Packages -> Install packages. Grab your specific target MCU as well as any specific boards or libraries you'll be using. In case some needed lib is missing here, you will get very weird errors.
  • In the project, click on the project name itself in "project explorer". Then in the properties window, check settings (this is a bit different in different versions of CrossWorks, might have to right click and pick properties in older versions). Under "user include directories" you should have something like this:

    $(DeviceIncludePath)
    $(TargetsDir)/NameOfMCU/Include
    $(PackagesDir)/CMSIS_4/CMSIS/Include
    $(ProjectDir)/NameOfDirectory
    

    Where "NameOfMCU" is the name of the MCU family used, CMSIS should be there in case you are using any ARM, "NameOfDirectory" is the name of your custom directory (you can add several).

Also, get the debug build working first, before switching to release build.

Lundin
  • 155,020
  • 33
  • 213
  • 341