Clarence Alucho
Clarence Alucho

Reputation: 89

Build failed with no stated reason on Segger Embedded Studio after adding custom source files

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?

Upvotes: 0

Views: 1985

Answers (1)

Lundin
Lundin

Reputation: 214770

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.

Upvotes: 1

Related Questions