1

I'm fairly new to ARM development but have done some work with Arduino Nanos in the past. So I working on a team that does a lot of device prototyping with some devices eventually getting commercialized. The lead engineer writes to an nRF52840 chip using Eclipse.

I want to be able to do the board development on some projects and have been struggling with IDE's such as Eclipse and Keil. But would be very comfortable in Arduino. I noticed that that Arduino 33 BLE has the same chip we like to use in our projects.

The question I had is would it be possible to me to program the 33 BLE in the Arduino IDE then convert the code to be writable to the nRF in Eclipse. I understand that they are both in C++ but I don't know how the Arduino libraries and such would transfer.

Don Wilson
  • 21
  • 4
  • Since they are the same chip then in theory any code you write that runs on the Arduino 33 BLE can run on the nRF52840 assuming it is flashed with the appropriate Arduino bootloader. The real issue here is a hardware one. Commercial Arduino boards come pre-flashed with a bootloader and Serial->USB interface which allows you to program it directly from your computer. A stock nRF52840 does not have this hardware so it has to be programmed with a dedicated programming module. This is the only difference between the two systems. At the end of the day the nRF52840 is just another ARM. – elliptic_hyperboloid Jul 10 '20 at 16:33
  • the nRF SDK is C. Arduino Nano 33 BLE Arduino core wrapps mbed os. mbed is C++ and uses the SDK. https://os.mbed.com/ Arduino to mbed would go. to lower level it would be basically a rewrite – Juraj Jul 10 '20 at 16:35
  • So the nRF will have a serial USB interface still when it's on the PCB. So you're saying that I should be able to just flash the Arduino bootloader on it and it could work? – Don Wilson Jul 10 '20 at 16:56
  • the nRF52840 has native USB, so it will be there, but why would you flash Arduino bootloader with a programmer if you can flash your firmware with the programmer? – Juraj Jul 10 '20 at 18:01
  • @Juraj is correct, it has a built-in serial USB interface, but to program directly from the Arduino IDE you will still need a bootloader. Sparkfun has a generic [guide on flashing a bootloader](https://learn.sparkfun.com/tutorials/arm-programming/all) for ARM processors. However to do this requires a dedicated programmer anyway, so you have to ask yourself at that point why not just learn to program it in C natively and do away with the Arduino stuff. – elliptic_hyperboloid Jul 10 '20 at 18:08
  • @elliptic_hyperboloid, you can upload Arduino sketch over the programmer too – Juraj Jul 10 '20 at 19:35

1 Answers1

0

There is a very mature nRF5 Arduino Core developed by github.com/sandeepmistry

You must be able to use this core to write code for nRF5 chipset using Arduino Framework. Then once you have the binary after the cross-compilation, you can program nRF5 chipset directly using the tool provided by Nordic Semiconductors named nRFgo Studio.

You will be needing programmer/debugger like J-link to program the chipset with the generated binary. You won't need Serial bootloader to flash nRF chip with J-link.

There are few important things to note. Nordic provides BLE stack as a SoftDevice, in a binary format, which also needs to programmed to specific flash region on the chipset. nRFgo Studio have the option to program the SoftDevice as well. You just have to program the SoftDevice before you flash your application binary.

I get from your question that you meant to ask how can you program the application code written in Arduino Framework to nRF chipset directly instead of Arduino Dev Board like Nano 33 BLE. So I answered in light of this understanding of your question.

hmxmghl
  • 94
  • 6