Giter Site home page Giter Site logo

h2zero / n-able-arduino Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 14.0 1.5 MB

An arduino core for ARM based BLE devices supported by the NimBLE stack.

License: GNU Lesser General Public License v2.1

C 97.06% C++ 2.18% Makefile 0.08% Assembly 0.66% Batchfile 0.01% Shell 0.01%
ble arduino bluetooth-low-energy nimble nrf51 nrf52 nrf5x platformio

n-able-arduino's Introduction

n-able Arduino core

An Arduino Core for ARM based BLE boards supported by the NimBLE stack.

If you are interested in assisting the development of this project please submit issues and PR's. Or become a collaborator!

Features

  • Fully supports the NimBLE-Arduino library on Arm based BLE devices (only Nordic mcu's for now)
  • No softdevice, NimBLE provides a complete BLE stack.
  • Contains a subset of the EEPROM library to support basic config storage in flash.
  • Supports printf and Serial.printf
  • Uses/includes FreeRTOS.
  • Designed to maximize battery life using tickless idle. This allows the MCU to sleep any time delay is called.
  • Custom configuration of FreeRTOS and NimBLE compile options supported by providing a build_opt.h file in your sketch.

Why?

I wanted to have a consistent BLE API on all of the devices I work with. NimBLE is the best choice for this as it is the most feature complete and fully open source library available for Arduino.

BLE

This Arduino Core does not contain any BLE functionality. It has been designed to support using the NimBLE-Arduino library for BLE operation. Note: Only the release version 1.4.0 and above of NimBLE-Arduino supports Arm devices.

Supported boards

nRF52840

nRF52833

nRF52832

nRF52810

nRF51

Installing

Platformio

  1. Install PlatformIO
  2. Create PlatformIO project and configure a platform option in platformio.ini file:
[env]
platform = https://github.com/h2zero/platform-n-able.git@^1.0.0
framework = arduino
lib_deps = h2zero/NimBLE-Arduino@^1.4.0
board = ...
...

Arduino Board Manager

  1. Download and install the Arduino IDE (At least v1.6.12)
  2. Start the Arduino IDE
  3. Go into Preferences
  4. Add https://h2zero.github.io/n-able-Arduino/package_n-able_boards_index.json as an "Additional Board Manager URL"
  5. Open the Boards Manager from the Tools -> Board menu and install "Arm BLE Boards"
  6. Select your board from the Tools -> Board menu

From git (for core development)

  1. Follow steps from Board Manager section above
  2. cd <SKETCHBOOK>, where <SKETCHBOOK> is your Arduino Sketch folder:
  • OS X: ~/Documents/Arduino
  • Linux: ~/Arduino
  • Windows: ~/Documents/Arduino
  1. Create a folder named hardware, if it does not exist, and change directories to it
  2. Clone this repo: git clone https://github.com/h2zero/n-able-Arduino.git
  3. Restart the Arduino IDE

Install NimBLE-Arduino

  1. Arduino Library manager: Go to sketch -> Include Library -> Manage Libraries, search for NimBLE and install version 1.4.0 or greater.
  2. Add #include "NimBLEDevice.h" at the beginning of your sketch.

Flashing your device

  1. Select your board from the Tools -> Board menu
  2. Select any options you want
  3. Select a programmer (J-Link, ST-Link V2, CMSIS-DAP, Black Magic Probe, adafruit-nrfutil or nrfutil) from the Tools -> "Programmer: " menu
  4. Connect your programmer to the device and click Upload

Uploading via Segger J-Link

  1. Make sure you have Segger J-Link installed on your system.
  2. (For Windows) add the JLink.exe path to your environment variables.
  3. Select J-Link as the firmware uploader in the tools menu.

Uploading via adafruit-nrfutil (for Adafruit bootloader devices only)

  1. Install adafruit-nrfutil if not already installed pip install adafruit-nrfutil
  2. Select adafruit-nrfutil as the firmware uploader in the tools menu.

Uploading via (Nordic) nrfutil (for Nordic bootloader devices only)

  1. Install nrfutil if not already installed pip install nrfutil
  2. Select nrfutil as the firmware uploader in the tools menu.

Configuration (optional)

You can change the configuration for many settings by creating a build_opt.h file in your sketch folder. In here you can set compile time definitions for settings that will be included directly on the command line. For example: '-DCONFIG_MAIN_TASK_STACK_SIZE=512' This will set the main task stack size to 512 words (2048 bytes).

Configuration option list

  • CONFIG_MAIN_TASK_STACK_SIZE - sets the size in 32bit words of the main loop task.
  • CONFIG_RTOS_TICK_RATE_HZ - set the tick rate for FreeRTOS (default 1024).
  • CONFIG_RTOS_MAX_PRIORITIES - set the maximum priority level for FreeRTOS tasks.
  • CONFIG_RTOS_MIN_TASK_STACK_SIZE - set the minimum task stack size.
  • CONFIG_RTOS_TIMER_QUEUE_LENGTH - set the queue size for the FreeRTOS timers.
  • CONFIG_RTOS_TIMER_STACK_DEPTH - set the timer task stack size in 32bit words.
  • CONFIG_WDT_TIMEOUT_SECONDS - set the number of seconds before the watchdog times out (0 = disable watchdog, default = 0).
  • Nimble configuration options can also be included, the list of those can be found here
  • Other compiler options or definitions for other libraries can also be specified.

API

There are a few useful functions available to help with your project.

RTOS class functions

  • uint32_t RTOS.getMainTaskHwm(); - Returns the high water mark of the Main task stack in 32bit words.
  • uint32_t RTOS.getIsrStackHwm(); - Returns the high water mark of the ISR stack in 32bit words.
  • uint32_t RTOS.getIdleTaskHwm(); - Returns the high water mark of the Idle task stack in 32bit words.
  • uint32_t RTOS.getTimerTaskHwm() - Returns the high water mark of the Timer task stack in 32bit words.
  • uint32_t RTOS.getBleHostTaskHwm(); - Returns the high water mark of the NimBLE Host task stack in 32bit words.
  • uint32_t RTOS.getBleLLTaskHwm() - Returns the high water mark of the NimBLE Link Layer task stack in 32bit words.
  • uint32_t RTOS.getFreeHeap(); - Returns the currently free heap size in bytes.

General system functions

  • uint32_t getResetReason(); - Returns the reset reason for the last boot.
  • void systemPowerOff(); - Shuts down the MCU.
  • void systemRestart(); - Reboot.

Bootloader

Currently only some boards have Adafruit bootloaders available which are provided as options. You may choose to use the bootloader or none. The provided Adafruit bootloaders have no softdevice, if you currently are using the softdevice based Adafruit bootloader on your nRF52 board you will need to update it to the one provided by selecting it from the boards menu and clicking Burn Bootloader.

For boards without the Adafruit bootloader option clicking Burn Bootloader will simply erase the flash memory on the device. This is required if you have any bootloader flashed already.

Important notes

  • The last four pages of flash, before the bootloader (if applicable) are reserved for user storage and bond information storage (2 pages each).
  • Careful attention should be paid to selecting the correct bootloader (tools->Bootloader Type) for your build (if applicable) to ensure the correct linkage.

Credits

This core is based on Arduino-nRF5 by Sandeep Mistry, which is based on the Arduino SAMD Core. With some code from Adafruit_nRF52_Arduino

The following libraries are used:

n-able-arduino's People

Contributors

h2zero avatar jhmaloney avatar krzysiekkajot avatar positron96 avatar vshymanskyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

n-able-arduino's Issues

Error. Board type requires board_bootloader to be specified

I tried to build for feather ntf52832 with the following configuration but cannot build.

[env:n-able]
platform = https://github.com/h2zero/platform-n-able.git
framework = arduino
board = adafruit_feather_nrf52832

Logs

Processing n-able (platform: https://github.com/h2zero/platform-n-able.git; framework: arduino; board: adafruit_feather_nrf52832)
---------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/n-able/adafruit_feather_nrf52832.html
PLATFORM: n-able (1.0.0+sha.79f9fef) > Adafruit Bluefruit nRF52832 Feather
HARDWARE: NRF52832_XXAA 64MHz, 64KB RAM, 496KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-n-able-arduino @ 0.1.0+sha.a6263a7 
 - tool-adafruit-nrfutil @ 1.503.0 (5.3) 
 - tool-sreccat @ 1.164.0 (1.64) 
 - toolchain-gccarmnoneeabi @ 1.90301.200702 (9.3.1)
Error. Board type requires board_bootloader to be specified
====================================== [FAILED] Took 0.73 seconds

Is there any idea to resolve the error?

Cannot upload using Black Magic

Hello, I'm able to build and upload zephyr based platformio project via BlackMagic. I was trying your stack for BLE developing. Everything seems to work as configuration and build but when I try to upload I got:

Configuring upload protocol...
AVAILABLE: adafruit-nrfutil, blackmagic, cmsis-dap, jlink, nrfjprog, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Auto-detected: /dev/cu.usbmodem79A67BCB1
Uploading .pio/build/adafruit_feather_nrf52840/firmware.hex
monitor swdp_scan: No such file or directory.
"/Users/azlekov/Documents/PlatformIO/Projects/dodi-noise-c/.pio/build/adafruit_feather_nrf52840/firmware.elf" is not a core dump: file format not recognized
Undefined command: "-ex".  Try "help".
Don't know how to attach.  Try "help target".
No executable file specified.
Use the "file" or "exec-file" command.
command cannot be used without an exec file
The program is not being run.
*** [upload] Error 1

The board is Adafruit Feather nrf52480 Express

Any ideas?

Feather Sense (nRF52840): Flashing the bootloader

Hi,

I'm currently struggling to burn the provided Adafruit bootloader to a Feather Sense (nRF52840).
Following the instructions and selecting Burn Bootloader from the Tools menu results in the following error:

xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2022-03-25-17:32)
Error while burning bootloader.
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0

embedded:startup.tcl:26: Error: Can't find interface/.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 26

The programmer is set to adafruit-nrfutil and the device is connected via USB.
Is there an option to burn your provided bootloader without using special programmer hardware?
For instance, something such as Adafruit's Bootloader DFU for Bluefruit nRF52 programmer?

I'm currently using the Adafruit Softdevice enabled bootloader v0.7.0 and am therefore unable to upload sketches without soft-bricking the board.

nrfx_rng driver

Board: generic_nrf52840

This is a dumb question. How do I enable the RNG driver (cores/nRF5/nordic/nrfx/drivers/include/nrfx_rng.h)? I have included the driver in my source file. I have added -DNRFX_RNG_ENABLED to the build_flags in my platformio.ini

Building results in undefined reference to nrfx_rng_init and undefined reference to nrfx_rng_uninit

My current code:

bool rngGenerated = false;
uint8_t rngNumber;

void rngEventHandler(uint8_t randomNumber)
{
  rngGenerated = true;
  rngNumber = randomNumber;
}

void generateRandomNumber(uint8_t *dataBuffer, uint8_t bytesToGenerate)
{
  uint8_t numbersGenerated = 0;
  nrfx_rng_config_t config = NRFX_RNG_DEFAULT_CONFIG;
  nrfx_rng_evt_handler_t eventHandler = &rngEventHandler;
  nrfx_rng_init(&config, eventHandler);

  while (numbersGenerated < bytesToGenerate)
  {
    if (rngGenerated)
    {
      dataBuffer[numbersGenerated] = rngNumber;
      rngGenerated = false;
      numbersGenerated++;
    }
    delay(1);
  }
  nrfx_rng_uninit();
}

Any help would be much appreciated :)

