"Seeed nRF52 Boards" update to 1.1.3 causes compile error

To avoid copying errors, please try the following steps

  1. Install “Adafruit nRF52 1.4.0 by Adafruit”.
    See the following link for instructions
    GitHub - adafruit/Adafruit_nRF52_Arduino: Adafruit code for the Nordic nRF52 BLE SoC on Arduino

  2. Unzip the attached ZIP file.
    adafruit_patch_to_add_Seeed_2.zip (992.5 KB)

  3. Copy 3 folders and 2 files and overwrite them in the following directory.
    C:\Users\xxxxxxxx\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0

This method does not require “Seeed nRF52 Boards 1.1.3”.

will try new rar again, thank you!

how to double reset? will it help program firmware?

Quickly click the reset button twice. If you can successfully “double reset”, a new window will open and the port will be visible in the IDE.

@msfujino, thanks for you tip. I used your zip patch instead of the initial rar one. And it is working. My board is blinking. :rofl:

double tapping reset button brought me to UF2 mode or something, installed driver, uplaodded blink code yay it blinking lol and it changed serial to another unknown driver lol but at least it blinks tnx for help
will try updating driver and see if i can flash again lol

Has anyone got this running in platformio? also any examples that work!

thanks

david

Hi There,
Yes platformio works with Xiao if that’s what your asking. Example are here on the Search Icon. LOTs of them. I use it mostly for debugger but it woks perfectly. Getting the right config(platform.ini) setup correctly is key to a smooth experience. i.e.

HTH
GL :slight_smile:

I just faced this problem as well, downgrading to 1.1.1 works for me. I’ll be using 1.1.1 at least until the fix is there in a higher version.

After upgrade of “Adafruit nRF52” boards to 1.5.0, seeed entries in the Adafruit nRF52 boards, as obtained with the earlier trick, were gone. So, I used again the official way to install it but stand with 1.1.1 version, as done by @parasquid . It is more or less OK. I’m still loosing the board quite often and have to double-click the reset button to find it back.

1 Like

Same here, I wish there would be more activity on fixing it.
Another thing to have would be github issues open. Maybe someone would contribute?

This issue might be related to Cannot run sketch from Arduino IDE - adafruit industries, version 1.1.3 is also few versions behind adafruit branch

There is version 1.1.6, but it installs adafruit-nrfutil as not executable. It would be nice @Seeed_Seraphina, if the GitHub repo would be open to issues. The community could fix some errors.

Hello, Nilgob:

What do you mean by “not executable”? Can you describe in detail

Thank you very much for your feedback. We highly appreciate it and will actively communicate it upwards.

In the path Arduino15/packages/Seeeduino/hardware/nrf52/1.1.6/tools/adafruit-nrfutil

doesn’t have executable permissions. Had to edit chmod +x adafruit-nrfutil

1 Like

I just bought my first Seeed Studio product and after this first attempt, I am regretting the choice of product I made. It’s been over a year and still no fix.

I just bought my first Seeed Studio product and after this first attempt, I am regretting the choice of product I made. It’s been over a year this issue has been outstanding and still no fix.

This “topic” has not been solved. It has just been bandaid patched.
I’ll be happy to add my experience in other Arduino related boards.

Hi there,
So what exactly is it you can’t do?
Compile code, Read the battery, There have been many updates too?
LMK
GL :slight_smile: PJ
:v:

You have a specific code that you can post that won’t compile or run?

Seeed XIAO nRF522840 (not sense)
Seeed XIAO nRF52 library: 1.1.8 (not embed)
ArduinoBLE Library: 1.3.7

#include <ArduinoBLE.h>
 
BLEService LEDService("19b10000-e8f2-537e-4f6c-d104768a1214"); // Service UUID
BLEIntCharacteristic redCharacteristic("19b10001-e8f2-537e-4f6c-d104768a1214", BLERead | BLEWrite | BLENotify);
BLEIntCharacteristic greenCharacteristic("19b10002-e8f2-537e-4f6c-d104768a1214", BLERead | BLEWrite | BLENotify);
BLEIntCharacteristic blueCharacteristic("19b10003-e8f2-537e-4f6c-d104768a1214", BLERead | BLEWrite | BLENotify);
 

