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

Use C++ with Nordic SDK (nRF52 series)

Hi, i wrote a lot of firmwares for nRF51x22 using C language and they works fine. Now we passed to nRF52 series and we want to use C++ (preferibly C++11) that is more readable, ordered etc... but i got a lot of difficulties to setup a project.

I'm basing on ble_app_template and i used

extern "C" { }

for all inclusions but i got a lot of errors in some drivers and libraries of SDK.

Can you give me a detailed step-by-step tutorial to setup a project to compile with C++?

I'm using Keil 5.23 with ARMCC 5.06

Thank you.

Parents Reply
  • I got the ble_app_uart example in SDK v14.2 to work with the C++ compiler in Segger Embedded Studio. I had to set the compiler to C++11, and make some changes to a couple of the SDK files, as well as a minor change to the main file. 

    I could not get the std::String class to work unfortunately. 

    I will try to get some more time to look into this next week. 

Children
No Data
Related