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

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

• ### Estudando Projetos do SDK 10 para nRF5x com Eclipse Oxygen (Portuguese)

Posted 2017-11-12 00:08:55 by Carlos Delfino
• ### Configurando o Eclipse Oxygen para Desenvolvimento com nRF5x (Portuguese)

Posted 2017-11-10 21:15:47 by Carlos Delfino
• ### How to use Git for embedded software development

Posted 2017-11-06 13:21:55 by Yaniv Nis
• ### Thingy:52 based Weather Station

Posted 2017-10-29 22:31:15 by Krzysztof Szewczyk
• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis

## Recent questions

• ### HardFault_Handler when I use WDT

Posted 2017-11-20 10:00:57 by abosch
• ### Communication between pca10040 and another device using UART

Posted 2017-11-20 09:55:59 by lirank
• ### How to access the RAM of nrf52832

Posted 2017-11-20 09:42:04 by 执剑写春秋
• ### Job Offer: nRF / Embedded Developer in Stuttgart, Germany

Posted 2017-11-20 09:40:23 by Marius Heil
• ### IS BLE MESH SUPPORT ARDUINO PRIMO CORE?

Posted 2017-11-20 08:07:17 by rajeshkumar