const int redPIN = LED_RED;                                        // pin to use for the red LED (D11)
const int greenPIN = LED_GREEN;                                      // pin to use for the green LED (D12)
const int bluePIN = LED_BLUE;                                       // pin to use for the blue LED (D13)

void setup() {
 
  pinMode(redPIN, OUTPUT);                                      //set pins as outputs and set LED's HIGH (HIGH is off for this board)
  digitalWrite(redPIN, HIGH);
  pinMode(greenPIN, OUTPUT);
  digitalWrite(greenPIN, HIGH);
  pinMode(bluePIN, OUTPUT);
  digitalWrite(bluePIN, HIGH);
  
  if (!BLE.begin()) {                                           // begin initialization
    while (1);                                                  // wait until initialization complete
  }
 
  BLE.setLocalName("BLE_RGB");                                  // set advertised local name
  BLE.setAdvertisedService(LEDService);                         // set advertised service UUID
  LEDService.addCharacteristic(redCharacteristic);              // add the red characteristic to the service
  LEDService.addCharacteristic(greenCharacteristic);            // add the green characteristic to the service
  LEDService.addCharacteristic(blueCharacteristic);             // add the blue characteristic to the service
  BLE.addService(LEDService);                                   // add service
  BLE.advertise();                                              // start advertising
}
 
void loop() {
  BLEDevice central = BLE.central();                            // listen for BLE devices to connect:
 
  if (central) {                                                // if a central is connected to peripheral:

                                                                // put code here to preform 1 time when device is connected
                                                                
    while (central.connected()) {                               // while the central is still connected to peripheral
                                                                // if there is an update from Android App, change light ON (0) or OFF (1) 
      if (redCharacteristic.written()) digitalWrite(redPIN, redCharacteristic.value());
      if (greenCharacteristic.written()) digitalWrite(greenPIN, greenCharacteristic.value());
      if (blueCharacteristic.written()) digitalWrite(bluePIN, blueCharacteristic.value());   
    }
    
  }                                                             //end of while loop
                                                                // you can put code here for what to do when not connected
}                                                               // end of loop

If you use Seeed nRF52 mbed-enabled Boards 2.9.2 for BSP, you can compile it without any problem.
ArduinoBLE is not available for BSP Seeed nRF52 Boards 1.1.8. Use bluefruit.h included in the BSP 1.1.8 instead.

1 Like

Hi there,
@msfujino gave you the straight answer.
and So I will add, there is a WiKi , or post somewhere that has a write up of the differences and why you have to use certain BSP’s to have access to parts of the capabilities. FWIW when I tested the original combo, the errors were in ArduinBLE. So there’s that, and they don’t maintain it.

here is the output from a good compile. with versions 2.9.2 & 1.37, BSP & ArduinoBLE respectively.

FQBN: Seeeduino:mbed:xiaonRF52840
Using board 'xiaonRF52840' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.2
Using core 'arduino' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.2
____EDIT_for _brevity___

Using library ArduinoBLE at version 1.3.7 in folder: D:\Arduino_projects\libraries\ArduinoBLE 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\E65CCFF477B430C3FE36F3A3F280BDAE/sketch_oct6a.ino.elf"
Sketch uses 321016 bytes (39%) of program storage space. Maximum is 811008 bytes.
Global variables use 69688 bytes (29%) of dynamic memory, leaving 167880 bytes for local variables. Maximum is 237568 bytes.

I tried your code with the Bluefruit it appears to work the same.

#include <bluefruit.h>

// Define BLE services and characteristics
BLEService ledService = BLEService("19b10000-e8f2-537e-4f6c-d104768a1214");

BLECharacteristic redCharacteristic = BLECharacteristic("19b10001-e8f2-537e-4f6c-d104768a1214");
BLECharacteristic greenCharacteristic = BLECharacteristic("19b10002-e8f2-537e-4f6c-d104768a1214");
BLECharacteristic blueCharacteristic = BLECharacteristic("19b10003-e8f2-537e-4f6c-d104768a1214");

const int redPIN = LED_RED;    // pin to use for the red LED (D11)
const int greenPIN = LED_GREEN; // pin to use for the green LED (D12)
const int bluePIN = LED_BLUE;   // pin to use for the blue LED (D13)

