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

Application compiles with no errors but still dosen't work?

I am building a Bluetooth Mesh application based on the Mesh Beacon Example, i have written a custom Makefile and got it compiling with no errors.

But when Flashing the nRF51422 with the program, nothing happens. If I build the example in the original directory and flashes it to the device the program works.

My best bet is I am doing something wrong with linking but i am no sure. I have attached both my Makefile and linker script. The project is using parts of SDK v12.1 and MESH SDK.

Here is my Makefile.

Here is my linker script:

SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
    FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
    RAM (rwx) :  ORIGIN = 0x200013c8, LENGTH = 0x6c38
}

SECTIONS
{
    .fs_data :
    {
        PROVIDE(__start_fs_data = .);
        KEEP(*(.fs_data))
        PROVIDE(__stop_fs_data = .);
    } > RAM
} INSERT AFTER .data;

INCLUDE "nrf5x_common.ld"

Any good ideas to how i can fix the problem or find out what the problem is, is appreciated.

Edit 1: The .hex file generated by my makefile is only 635 bytes large but the .hex file from the example project is 769.7 KB large. Maybe this can give an indication of what is wrong.

Edit 2: I am using s130 and the nRF51422 with 256kB on the PCA10028 devboard.

Edit 3: I have tried using the -e main linker flag, after realizing I got a compiler warning and searching after the warning (warning: cannot find entry symbol ___ defaulting to ___).

After adding the linker flag the compilation failed with a long list of missing files. I have now added all these files to the Makefile and the project compiles successfully, though it still doesn't work when flashed to the device.

I think I am getting closer to the problem, but help is still appreciated.

Edit 4: I have tried to follow this guide for combining the Mesh SDK with other SDK's but it is still not working.

Edit 5: It seems like i have finally made it work. I will not mark this as a solution, because my working repository has changed a lot since posting this question and i am honestly no sure what precisely was the problem.

But the finale change to make the program run, was adding two files to the Makefile, gcc_startup_nrf51.S and system_nrf51.c, both found in <SDK_ROOT>/components/toolchain/.

Thank you to everybody who have tried to help me.

Related