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

• ### Introducing nRF5 SDK for Mesh

Posted 2017-07-20 09:42:44 by Pär H

Posted 2017-07-19 06:53:42 by Mohammad Afaneh
• ### Unique Thread/Bluetooth multiprotocol solution with nRF5 SDK for Thread and nRF52840 SoC by Nordic

Posted 2017-07-14 10:31:56 by Krzysztof Loska
• ### nRF Connect macros (currently Android only)

Posted 2017-07-14 13:29:14 by Aleksander Nowakowski
• ### Power Optimization — From 3 to 7 Months on a Single Charge

Posted 2017-07-10 14:34:39 by Yaniv Nis

## Recent questions

• ### openocd configuration file nrf51.cfg not working

Posted 2017-07-22 18:40:18 by phob
• ### Problems with UART running ble_app_uart_c on nRF52832

Posted 2017-07-22 17:44:12 by kont40
• ### Wake-up source with nRF52 capacitive touch and current consumption

Posted 2017-07-22 17:35:46 by MANGO
• ### Different master instances for two slaves in nrf51422

Posted 2017-07-22 12:48:29 by Khan
• ### Receiving notifications from Android Phone

Posted 2017-07-22 12:29:52 by kian79