uint8_t prevRedValue = 0;
uint8_t prevGreenValue = 0;
uint8_t prevBlueValue = 0;

void setup() {
  Serial.begin(115200);

  pinMode(redPIN, OUTPUT);   // Set pins as outputs and set LED's HIGH (HIGH is off for this board)
  digitalWrite(redPIN, HIGH);
  pinMode(greenPIN, OUTPUT);
  digitalWrite(greenPIN, HIGH);
  pinMode(bluePIN, OUTPUT);
  digitalWrite(bluePIN, HIGH);

  // Initialize Bluefruit
  Bluefruit.begin();
  Bluefruit.setTxPower(4);   // Check the max power for your module and use accordingly
  Bluefruit.setName("BLE_RGB");

  // Setup the BLE LED service and characteristics
  ledService.begin();

  redCharacteristic.setProperties(CHR_PROPS_READ | CHR_PROPS_WRITE | CHR_PROPS_NOTIFY);
  redCharacteristic.setPermission(SECMODE_OPEN, SECMODE_OPEN);
  redCharacteristic.setFixedLen(1);
  redCharacteristic.begin();

  greenCharacteristic.setProperties(CHR_PROPS_READ | CHR_PROPS_WRITE | CHR_PROPS_NOTIFY);
  greenCharacteristic.setPermission(SECMODE_OPEN, SECMODE_OPEN);
  greenCharacteristic.setFixedLen(1);
  greenCharacteristic.begin();

  blueCharacteristic.setProperties(CHR_PROPS_READ | CHR_PROPS_WRITE | CHR_PROPS_NOTIFY);
  blueCharacteristic.setPermission(SECMODE_OPEN, SECMODE_OPEN);
  blueCharacteristic.setFixedLen(1);
  blueCharacteristic.begin();

  // Start advertising
  Bluefruit.Advertising.addService(ledService);
  Bluefruit.Advertising.start();
}

void loop() {
  uint8_t redValue = redCharacteristic.read8();
  uint8_t greenValue = greenCharacteristic.read8();
  uint8_t blueValue = blueCharacteristic.read8();

  // Check for changes in characteristic values and update LEDs accordingly
  if (redValue != prevRedValue) {
    digitalWrite(redPIN, redValue);  // Update red LED
    prevRedValue = redValue;
  }

  if (greenValue != prevGreenValue) {
    digitalWrite(greenPIN, greenValue);  // Update green LED
    prevGreenValue = greenValue;
  }

  if (blueValue != prevBlueValue) {
    digitalWrite(bluePIN, blueValue);  // Update blue LED
    prevBlueValue = blueValue;
  }

  delay(100);  // Optional delay to avoid too frequent updates
}

compiler output of successful build

FQBN: Seeeduino:nrf52:xiaonRF52840
Using board 'xiaonRF52840' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8
Using core 'nRF5' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8
---- EDIT for Brevity____
Using library Adafruit Bluefruit nRF52 Libraries at version 0.21.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib 
Using library Adafruit nRFCrypto at version 0.0.5 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_nRFCrypto 
Using library Adafruit TinyUSB Library at version 1.7.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_TinyUSB_Arduino 
Using library Adafruit Little File System Libraries at version 0.11.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS 
Using library Adafruit Internal File System on Bluefruit nRF52 at version 0.11.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\InternalFileSytem 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\E65CCFF477B430C3FE36F3A3F280BDAE/sketch_oct6a.ino.elf"
Sketch uses 115600 bytes (14%) of program storage space. Maximum is 811008 bytes.
Global variables use 14024 bytes (5%) of dynamic memory, leaving 223544 bytes for local variables. Maximum is 237568 bytes.

Changes:

  1. Removed valueUpdated() and replaced it with the read8() function to get the current value of each characteristic.
  2. Added variables (prevRedValue, prevGreenValue, prevBlueValue) to store previous values and compare them with the current value.
  3. LEDs are updated only if the characteristic value changes.

I hope that helps you get some understanding, Problems are just Opportunities’ with a different POV
GL :slight_smile: PJ :v:

Probably use less power as well , hands down the Non-mbed has on that stat. :+1: