"Seeed nRF52 Boards" update to 1.1.3 causes compile error

After updating the board service package from 1.1.1 to 1.1.3, I get a compile error, even with IDE 2.1.0 and IDE 1.8.19, even with an empty sketch. Of course, if I go back to 1.1.1, it compiles fine.
Below is the error message.
Can anyone help me with a solution?

FQBN: Seeeduino:nrf52:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: C:\Users\msfujino\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.3
Using core 'nRF5' from platform in folder: C:\Users\msfujino\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.3

loading library from C:\Users\msfujino\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.3\libraries\Adafruit_TinyUSB_Arduino: invalid library: no header files found
loading library from C:\Users\msfujino\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.3\libraries\Adafruit_nRFCrypto: invalid library: no header files found
Detecting libraries used...
"C:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 "-DARDUINO_BSP_VERSION=\"1.1.3\"" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"XIAO nRF52840 Sense\"" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/Core/Include/" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/DSP/Include/" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx/hal" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx/mdk" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx/soc" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx/drivers/include" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/nrfx/drivers/src" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/freertos/Source/include" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/freertos/config" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/freertos/portable/GCC/nrf52" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/freertos/portable/CMSIS/nrf52" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/sysview/SEGGER" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5/sysview/Config" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3/libraries/Adafruit_TinyUSB_Arduino/src/arduino" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\cores\\nRF5" "-IC:\\Users\\msfujino\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\nrf52\\1.1.3\\variants\\Seeed_XIAO_nRF52840_Sense" "C:\\Users\\msfujino\\AppData\\Local\\Temp\\arduino\\sketches\\1752F95D1E9A040C12D17C3D1B3D4449\\sketch\\sketch_jun12a.ino.cpp" -o nul
Alternatives for Adafruit_USBD_CDC.h: []
ResolveLibrary(Adafruit_USBD_CDC.h)
  -> candidates: []
In file included from C:\Users\msfujino\AppData\Local\Temp\arduino\sketches\1752F95D1E9A040C12D17C3D1B3D4449\sketch\sketch_jun12a.ino.cpp:1:
C:\Users\msfujino\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.3\cores\nRF5/Arduino.h:65:10: fatal error: Adafruit_USBD_CDC.h: No such file or directory
   65 | #include "Adafruit_USBD_CDC.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

Hello Seeed_h via Seeed Forum,

Compiling an empty sketch(File - New Sketch) will result in an error.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

msfujino,

I have removed Seeed’s BSP and only use Adafruit’s. Just need to add the Seeed boards to the corresponding folders.

When Seeed has a new update which is interesting to me, I will manually merge it to Adafruit package.
adafruit_nrf52_patch_to_add_Seeed.rar (946.0 KB)

hobbya,
Thank you very much for the information.
Please provide specific instructions on the following points.

“removed Seeed’s BSP”
“only use Adafruit’s”
“need to add the Seeed boards to the corresponding folders”

First install Adafruit BSP v1.4.0. by adding this to the board manager.

Go to below after the installation: C:\Users\yourname\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0

Unrar my file and merge the contents to the folders of the same name under above directory. For example, copy “linker” folder to:
C:\Users\Jason\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5

Test if you can select Seeed Xiao board from the Adafruit BSP. If ok then remove the Seeed BSP by deleting below directory:
C:\Users\yourname\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52

Sorry for the inconvenience.
For now, you can follow @hobbya 's method to solve the current problem.
We will release a Board package that can be compiled directly as soon as possible.
Thanks for your understanding!

1 Like

I am getting another compile error and it is not working.
I think I am not following the procedure you taught me.
“by adding this to the board manager.”
What should I do with this json file?
Do I just copy over the “boards.txt” and “platform.txt”?

Use the json to install Adafruit BSP

Similar to what you did to install Seeed BSP.

If the “Adafruit nRF52 by Adafruit” shows up in the IDE’s board manager, do I need to use this json file?
I don’t understand what you mean by “by adding this to the board manager.”
Do you mean installing without using the IDE’s board manager?

Sorry msfujino for the messy description, I am busy at work and my boss is also fooling around …

Let’s forget what I posted.
Install Adafruit BSP, just follow the instructions on Adafruit’s Github repository. It is similar to what you did to install the Seeed BSP.
Then goto below directory:
C:\Users\yourname\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0
Look for the folders which have the same names in my rar file. Copy the patch contents to your computer. For example: bootloader to bootloader, linker to linker, etc.

I like this project.

hobbya,
Thanks for taking the time to do this for me.
I’ll try to work on it some more…

EDIT
Carefully follow the steps and it works. Thank you!

