Holyiot 1705 NRF51822 board

Hello

I am struggling to add the HolyIOT board NRF51822 (Generic NRF51) to Platformio. I want to use it with MySensors and the instructions say to install the following board in Arduino IDE board manager

This is the board (for about 2 USD) [Aliexpress NRF51822]

I tried using the various available boards but I am not getting anywhere. Any pointers will be quite helpful.
I only want to create the .hex output file from PIO and then use RPI as an OpenOCD programmer to flash these boards.
Thank you

Which ones have you tried exactly? What code have you tried? Was programming successful?

Hello
Thank you for replying to my post. :slightly_smiling_face:

For instance I am using following platformIO & main.cpp

It is a simple repeater sketch and yes it compiles to generate a .hex file.
But I am supposed to use the MySensorNRF board and Nordic NRF libraries like I am doing in ArduinoIDE right?

Also, this is not the correct board, I need the Generic Board which gets generated through the two libraries I added in initial post
And then as per instructions I am supposed to have the two files included in the sketch
MyBoardNRF5.cpp
MyBoardNRF5.h

platform = nordicnrf51
board = nrf51_dk
framework = arduino
lib_deps =
  # RECOMMENDED
  # Accept new functionality in a backwards compatible manner and patches
  mysensors/MySensors @ ^2.3.2

and main.cpp as

#include <Arduino.h>
#define MY_DEBUG
#define MY_RADIO_NRF5_ESB
#define MY_REPEATER_FEATURE

#include <MySensors.h>
void setup() {
  // put your setup code here, to run once:
}
void presentation()
{
  //Send the sensor node sketch version information to the gateway
	sendSketchInfo("Repeater Node", "1.0");
}
void loop() {
  // put your main code here, to run repeatedly:
}

I see. Well the way I read it the repo you’ve linked points to GitHub - mysensors/ArduinoHwNRF5: Arduino hardware definitions for nRF5 platform for the nRF5 stuff and expands the sandeepmistry/nRF5 core by a few board definitions.

That should be easily repricable in PlatformIO since that nrF5 core is supported there and we can create new board definitions (on e.g. the base of existing ones). Let me come up with something quickly…

EDIT: I’ve done a first try at integration but failed due to using a too-new release of the nRF5 core for those additions… Need to rebase the version.

However, for further stability and support I’d suggest that you pick one of the “mainline” nRF5 boards that work for your board – if there is no output or unexpected behavior we can still look into why these occurr (due to wrong clock configuration or whatever). But then you have the security of using a PlatformIO-known board supported and updated in further Arduino core releases.

1 Like

So, some progress. I have been able to make the “Repeater Node” work which is not using any pin definitions.
I added board_build.variant = generic to the platformio.ini

[env:nrf51_dk]
platform = nordicnrf51
board = nrf51_dk
framework = arduino
board_build.variant = generic
lib_deps =
  # RECOMMENDED
  # Accept new functionality in a backwards compatible manner and patches
  mysensors/MySensors @ ^2.3.2

Now I will connect some input / output actuators/sensors to check if the pin definition are required.

I agree with you on the “mainline boards” to have continuity for future.

I will reply back with my tests.
Thank you.

Hello

The GPIOs are working as expected. I will mark this thread as solved.

1 Like

For someone visiting this in future - pins from Sandeep Mistry’s implementation in MySensors is different than what’s available on PlatformIO.

So, here it is

SCL - P0.20
SDA - P0.21
RX - P0.00
TX- P0.01