Posted 2017-05-11 04:13:06 +0200

blogs->all

# The complete tutorial for developing and debugging nRF52 applications on a Mac

I realize that there are already multiple tutorials on how to configure GCC along with Eclipse or SEGGER Embedded Studio (for use on a Mac), but this tutorial goes over setting up a different IDE. The more choices the better, right? ;)

The IDE of choice for me is NetBeans. NetBeans is well known for Java development but not as much for C/C++ or embedded. However, I personally have been using it for embedded development for about 10 years now (both embedded Linux and MCU-level development). In this tutorial, I'll be going over how to set up and configure the development environment and NetBeans from scratch for developing and debugging nRF52 applications (I used the nRF52840 Preview Development Kit, but really the steps are transferrable to be used with any nRF5x development kit).

I must warn you that the tutorial may be a bit lengthy, but that's because I tried to include every screenshot and image showing details for each of the steps involved. Because of that, I will provide a link to the blog post (which is hosted on my website).

I thought others may benefit from this tutorial especially if they're looking for other options for development on a Mac using open source tools.

Hope you find it useful!

Posted May 11, 2017, 11:26 a.m.

This is great, thanks!

Posted May 12, 2017, 11:02 a.m.

Very good tutorial! Thank you a lot for sharing your insights.

Posted May 22, 2017, 3:11 p.m.

This is great, thanks! Though I have one issue: Code Assistance in Netbeans doesn't pick up #defines from the Makefile, e.g. CFLAGS += -DBOARD_PCA10056 and therefore sees BOARD_PCA10056 as undefined.

I can fix this by manually adding all the relevant defines to Code Assistance -> C Compiler -> Preprocessor Definitions, but that's a little laborious:)

Is there a faster way to make Netbeans' Code Assistance recognise defines from the Makefile?

Posted June 22, 2017, 6:47 p.m.

@Valentin,

Sorry for the late response. Yes, this is a downside of NetBeans. However, I will look into a better way and report back. Thanks!

Posted June 22, 2017, 6:59 p.m.

So, one quicker way to do this is to edit the configurations.xml file located under the NetBeans project folder, and look for:

    <preprocessorList>
....
<Elem>BLE_STACK_SUPPORT_REQD</Elem>
<Elem>S140</Elem>
....
</preprocessorList>


Here you can add all the preprocessors. I guess you can even write a shell or python script to automatically parse the Makefile and add the macros to the configurations.xml file! ;)

## Recent blog posts

• ### 6 Things to Know about Bluetooth Beacons

Posted 2017-09-22 08:27:00 by Rose Martin
• ### Creating a Keil project for a Bluetooth Mesh example

Posted 2017-09-19 12:08:11 by Kristian Skordal
• ### Using millis() like in Arduino.

Posted 2017-09-18 11:58:04 by schef
• ### Flashing nRF5x firmware using any dumb terminal program via standard serial COM port

Posted 2017-09-18 03:53:40 by Nguyen Hoan Hoang
• ### How to Debug the nRF52 Interrupts — Useful Tips

Posted 2017-09-13 15:15:22 by Yaniv Nis

## Recent questions

• ### GPIO port input in low power mode

Posted 2017-09-24 20:25:18 by michael
• ### Any nRF52840 examples for BLE Mesh?

Posted 2017-09-24 17:06:24 by aszka
• ### Can not find Nordic dongle from my application

Posted 2017-09-24 14:23:37 by ofer
• ### Can’t program BT832 Module using NRF52-DK

Posted 2017-09-24 10:47:56 by Alexey
• ### Is there any Dc offset on nRF52840 RF port ?

Posted 2017-09-24 09:43:40 by Artak