0

Cannot program Flora BLE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Cannot program Flora BLE

by abhivm on Mon Apr 19, 2021 3:07 pm

Hi,
I am having trouble figuring out what program to use to work with the Flora BLE. I installed the library Adafruit_BluefruitLE_nRF51.
From there, ran the following programs
1. factoryreset: generates error "Couldn't factory reset"
2. bleuart_cmdmode.ino: generates error "Couldn't factory reset"
BLE is in CMD mode.
Followed instructions from this page https://learn.adafruit.com/adafruit-flo ... ample-code

factoryreset.ino (from examples)
Code: Select all | TOGGLE FULL SIZE
#include <Arduino.h>
#include <SPI.h>
#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"
#include "Adafruit_BluefruitLE_UART.h"

#include "BluefruitConfig.h"

#if SOFTWARE_SERIAL_AVAILABLE
  #include <SoftwareSerial.h>
#endif

/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
 Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

// A small helper
void error(const __FlashStringHelper*err) {
  Serial.println(err);
  while (1);
}

void setup(void)
{
  while (!Serial);  // required for Flora & Micro
  delay(500);

  Serial.begin(115200);
  Serial.println(F("Adafruit Factory Reset Example"));
  Serial.println(F("------------------------------------------------"));

  /* Initialise the module */
  Serial.print(F("Initialising the Bluefruit LE module: "));

  if ( !ble.begin(VERBOSE_MODE) )
  {
    error(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
  }
  Serial.println( F("OK!") );

  /* Perform a factory reset to make sure everything is in a known state */
  Serial.println(F("Performing a factory reset: "));
  if (! ble.factoryReset() ){
       error(F("Couldn't factory reset"));
  }
Serial.println("Requesting Bluefruit info:");
  /* Print Bluefruit information */
  ble.info();

  Serial.println(F("DONE!"));
}

void loop(void)
{
}


Bluefruitconfig.h has
Code: Select all | TOGGLE FULL SIZE
#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif



What is the correct configuration to communicate with BLE from Flora?
Most of the samples available a

My configuration:
- Windows 10
- Arduino IDE 2.0.0-beta 5
- Verified connections to be correct. I will add the connections image in reply (running out of space)


-
2021-04-19 14_44_58-Window.png
2021-04-19 14_44_58-Window.png (22.85 KiB) Viewed 129 times
- Board info from IDE


-
2021-04-19 14_46_11-Window.png
2021-04-19 14_46_11-Window.png (16.48 KiB) Viewed 129 times
- Windows detects Flora


-
Screenshot_20210419-144818.png
Bluefruit Connect App - BLE info
Screenshot_20210419-144818.png (231.68 KiB) Viewed 129 times
- Bluefruit Connect App. Connected to BLE and displays BLE info.


BLE is running the latest firmware available

Thank you
Abhi

abhivm
 
Posts: 2
Joined: Sun Apr 18, 2021 2:56 pm

Re: Cannot program Flora BLE

by abhivm on Mon Apr 19, 2021 3:09 pm

Flora connections
Flora-connections2.jpg
Flora-connections2.jpg (31.38 KiB) Viewed 128 times

abhivm
 
Posts: 2
Joined: Sun Apr 18, 2021 2:56 pm

Please be positive and constructive with your questions and comments.