hi all i have similar issue. i flowed instructions and merge path rar to Adafrut nrf52
… when i try to compule i get error

In file included from C:\Users\LZ-Main\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5/Arduino.h:41,
                 from C:\Users\LZ-Main\AppData\Local\Temp\.arduinoIDE-unsaved2023519-8108-1dkae0m.4o29\blinky\blinky.ino:21:
C:\Users\LZ-Main\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5/WVariant.h:24:10: fatal error: nrf_soc.h: No such file or directory
   24 | #include "nrf_soc.h"
      |          ^~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

i googled that this can be foxed by selecting variant but i don’t see option of selecting any variants?

if i select adafruot fether, it comiles just fine but im sure thats differebt board

any recomendations?

You likely have not copied the patches properly.
You can delete everything and restart over or install the seeed BSP again with below procedure:
Freezes when using Serial with 1.1.3 - Products & Technology / XIAO - Seeed Forum (seeedstudio.com)

LOL, Yes it’s a Good application project for mid level Technical abilities of tiny hardware with smart firmware, I agree with the conclusions though in the article.

Step 4: Conclusion
Seeed has wonderful products, however the software support is lacking. I was able to show that the 
advertised XIAO BLE functions work if you find the suitable library. I’m not a software programmer and
 I need simple libraries. That is lacking at the moment with XIAO BLE boards, especially compared to
 the competitors. Maybe it will change in the near future.

I’m sure AdaFruit loves the free positive press… :grinning: I can only hope the Seeed firmware/software & testing of their library’s gets better :upside_down_face: or catches up with there AWESOME hardware. :wink:

my .02
GL :slight_smile: PJ

yea i probably did not pace part in right places… i don’t know locations so i was guessing

where do i put softdevice folder? to nordic one? thats one place i see existing folder

so reintalled everything now it compiles :slight_smile: yay
but does not upload :frowning: when i try to upload com port goes offline right away and i get message below…

note i did have driver problem there was no driver so i used zusb to install CDC driver

any recomendations?

Sketch uses 43024 bytes (5%) of program storage space. Maximum is 811008 bytes.
Global variables use 7188 bytes (3%) of dynamic memory, leaving 230380 bytes for local variables. Maximum is 237568 bytes.
Upgrading target on COM15 with DFU package C:\Users\LZ-Main\AppData\Local\Temp\arduino\sketches\1A3674CF2911C8028729E7223A0DE2E5\blinky.ino.zip. Flow control is disabled, Single bank, Touch disabled

Failed to upgrade target. Error is: Serial port could not be opened on COM15. Reason: could not open port 'COM15': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
Traceback (most recent call last):
  File "dfu\dfu_transport_serial.py", line 113, in open
  File "serial\serialwin32.py", line 33, in __init__
  File "serial\serialutil.py", line 244, in __init__
  File "serial\serialwin32.py", line 64, in open
serial.serialutil.SerialException: could not open port 'COM15': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "__main__.py", line 296, in serial
  File "dfu\dfu.py", line 235, in dfu_send_images
  File "dfu\dfu.py", line 157, in _dfu_send_image
  File "dfu\dfu_transport_serial.py", line 115, in open
nordicsemi.exceptions.NordicSemiException: Serial port could not be opened on COM15. Reason: could not open port 'COM15': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

I just received the “Seeed Studio XIAO nRF52840” (the basic one, not the sense). First, I wanted to use it with arduino ide (1.8.18). Adafruit nrf52 boards were installed for a couple of years. So, I just added the url for seeed boards. When I tried to compile Blink, I faced the USBD issue. I removed the url for seeed boards and, later, all seed folders that I can find. I downloaded your patch and copied the content to the corresponding arduino folder. Now, I’m facing the missing nrf_soc.h file issue.

Arduino : 1.8.18 (Windows 10), Carte : "Seeed XIAO nRF52840, S140 7.3.0, Level 0 (Release)"
[...]
C:\Users\Famille\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5/WVariant.h:24:10: fatal error: nrf_soc.h: No such file or directory

   24 | #include "nrf_soc.h"

Indeed, the nrf_soc.h file was provided by the patch and is available in :

C:\Users\MyName\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\softdevice\s140_nrf52_7.3.0_API\include

(And also in C:\Users\MyName\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5\nordic\softdevice\s140_nrf52_6.1.1_API\include and C:\Users\MyName\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.4.0\cores\nRF5\nordic\softdevice\s132_nrf52_6.1.1_API\include

So, what?

Hi alexus,
I think if you “double reset” XIAO, the COM port will show up.