Arduino Nano 33 BLE sense - BLE not working and compilation is slow

Hi,

I recently started with Arduino Nano 33 Sense. The biggest advantage of the board is having BLE but I am not able to use it because of the following two reasons

  1. I used the ArduinoBLE.h library to program for BLE, but even the example code from "Examples->ArduinoBLE -> Peripheral -> BatteryMonitor" takes 8 minutes to compile and upload. This is very uncomfortable to debug and program. Other programs like blink or PDMSerialPlotter gets compiled in 2-3 minutes.

  2. Even after uploading the example program successfully I am not able to discover the device on the nRF connect application. What could be the reason?

Please help, also I read that I am not the only one facing this compilation delay. Is there any workaround for this? Like any other library that I can use in place of ArduinoBLE.h

1.) Yes, the compilation time is longer, but 8 minutes seems very slow. I am more in the 2 minute range. Check your Task Manager / System Monitor to see what is the bottle neck.

If you check the Arduion IDE output window. For me during the part that follows this message, is very slow.

ResolveLibrary(ArduinoBLE.h)
→ candidates: [ArduinoBLE@1.1.2]

Onces it reaches the next message everything goes a lot faster.

Compiling sketch…

Compiling libraries…
Compiling library “ArduinoBLE”

2.) Did you start the Serial Monitor. There is a while (!Serial); in the setup and with the new Arduinos, that will stop the program until you open the Serial Monitor window.

I use an iPhone App called BLE Scanner that works nicely with the Arduino so far. :slight_smile:

Hi Aswinth

  • The only way the reduce compile and development time is to move to PlatformIO , it is a very simple process. The compile time difference between the two is massive . A program that takes 8-10 mins in Arduino IDE takes 15-20 Seconds in Platform IO.

Thanks, Gurbir Singh GBSP Technosensors

The Arduino online editor is also a good place to start.

However slow compile can have many causes.

Slow compiles under Windows

These are only one aspect of the possible issue.

Add the Arduino directories to your antivirus / anti malware / other security exclusions.

So that would be at least two of the following.

C:\Program Files (x86)\Arduino C:\Users\yourname\AppData\Local\Arduino15 (depends on IDE install type/location) C:\Users\yourname\AppData\Roaming\Arduino15 (depends on IDE install type/location)

If you have your sketches set up in a different location it’s also worth adding that directory to the exclusions also.

Additionally if you also use the online IDE “CREATE” the following directories.

C:\Users\yourname\AppData\Roaming\ArduinoCreateAgent C:\Users\yourname\AppData.arduino-create

If you have installed to a different drive swap the drive letter as needed. If you also have an unzipped IDE installed that path should also be added to exclusions.

Bob.

GurbirS: - The only way the reduce compile and development time is to move to PlatformIO ...

The latest version of the Arduino IDE 1.8.11 has improved compilation times quite a lot. It is now caching library objects and therefore reduces compilation times after initial compilation, as long as you keep the IDE open.

For example I have a project that takes 150 seconds to compile the first time and 25 seconds after changing something in the sketch.

I have the same issue. As an example:

blink for Leonardo takes less than 10 seconds to compile. blink for nano 33 BLE sense takes about 30 seconds to compile.

BLE battery monitor example takes about 6.5 minutes to compile. My BLE program takes 7.5 minutes to compile.

The biggest problem is if the port is not set right you have to compile again.

I also have problems with the BLE not completely working. I get some BLE functions to work but any BLE programs seem to crash the board. This happens with my program and the battery monitor example.

After a BLE program is downloaded, you can't reset or cycle power. The program does not run and you have to double press reset to get into bootloader mode to download again.

This does not happen with non-BLE programs, blink works fine.

I was not sure if it was a hardware issue. I have tried it on 2 nano 33 BLE sense board and they both work identically.

To me, the boards are not really practical for BLE because of the long compile time for debug session and there appears to be a problem in the BLE software.

Any comments would be useful.

@TartanLego

First off make sure that you have NOTHING to interfere with compiles and uploads. Antivirus and other security software can be a royal pain with programming in many contexts.

Usually its as simple as adding an exclusion / whitelist to the software that slows things down.

There is also the online editor that is often faster then thje regular IDE but it has a few small limitations for FREE users.

Additionally the boards are still new in the grand scheme of things. So make sure there are no outstanding firmware or core updates that may help out.

Could you also take a few moments to Learn How To Use The Forum. It will help you get the best out of the forum in the future. Other general help and troubleshooting advice can be found here.

TartanLego: I also have problems with the BLE not completely working. I get some BLE functions to work but any BLE programs seem to crash the board. This happens with my program and the battery monitor example.

After a BLE program is downloaded, you can't reset or cycle power. The program does not run and you have to double press reset to get into bootloader mode to download again.

Can you post the BLE code that is not working? Preferably reduced to work without external hardware, so I can run it on my board.

Thanks for the feedback.

Disabling everything and antivirus, helped a bit (10-20 seconds) but does not change things substantially.

I tried the online editor and it was faster around 6 minutes, but still a bit long to be practical.

I think I agree these boards are still pretty new and I might need for the BLE software to mature a bit.

AdaFruit has just brought out a similar Feather board. I don't have one yet but started working with the Feather nRF52480 Express board. I have just done some initial tests and it compiles faster and seems more solid with the IDE (it always finds the board and downloads). I like the smaller size Nano 33 BLE sense but might need to wait for software updates.

How do I check for firmware and core updates? I do keep the boards and libraries up to date.

For Klaus_K, the battery monitor example program that comes with the IDE and Nano 33 BLE sense board shows the problem. I can compile and download it and it works. If I cycle power or reset it, the board does nothing and I have to double press reset to get it to download again.

I am using IDE 1.8.12 and the Arduino nRF528x boards 1.1.4.

At this time I would consider 10-20 seconds acceptable.

So that you dont have to always turn off the security add the Arduino folders to the exclusions in your security. That should also include the sketches folder and more so if you use an alternate locaion fort your sketches.