nRF52840 Sense isn't connecting to FreeRTOS on Arduino

Hey! I’m trying to use FreeRTOS with my Seeed XIAO nRF52840 Sense but for some reason even after follwing this (FreeRTOS with Wio Terminal | Seeed Studio Wiki) I’m running into the below error. It might be because I have an ARM core, what are some other options I can use?

I’ve also tried to use Zypher but can’t seem to upload files/flash the sensor since it keeps saying the board is not found.

Error:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c: In function ‘sem_init’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:87:9: error: ‘errno’ undeclared (first use in this function)
87 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:41:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
40 | #include “atomic.h”
+++ |+#include <errno.h>
41 |
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:87:9: note: each undeclared identifier is reported only once for each function it appears in
87 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c: In function ‘sem_timedwait’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:185:17: error: ‘errno’ undeclared (first use in this function)
185 | errno = ETIMEDOUT;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:185:17: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c: In function ‘sem_trywait’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:217:32: error: ‘errno’ undeclared (first use in this function)
217 | if( ( iStatus == -1 ) && ( errno == ETIMEDOUT ) )
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_semaphore.c:217:32: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c: In function ‘timer_create’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c:115:9: error: ‘errno’ undeclared (first use in this function)
115 | errno = ENOTSUP;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c:44:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
43 | #include “timers.h”
+++ |+#include <errno.h>
44 |
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c:115:9: note: each undeclared identifier is reported only once for each function it appears in
115 | errno = ENOTSUP;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c: In function ‘timer_settime’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c:206:13: error: ‘errno’ undeclared (first use in this function)
206 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_timer.c:206:13: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOSVariant.c: In function ‘delay’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOSVariant.c:133:19: warning: division by zero [-Wdiv-by-zero]
133 | vTaskDelay(ms / portTICK_PERIOD_MS);
| ^
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOSVariant.c: At top level:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOSVariant.c:164:2: error: #error “Processor or architecture not support!”
164 | #error “Processor or architecture not support!”
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c: In function ‘clock_settime’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c:205:5: error: ‘errno’ undeclared (first use in this function)
205 | errno = EPERM;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c:40:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
39 | #include “FreeRTOS_POSIX/utils.h”
+++ |+#include <errno.h>
40 |
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c:205:5: note: each undeclared identifier is reported only once for each function it appears in
205 | errno = EPERM;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c: In function ‘nanosleep’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c:224:9: error: ‘errno’ undeclared (first use in this function)
224 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_clock.c:224:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_close’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:443:9: error: ‘errno’ undeclared (first use in this function)
443 | errno = EBADF;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:40:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
39 | #include “FreeRTOS_POSIX/utils.h”
+++ |+#include <errno.h>
40 |
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:443:9: note: each undeclared identifier is reported only once for each function it appears in
443 | errno = EBADF;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_getattr’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:482:9: error: ‘errno’ undeclared (first use in this function)
482 | errno = EBADF;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:482:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_open’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:521:9: error: ‘errno’ undeclared (first use in this function)
521 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:521:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_timedreceive’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:654:9: error: ‘errno’ undeclared (first use in this function)
654 | errno = EBADF;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:654:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_timedsend’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:746:9: error: ‘errno’ undeclared (first use in this function)
746 | errno = EBADF;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:746:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c: In function ‘mq_unlink’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:843:9: error: ‘errno’ undeclared (first use in this function)
843 | errno = EINVAL;
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_mqueue.c:843:9: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
In file included from /Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/error_hooks.cpp:3:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOSConfig.h:32:2: error: #error “Processor or architecture not support!”
32 | #error “Processor or architecture not support!”
| ^~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/error_hooks.cpp: In function ‘void vNopDelayMS(long unsigned int)’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/error_hooks.cpp:187:39: error: ‘configCAL_FACTOR’ was not declared in this scope
187 | unsigned long iterations = millis * configCAL_FACTOR;
| ^~~~~~~~~~~~~~~~
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_pthread.c: In function ‘pthread_create’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_pthread.c:355:13: warning: implicit declaration of function ‘vTaskSetApplicationTaskTag’; did you mean ‘xTaskCallApplicationTaskHook’? [-Wimplicit-function-declaration]
355 | vTaskSetApplicationTaskTag( pxThread->xTaskHandle, ( TaskHookFunction_t ) pxThread );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| xTaskCallApplicationTaskHook
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_pthread.c: In function ‘pthread_self’:
/Users/ayaanesmail/Documents/Arduino/libraries/Seeed_Arduino_FreeRTOS/src/FreeRTOS_POSIX/FreeRTOS_POSIX_pthread.c:482:26: warning: implicit declaration of function ‘xTaskGetApplicationTaskTag’; did you mean ‘xTaskCallApplicationTaskHook’? [-Wimplicit-function-declaration]
482 | return ( pthread_t ) xTaskGetApplicationTaskTag( NULL );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| xTaskCallApplicationTaskHook
Multiple libraries were found for “Adafruit_TinyUSB.h”
Used: /Users/ayaanesmail/Documents/Arduino/libraries/Adafruit_TinyUSB_Library
Not used: /Users/ayaanesmail/Library/Arduino15/packages/Seeeduino/hardware/nrf52/1.1.8/libraries/Adafruit_TinyUSB_Arduino
exit status 1

Compilation error: exit status 1

@PJ_Glasso potentially you would have some insights into this, it would be great to learn from all the knowledge and experience you have :sweat_smile:

Hi there,
Which Board support Package are you using? what version of FreeRtos ?
I don’t see it explicitly supported on the Nrf52840 Sense in that wiki but I know it runs on the Nrf52840-DK.

GL :slight_smile: PJ :v:

What does your FreeRTOSConfig.h look like can you post it?

Hey PJ! Thanks for the help : )

I’m not sure which board support package i’m using, is there a way for me to figure it out?
My FreeRTOSConfig.h file is the same as whats included in here: Seeed_Arduino_FreeRTOS/README.md at master · Seeed-Studio/Seeed_Arduino_FreeRTOS · GitHub

I’m not sure if there’s any other file.

I’m also trying to use VS Code & zephyr to flash the sensor since maybe this will work, not sure if you know anything about using zephyr for this and if that’s possible?

Hi there,
None of that supports the M4 inside the Nrf52840. only Samd21 and 51.
What are you trying to do with this long way around it sounds like?

It does support the RP2040, like on the RP-Pico, pretty sure there is a git with a demo too.
Its a two task , Que task type setup, message buffer and queues.
GL :slight_smile: PJ

I see after any version after 9, because it’s Nrf52840 so it is Cortex-M4 and therefore, you should be able to use FreeRTOS Cortex-M4 port. :v:

Thanks! I’m trying to monitor log 6 axis data for 30 seconds, send it via BLE to my esp32 gateway, and while sending still be able to log the data.

Do you think this’ll be possible on the Nrf52840 I have or no? I really appreciate the insight!

I like the “It’s also water-resistant up to 1.5 meters.” LOL :smiley:
is it this unit?
ax6_21
I would think so, but needs a look as to what the data rate coming out is on and what interface wise?
GL :slight_smile: PJ

LOL :laughing:

This is what I’m using:

For some reason I don’t think FreeRTOS runs on it!

p.s. it might be easier to chat via email incase this thread gets long, my email is [email protected]!

Hi there,
Great !
So go read and do this…Getting started with the Nordic nRF52840-DK - FreeRTOS
and after that I can tell you the last thing required to get it to run on a Xiao Nrf52840,
unless you figure it out b4 then. Hint(FAQ)
HTH
GL :slight_smile: PJ :v: Enjoy

1 Like