Need help with deep sleep NRF51822 board

Hello. Thank you for this library.

I need help with deep sleep with board nrf51822.
Now for example "delay(5000);" get me about 0.8-0.9 mA.

Is this maximum mA for sleep mode?

resets every 5s (watchdog issue)

I have a device with a nrf51802.
just calling anything under 10ms (even with the simplest form with delay(9) in the main loop) will make a few iteration and crash. funnily calling a delayMicrosecond(100000) will also crash it.
I don't intent to use "delays" actually, but even the freertos example crash or any millis() usage.
Is there anything I can do to debug this?
I don't have serial on this board and use RTT... unfortunately here on an higher level, so I'm not sure to be able to check anything there :)
*I succeeded to root it narrower. seems t be the watchdog triggering (error 2) ... tried to disable it, but it doesn't change anything unfortunately.

Adafruit Feather nRF52840 Express compilation error

I am having a problem with the Adafruit Feather nRF52840 Express board (it extends to all Adafruit nRF52840 boards).

When compiling any sketch, even an empty sketch, I get the many errors from the TinyUSB library in the dcd_nrf5x.c file.
As far as I could figure it out, constants of the nordic library, more specific the in files "nrf52840.h" and "nrf52840_bitfields.h", cant be found within dcd_nrf5x.c.

