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

Adding my own C files using GCC for 'ble_app_hrs' on pca10028 S110

Hello there,

I managed successfuly to build the 'ble_app_hrs' of SDK10 on my NRF51 on GCC MARS 2.0 using these two guides combined:

devzone.nordicsemi.com/.../ devzone.nordicsemi.com/.../

I downloaded the 'nRF51_SDK_10.0.0_ble_app_hrs_dfu_s110_pca10028.zip' pack with the cproject and makefile. I tried to load C files of my own but I couldn't ubild them and recieved constantly this error: 'No such file or directory'.

I tried to attach my simple C file of LEDs operation, and the SDK relative drivers, by: Right click(on the project name folder) > Properties > C/C++ General > Paths and Symbols. I added the right #include to the main.c file and I failed. I only managed to relate the H file.

I copied the C and H files to the build directory(Properties > C/C++ build > build directory) where the cproject and makefile are located, and no result.

What must I do in order to successfuly run these lovely LED H and C files on GCC??

IDAN

Parents
  • Hi,

    It sounds like you have correctly added the .c file, included the .h file, and made sure you have the correct paths set both in the Properties -> (...) -> Paths and Symbols tabs "Includes" (for the .h file) and "Source Location" (for the .c file).

    A common problem (at least on Windows) is that the file path is simply too long, which also results in a 'No such file or directory' error. Moving the entire project to a folder that is not as deep in the file hierarchy will probably work. (That includes the SDK.) You can also consider putting your .c and .h files not as deep, i.e. on the same level as the existing .c and .h files in the project.

    Regards, Terje

  • Ah, OK. I guess when you write GCC you mean Eclipse, though.

Reply Children
No Data
Related