soburi / openthread_nrf52_arduino

A Arduino package for nRF52 that integrated with OpenThread
Other
18 stars 3 forks source link

[Feature] Support PlatformIO #6

Open soburi opened 5 years ago

soburi commented 5 years ago

It maybe need to create new repository.

Even if so, this package's build system are complex to support PlatformIO. Simplify the build system (#4) to help to creating PlatformIO package.

geeksville commented 4 years ago

Hi @soburi I might be able to help with this - I have ported a different arduino emulation lib (for linux) to build and work properly in platformio as a 'first class - standard arduino' target. If I use your project I would be willing to do the glue needed and send in a PR.

Am I correct that this project isn't just a "openthread" project but also a "port of arduino to run on top of a nrf52 with soft device"? It seems like your soft device is already 7.0.2 which is new enough to work with new processor needs (nrf52833). Previously we were using ESP32s and NRF52840. For the nrf52 I've been using the adafruit-nrf52-arduino project, but that project is still using soft device 6.1.1 - so I either need to update that project or switch to a different arduino port. Would you recommend using your project in this application?

soburi commented 4 years ago

HI @geeksville

Sorry for the delayed response. (I was a bit busy recently week.)

If I use your project I would be willing to do the glue needed and send in a PR.

Ok. Any PR is welcoming!

Am I correct that this project isn't just a "openthread" project but also a "port of arduino to run on top of a nrf52 with soft device"?

Yes. This project depends on Thread and Zigbee SDK and The SDK use SoftDevice. Thus, this project is worked on SoftDevice.

Would you recommend using your project in this application?

I think this project is not even matured.

There are a few things to keep in mind when using this project.

It basically uses code base original 'Adafruit_nRF52_Arduino'. The significant change is this project is using SoftDevice. It is make modifing to 'bluefruit.cpp' and 'Adafruit_TinyUSB_nRF.cpp'. And 'IPAddress' class is modified and depends on openthread's IPaddress representation. It may cause some problems. I think it is better to revert to original source if not use openthread.

geeksville commented 4 years ago

Thanks for your reply . alas - since I opened this I went and fixed my immediate root problem (updating nrf52 arduino to run with soft device 7.2) So I think I'll be staying with adafruit nrf52 for now (and I'll send them a PR)

leojrfs commented 2 years ago

Hello all!

Ive made some hacky changes so this project can be built with platformio:

So in theory should be easy to integrate with platformio.

I managed to build but after flashing it doesnt seem to go past the bootloader.

take the following example in src/main.app:

#include <Arduino.h>
// seems to need this header or else it errors out with undefined references
#include "Adafruit_TinyUSB.h"

void setup()
{
    pinMode(LED_BUILTIN, OUTPUT);
    pinMode(PIN_LED2, OUTPUT);
}

void loop()
{
    digitalWrite(LED_BUILTIN, HIGH);
    digitalWrite(PIN_LED2, LOW);
    delay(250);
    digitalWrite(LED_BUILTIN, LOW); 
    digitalWrite(PIN_LED2, HIGH);
    delay(250);
}

If one uses the original adafruit arduino core, this example works correctly:

The same procedure for this core doesn't work, it seems to get stuck in the bootloader (with LED1 flashing):

any hints?