These are the error messages:

C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:50:32: error: 'USBD_INTEN_ENDEPIN0_Pos' undeclared here (not in a function)
   50 |   EDPT_END_ALL_MASK = (0xff << USBD_INTEN_ENDEPIN0_Pos) | (0xff << USBD_INTEN_ENDEPOUT0_Pos) |
      |                                ^~~~~~~~~~~~~~~~~~~~~~~
"C:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\tools\\gcc-arm-none-eabi\\9.3.1-1/bin/arm-none-eabi-gcc" -mcpu=cortex-m4 -mthumb -c -g -Os -w -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DF_CPU=64000000 -DARDUINO=10819 -DARDUINO_NRF52840_FEATHER -DNRF52_SERIES -DNRF52832_XXAA -DUSE_ADA_BL -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x239A -DUSB_PID=0x8029 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"Feather nRF52840 Express\"" -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 -DNRF5 -DARDUINO_ARCH_NRF5 "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nimble_config" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx/hal" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx/mdk" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx/soc" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx/drivers/include" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/nordic/nrfx/drivers/src" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/CMSIS/Include" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/FC_Store" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/BLEBond_nvs" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/TinyUSB" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DUSE_LFXO "@C:\\Users\\Dylan\\AppData\\Local\\Temp\\arduino_build_521375/build.opt" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5" "-IC:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\variants\\feather_nrf52840_express" "C:\\Users\\Dylan\\AppData\\Local\\Arduino15\\packages\\h2zero\\hardware\\arm-ble\\0.1.0\\cores\\nRF5\\nordic\\nrfx\\mdk\\system_nrf52840.c" -o "C:\\Users\\Dylan\\AppData\\Local\\Temp\\arduino_build_521375\\core\\nordic\\nrfx\\mdk\\system_nrf52840.c.o"C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:50:68: error: 'USBD_INTEN_ENDEPOUT0_Pos' undeclared here (not in a function)

   50 |   EDPT_END_ALL_MASK = (0xff << USBD_INTEN_ENDEPIN0_Pos) | (0xff << USBD_INTEN_ENDEPOUT0_Pos) |
      |                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:51:23: error: 'USBD_INTENCLR_ENDISOIN_Msk' undeclared here (not in a function); did you mean 'CCM_INTENCLR_ENDKSGEN_Msk'?
   51 |                       USBD_INTENCLR_ENDISOIN_Msk | USBD_INTEN_ENDISOOUT_Msk
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       CCM_INTENCLR_ENDKSGEN_Msk
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:51:52: error: 'USBD_INTEN_ENDISOOUT_Msk' undeclared here (not in a function)
   51 |                       USBD_INTENCLR_ENDISOIN_Msk | USBD_INTEN_ENDISOOUT_Msk
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'edpt_dma_start':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:119:50: error: 'USBD_IRQn' undeclared (first use in this function); did you mean 'ECB_IRQn'?
  119 |       if ( __get_PRIMASK() || !NVIC_GetEnableIRQ(USBD_IRQn) )
      |                                                  ^~~~~~~~~
      |                                                  ECB_IRQn
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:119:50: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:127:19: error: 'NRF_USBD' undeclared (first use in this function)
  127 |           ended = NRF_USBD->EVENTS_ENDISOIN + NRF_USBD->EVENTS_ENDISOOUT;
      |                   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'xact_out_prepare':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:170:5: error: 'NRF_USBD' undeclared (first use in this function)
  170 |     NRF_USBD->TASKS_EP0RCVOUT = 1;
      |     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'xact_out_dma':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:187:28: error: 'NRF_USBD' undeclared (first use in this function)
  187 |   uint8_t const xact_len = NRF_USBD->SIZE.EPOUT[epnum];
      |                            ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'xact_in_prepare':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:210:3: error: 'NRF_USBD' undeclared (first use in this function)
  210 |   NRF_USBD->EPIN[epnum].PTR    = (uint32_t) xfer->buffer;
      |   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_int_enable':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:229:18: error: 'USBD_IRQn' undeclared (first use in this function); did you mean 'ECB_IRQn'?
  229 |   NVIC_EnableIRQ(USBD_IRQn);
      |                  ^~~~~~~~~
      |                  ECB_IRQn
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_int_disable':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:235:19: error: 'USBD_IRQn' undeclared (first use in this function); did you mean 'ECB_IRQn'?
  235 |   NVIC_DisableIRQ(USBD_IRQn);
      |                   ^~~~~~~~~
      |                   ECB_IRQn
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_set_address':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:248:3: error: 'NRF_USBD' undeclared (first use in this function)
  248 |   NRF_USBD->EVENTCAUSE |= NRF_USBD->EVENTCAUSE;
      |   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:251:24: error: 'USBD_INTEN_USBEVENT_Msk' undeclared (first use in this function)
  251 |   NRF_USBD->INTENSET = USBD_INTEN_USBEVENT_Msk;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_remote_wakeup':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:259:3: error: 'NRF_USBD' undeclared (first use in this function)
  259 |   NRF_USBD->LOWPOWER = 0;
      |   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:262:25: error: 'USBD_DPDMVALUE_STATE_Resume' undeclared (first use in this function)
  262 |   NRF_USBD->DPDMVALUE = USBD_DPDMVALUE_STATE_Resume;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_disconnect':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:273:3: error: 'NRF_USBD' undeclared (first use in this function)
  273 |   NRF_USBD->USBPULLUP = 0;
      |   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_connect':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:284:3: error: 'NRF_USBD' undeclared (first use in this function)
  284 |   NRF_USBD->USBPULLUP = 1;
      |   ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_edpt_open':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:301:5: error: 'NRF_USBD' undeclared (first use in this function)
  301 |     NRF_USBD->INTENSET = TU_BIT(USBD_INTEN_ENDEPOUT0_Pos + epnum);
      |     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_edpt_xfer':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:327:85: error: 'NRF_USBD' undeclared (first use in this function)
  327 |   bool const control_status = (epnum == 0 && total_bytes == 0 && dir != tu_edpt_dir(NRF_USBD->BMREQUESTTYPE));
      |                                                                                     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_edpt_stall':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:367:5: error: 'NRF_USBD' undeclared (first use in this function)
  367 |     NRF_USBD->TASKS_EP0STALL = 1;
      |     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:370:26: error: 'USBD_EPSTALL_STALL_Stall' undeclared (first use in this function)
  370 |     NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_Stall << USBD_EPSTALL_STALL_Pos) | ep_addr;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:370:54: error: 'USBD_EPSTALL_STALL_Pos' undeclared (first use in this function)
  370 |     NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_Stall << USBD_EPSTALL_STALL_Pos) | ep_addr;
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_edpt_clear_stall':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:383:5: error: 'NRF_USBD' undeclared (first use in this function)
  383 |     NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
      |     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:383:26: error: 'USBD_EPSTALL_STALL_UnStall' undeclared (first use in this function)
  383 |     NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:383:56: error: 'USBD_EPSTALL_STALL_Pos' undeclared (first use in this function)
  383 |     NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:386:26: error: 'USBD_DTOGGLE_VALUE_Data0' undeclared (first use in this function)
  386 |     NRF_USBD->DTOGGLE = (USBD_DTOGGLE_VALUE_Data0 << USBD_DTOGGLE_VALUE_Pos) | ep_addr;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:386:54: error: 'USBD_DTOGGLE_VALUE_Pos' undeclared (first use in this function)
  386 |     NRF_USBD->DTOGGLE = (USBD_DTOGGLE_VALUE_Data0 << USBD_DTOGGLE_VALUE_Pos) | ep_addr;
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'bus_reset':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:399:5: error: 'NRF_USBD' undeclared (first use in this function)
  399 |     NRF_USBD->TASKS_STARTEPIN[i] = 0;
      |     ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'dcd_int_handler':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:415:27: error: 'NRF_USBD' undeclared (first use in this function)
  415 |   uint32_t const inten  = NRF_USBD->INTEN;
      |                           ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:420:22: error: 'USBD_INTEN_EPDATA_Pos' undeclared (first use in this function); did you mean 'NFCT_INTEN_ENDTX_Pos'?
  420 |   for(uint8_t i=0; i<USBD_INTEN_EPDATA_Pos+1; i++)
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      NFCT_INTEN_ENDTX_Pos
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:432:21: error: 'USBD_INTEN_USBRESET_Msk' undeclared (first use in this function)
  432 |   if ( int_status & USBD_INTEN_USBRESET_Msk )
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:438:21: error: 'USBD_INTEN_SOF_Msk' undeclared (first use in this function)
  438 |   if ( int_status & USBD_INTEN_SOF_Msk )
      |                     ^~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:443:21: error: 'USBD_INTEN_USBEVENT_Msk' undeclared (first use in this function)
  443 |   if ( int_status & USBD_INTEN_USBEVENT_Msk )
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:445:56: error: 'USBD_EVENTCAUSE_SUSPEND_Msk' undeclared (first use in this function)
  445 |     uint32_t const evt_cause = NRF_USBD->EVENTCAUSE & (USBD_EVENTCAUSE_SUSPEND_Msk | USBD_EVENTCAUSE_RESUME_Msk);
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:445:86: error: 'USBD_EVENTCAUSE_RESUME_Msk' undeclared (first use in this function)
  445 |     uint32_t const evt_cause = NRF_USBD->EVENTCAUSE & (USBD_EVENTCAUSE_SUSPEND_Msk | USBD_EVENTCAUSE_RESUME_Msk);
      |                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:471:21: error: 'USBD_INTEN_EP0SETUP_Msk' undeclared (first use in this function)
  471 |   if ( int_status & USBD_INTEN_EP0SETUP_Msk )
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:550:22: error: 'USBD_INTEN_EPDATA_Msk' undeclared (first use in this function); did you mean 'UARTE_INTEN_ENDTX_Msk'?
  550 |   if ( int_status & (USBD_INTEN_EPDATA_Msk | USBD_INTEN_EP0DATADONE_Msk) )
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      UARTE_INTEN_ENDTX_Msk
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:550:46: error: 'USBD_INTEN_EP0DATADONE_Msk' undeclared (first use in this function)
  550 |   if ( int_status & (USBD_INTEN_EPDATA_Msk | USBD_INTEN_EP0DATADONE_Msk) )
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c: In function 'tusb_hal_nrf_power_event':
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:710:13: error: 'NRF_USBD' undeclared (first use in this function)
  710 |       if ( !NRF_USBD->ENABLE )
      |             ^~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:713:32: error: 'USBD_EVENTCAUSE_READY_Msk' undeclared (first use in this function)
  713 |         NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:807:34: error: 'NRF_USBD_BASE' undeclared (first use in this function); did you mean 'NRF_UICR_BASE'?
  807 |         *((volatile uint32_t *) (NRF_USBD_BASE + 0x800)) = 0x7E3;
      |                                  ^~~~~~~~~~~~~
      |                                  NRF_UICR_BASE
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:814:28: error: 'USBD_ISOSPLIT_SPLIT_HalfIN' undeclared (first use in this function)
  814 |       NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:817:28: error: 'USBD_INTEN_USBRESET_Msk' undeclared (first use in this function)
  817 |       NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk | USBD_INTEN_EPDATA_Msk |
      |                            ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:817:54: error: 'USBD_INTEN_EPDATA_Msk' undeclared (first use in this function); did you mean 'UARTE_INTEN_ENDTX_Msk'?
  817 |       NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk | USBD_INTEN_EPDATA_Msk |
      |                                                      ^~~~~~~~~~~~~~~~~~~~~
      |                                                      UARTE_INTEN_ENDTX_Msk
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:818:11: error: 'USBD_INTEN_EP0SETUP_Msk' undeclared (first use in this function)
  818 |           USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
      |           ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:818:37: error: 'USBD_INTEN_EP0DATADONE_Msk' undeclared (first use in this function)
  818 |           USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:818:66: error: 'USBD_INTEN_ENDEPIN0_Msk' undeclared (first use in this function)
  818 |           USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
      |                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:818:92: error: 'USBD_INTEN_ENDEPOUT0_Msk' undeclared (first use in this function)
  818 |           USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
      |                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Dylan\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.1.0\cores\nRF5\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src\portable\nordic\nrf5x\dcd_nrf5x.c:821:28: error: 'USBD_IRQn' undeclared (first use in this function); did you mean 'ECB_IRQn'?
  821 |       NVIC_ClearPendingIRQ(USBD_IRQn);
      |                            ^~~~~~~~~
      |                            ECB_IRQn
exit status 1
Error compiling for board Adafruit Feather nRF52840 Express.

`min` and `max` definitions in `Arduino.h` cause compilation errors

Any project which uses std::unordered_map fails to compile. The error message is extraordinarily long, but starts as:

rom /home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/bits/hashtable.h:35,
                 from /home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/unordered_map:46,
/home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/limits:1818:7: error: 'constexpr' static data member 'max' must have an initializer
 1818 |       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
      |       ^~~
/home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/limits:1818:7: error: expected ';' at end of member declaration
 1818 |       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
      |       ^~~
      |          ;

I hope this is just something I'm doing wrong. An identical project using the non-n-able core compiles without issue.

NRF52810 BLE Stack Overflow When Writing to Characteristic

I am testing the BLE_uart.ino example with the NRF52810. The Tx characteristic works fine, but writing to the Rx characteristic causes a stack overflow error, interestingly after the data is received. Here is the full debug output:

DD NimBLECharacteristic: Characteristic 6e400002-b5a3-f393-e0a9-e50e24dcca9e Write event
D NimBLECharacteristic: >> setValue: length=1, data=41, characteristic UUID=6e400002-b5a3-f393-e0a9-e50e24dcca9e
D NimBLECharacteristic: << setValue
*********
Received Value: A
*********
D NimBLECharacteristicCallbacks: onWrite: default
Task: ble, stack overflow

Sometimes I get the exception number as well, for example:

D NimBLECharaD NimBLECharacteristic: Characteristic 6e400002-b5a3-f393-e0a9-e50e24dcca9e Write event
D NimBLECharacteristic: >> setValue: length=1, data=ff, characteristic UUID=6e400002-b5a3-f393-e0a9-e50e24dcca9e
D NimBLECharacteristic: << setValue
*********
Received Value: �
*********
D NimBLECharacteristicCallbacks: onWrite: default
TaskUnhandled exception 0x00000003 , exception sp 0x20005e50
R0: 0x00000001, , R1: 0x00000000 , R2: 0x20001dfc, R3: 0x0000f900, R12: 0x00000080
LR: 0x00017509, PC: 0x0001750e, PSR: 0x01000011

Support for Nice!Nano V2 Nordic nRF52840

Hey!
Thank you for creating this library!
Can you add support for Nice!Nano V2 Nordic nRF52840 https://nicekeyboards.com/nice-nano?
There are a schematic and a pinout for it: https://nicekeyboards.com/docs/nice-nano/pinout-schematic for both V1 and V2(but only V2 is still commercialized). There is more info here: https://nicekeyboards.com/docs/nice-nano. It is mentioned that the board is using https://github.com/adafruit/Adafruit_nRF52_Bootloader bootloader.
I would gladly help with testing if you decide to add support for it.
Thank you!

analogRead doesn't work because value is set to 0

Hello,
I'm using BBC microbit v2 and I noticed that the analogRead function always gave us 0 (trying to read from a microphone).
In the file wiring_analog_nRF52.c, in the function analogRead , the variable is set to 0 when initialized.

The solution is to replace the line 109 "int16_t value = 0;" by "int16_t value;"
Then, it solves this issue.

Maybe I should have proposed a PR, but I'm not yet comfortable with that.

Thanks anyway for this library, because sandeepmistry/arduino-nRF5 doesn't support BLE for BBC microbit v2 and you do with NimBLE.

Soft reset when closing USB serial connection on micro:bit V2

I'm using n-able-Arduino and NimBLE on a micro:bit v2.

My application allows the user to open and close the USB serial port to communication with the board. With the board connected to the computer via a USB cable, I can connect and communicate with it over the serial port. However, when I close the serial port, the board does a soft reset. (_resetReason, which is read from NRF_POWER->RESETREAS at startup, is 4.)

I'd like it to simply continue running when the serial port is closed, as it does when I use Earle Philhower's Arduino framework.

I don't think it is the watchdog timer. I have that disabled and, anyhow, that would give a different reset reason.

Is some event my application should be handling? Other ideas?

nrf52810 Compilation Error Resulting From Typo in boards.txt

As the library is right now, I get #error "Device must be defined. See nrf.h."

In boards.txt, I believe line 1977

Generic_nRF52810.build.extra_flags=-DNRF52_SERIES -DnRF52810_XXAA {bootloader.flags} -DCONFIG_NIMBLE_CPP_LOG_LEVEL={build.cpp_debug} {build.nimble_flags}

should be changed to

Generic_nRF52810.build.extra_flags=-DNRF52_SERIES -DNRF52810_XXAA {bootloader.flags} -DCONFIG_NIMBLE_CPP_LOG_LEVEL={build.cpp_debug} {build.nimble_flags}

EEPROM does not read values after restart from Interrupt

Hi,

asking this here first as it is part of the library but I know its more of a platform issue.

I store several values in EEPROM, sometimes after a restart the values are read but set as 0. Then after a subsequent restart the values are back again.

To put:

EEPROM.begin();
EEPROM.put(0, value);

To get:

EEPROM.begin();
EEPROM.get(0, value);

I am wondering if the library may require an update from original branch (which I am unsure how to do) or if this is a know bug. If you can help on either then that will appreciated.

nrf52810 - no fpu

I am unable to get this to compile for an nrf52810 as it has no floating point unit.
Is it possible to change the freertos to compile without FPU??

I've added an entry for it in Boards.txt and added system_nrf52810.h and .c files to the nrf mdk, but when i select "generic 52810" I get this error:

#error This port can only be used when the project options are configured to enable hardware floating point support

Weirdly, if I select generic nrf51822 as the board then it compiles and runs ok on this nrf52810 custom board, and example code shows that a bluetooth device is available. Should I just use this, or will all the pins and interrupts be wrong?

This post gives a solution but asm format is different and mighty confusing! https://devzone.nordicsemi.com/f/nordic-q-a/30103/freertos-on-nrf52810

NRF52810 Notify Limited By CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT

I am using a NRF52810 with <NimBLEDevice.h> and when an attempt is made to notify with a characteristic length of greater than 339 bytes, the central does not recieve the data and onStatus indicates a return code of 6 (operation failed due to resource exhaustion). That may also be the case with other operations but I only tested notify.

I was able to get it working by changing line 13 in nrf52810_nimconfig.h from

#define CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT (8) to
#define CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT (12)

License question

Hello

I have a question regarding license, is it possible to use in in commercial product? If so, what are the terms? Dynamic linking would be hard as part of firmware that is pretty much core of application.

Fails to compile on Win11

When compiling a simple blinky fails with :

echo Not building DFU package
exit status -1073741515
Error compiling for board Nordic nRF52832DK (PCA10040).

When compiling with NIM-BLE app fails with :

exit status 0xc0000135

Compilation error: exit status 0xc0000135

Serial DFU for nrf52840

Hi ,

I am trying to do the usb-serial dfu of nrf52840 but I am stuck at it. I can do it using the bluefruit library and the USB serial example from the nrf SDK but the hex file from my n-able based code doesn't work it I use it in the serial dfu.

If anyone have any insights on this, any help is much appreciated,
Thanks

NRF52810 SPI/I2C

As is, neither the SPI or Wire library compile for the NRF52810.
Error for SPI:

C:\Users\jackb\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.2.0\libraries\SPI\SPI.cpp:258:15: error: 'NRF_SPI2' was not declared in this scope; did you mean 'NRF_SWI2'?
  258 | SPIClass SPI (NRF_SPI2,  PIN_SPI_MISO,  PIN_SPI_SCK,  PIN_SPI_MOSI);
      |               ^~~~~~~~
      |               NRF_SWI2

exit status 1

Compilation error: exit status 1

Error for I2C:

C:\Users\jackb\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.2.0\libraries\Wire\Wire_nRF52.cpp:402:14: error: 'NRF_TWIM1' was not declared in this scope; did you mean 'NRF_TWIM0'?
  402 | TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
      |              ^~~~~~~~~
      |              NRF_TWIM0
C:\Users\jackb\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.2.0\libraries\Wire\Wire_nRF52.cpp:402:25: error: 'NRF_TWIS1' was not declared in this scope; did you mean 'NRF_TWIS0'?
  402 | TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
      |                         ^~~~~~~~~
      |                         NRF_TWIS0
C:\Users\jackb\AppData\Local\Arduino15\packages\h2zero\hardware\arm-ble\0.2.0\libraries\Wire\Wire_nRF52.cpp:402:36: error: 'SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn' was not declared in this scope
  402 | TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

I was able to get the I2C library working by changing line 402 in Wire_nRF52.cpp from
TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL); to
TwoWire Wire(NRF_TWIM0, NRF_TWIS0, TWIM0_TWIS0_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);

Obviously this would not be compatible with other NRF52 modules, so I think some sort of compiler flag needs to be used but I don't have the programming skills for that yet.

I was able to get SPI to work by changing line 258 in SPI.cpp from
SPIClass SPI (NRF_SPI2, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI); to
SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);

Again, I think something has to be done with compiler flags since the SPI fix would also likely break compatibility with other boards.

Custom NRF51822 QFAA will advertise but won't connect

Hi there @h2zero - I'm having an issue getting my custom design to connect using NRFconnect. It's odd: all of the other functionality works (GPIO, sleep, i2c) and my BLE server test code works as far as it shows up in advertising but fails to connect. I've tried the same code on a cheap generic development board and it works fine. The schematic is identical minus the 32khz crystal (I'm not using one in my design). Any idea what might be happening here? I'm using a 10ppm 16mhz crystal for the main clock.

Build options mechanism not working with PlatformIO?

I am trying use a build_op.h file with latest version PlatformIO on MacOS, but it does not appear to be processing that file.

I created a build_op.h file with the following contents in my sketch folder:
'-DCONFIG_WDT_TIMEOUT_SECONDS=0'

But the watchdog timer is not disabled. Adding that same switch to the "build_flags =" line in the .platformio.ini file works as expected (i.e. the watchdog timer is disabled).

What am I doing wrong?

Collaborators wanted!

If anyone would like to help build this up for a release please comment in this issue thread.

Todo:

  • add more boards
  • add documentation
  • add wrapper library for FreeRTOS
    add github actions ✔️
  • convert remaining nRF5 legacy code to use nrfx
    PlatformIO integration ✔️ Can be found here: https://github.com/h2zero/platform-n-able
    build platform_index.json ✔️

nRF52810 support?

Hello. Does this core support nRF52810 MCU? I am doing a custom board with that MCU, and looking for PlatformIO framework to use.

I don't see it mentioned in the list ofsupported boards, but I understand that the compiler, tools and libraries are the same as for other nRF52 MCUs. How extensive will the changes needed to compile for the that MCU be?

Linker error compiling with PlatformIO for micro:bit V2

I get the following linker error when attempting to compile for a micro:bit V2:
/Users/johnmaloney/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: error: .pio/build/nable/firmware.elf uses VFP register arguments, .pio/build/nable/libFrameworkArduino.a(pulse_asm.S.o) does not

Here's my platformio.ini file entry:

[env:nable]
platform = https://github.com/h2zero/platform-n-able.git#1.0.0
framework = arduino
lib_deps = h2zero/NimBLE-Arduino@^1.4.0
board = BBCmicrobitV2
build_flags = -mfloat-abi=softfp

I added the "-mfloat-abi=softfp" in attempt to force it to use sofware floating point that did not help.

NimBLEDevice::setPower(int dbm) not working as expected

NRF52840-QIAA

n-able core version = 1.0.0
NimBLE-Arduino version = 1.4.1

platformio.ini config:
platform = https://github.com/h2zero/platform-n-able.git#1.0.0
framework = arduino
lib_deps = h2zero/NimBLE-Arduino@^1.4.0
upload_protocol = jlink
board = generic_nrf52840
debug_tool = jlink

Using NimBLEDevice::setPower(int dbm) seems to not change the tx power from what I can tell.

Iterating through the following dbm values shows no change using LightBlue to read RSSI:
{RADIO_TXPOWER_TXPOWER_Neg4dBm, RADIO_TXPOWER_TXPOWER_0dBm, RADIO_TXPOWER_TXPOWER_Pos3dBm, RADIO_TXPOWER_TXPOWER_Pos4dBm}
Reading RSSI on LightBlue app shows no change between all four settings

The workaround I have used so far is changing nimconfig MYNEWT_VAL_BLE_LL_TX_PWR_DBM=0 to -MYNEWT_VAL_BLE_LL_TX_PWR_DBM=4 with platformio build flag build_flags = -DMYNEWT_VAL_BLE_LL_TX_PWR_DBM=4
Reading RSSI on LightBlue shows immediate change after device is flashed with new config

Sleep with Interrupt

What is the command to enter sleep mode for NRF52840 so that the MCU wakes from interrupt pin?
Thanks!

SystemON Sleep works with platform = nordicnrf52

Hi,
thanks again for a great library.

I am near the end of my project and realised that I need to implement systemON sleep for faster wakeup.

I know this should be a core function but when I am using the following code:

https://github.com/ProMiniMicros/ProMininRF52/blob/master/Low%20Power/System%20ON%20Sleep/Pro_Mini_nRF52--Example_System_ON_Sleep.ino

in my platformio.ini when I declare:

platform = https://github.com/h2zero/platform-n-able.git#1.0.0
The device goes to sleep and then a few seconds later wakes up without any trigger but behaves like a reset (eg runs the code in setup) and does not continue from where it left off.

Could this be an issue with the SDK that is being used?

I notice that when I specify:

build_flags =
    -D CONFIG_WDT_TIMEOUT_SECONDS=0

that the board does not restart, but does not wake up either from the assigned interrupt.

when I use Sandeep's version by enabling it works.

platform = nordicnrf52

I also notice that when I click on the NRF_POWER function it seems to point to nrf51.h - should this not be pointing to nrf52.h like it does when I switch to the platform = nordicnrf52 ?

Thanks again for your help.

Platformio framework/platform not yet in registry.

I added this as a new framework to the Platformio registry (also the n-able platform) at the same time of the first release (3 days ago), not sure why it's not yet available (maybe @ivankravets, could comment)?

In the meantime to use this with Platformio you'll need to setup your environment as follows:

[env]
platform = https://github.com/h2zero/platform-n-able.git#1.0.0
framework = arduino
board = ...
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.