hello
i tried loading the blinker example from mbed and i have ble 33 nano sense board from arduino. I get the following message
mbed framework is not supported on this board
when i searched i found that arduino supports mbed ?
is it possible to run rtos with mbed on this board?
thank you for your reply, i am aware of ArduinoCore-nRF528x-mbedos but i still don’t know how can i use it from platformio, how can i use a special framework?
i noticed there is a framework called as follows in the packages folder
.platformio/packages/framework-arduino-nrf52-mbedos
is it the same framework you mentioned? how can i use it what is the environment name?
#include <Arduino.h>
/* use mbedos object for build in LED */
mbed::DigitalOut led(P0_13);
void setup(void)
{
Serial.begin(115200); /* arduino function */
Serial.println("Hello world");
}
void loop(void)
{
led = 1; /* mbedos function */
delay(500); /* arduino function */
led = 0; /* mbedos function */
delay(500); /* arduino function */
}
in the compilation output you will see the used packages.
Processing nano33ble (platform: nordicnrf52; framework: arduino; board: nano33ble)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nano33ble.html
PLATFORM: Nordic nRF52 (5.0.0) > Arduino Nano 33 BLE
HARDWARE: NRF52840 64MHz, 256KB RAM, 960KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-arduino-nrf52-mbedos 1.3.0
- tool-sreccat 1.164.0 (1.64)
- toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
..
Linking .pio\build\nano33ble\firmware.elf
Building .pio\build\nano33ble\firmware.bin
Checking size .pio\build\nano33ble\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 16.6% (used 43496 bytes from 262144 bytes)
Flash: [= ] 7.8% (used 77116 bytes from 983040 bytes)
============================= [SUCCESS] Took 5.95 seconds =============================
Excellent thank you. Here is another sample for people who like to work with the mbed main function, the same program but written using threading.
Summary:
To recap, as soon as the mbed object is called, it will compile using mbed rtos although the framework in the setup is arduino.
#include <Arduino.h>
/* use mbedos object for build in LED */
#define WAIT_TIME_MS 3000
mbed::DigitalOut led(P0_13);
int main()
{
printf("This is the bare metal blinky example running on Mbed OS %d.%d.%d.\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
while (true)
{
led = !led;
thread_sleep_for(WAIT_TIME_MS);
}
}
Is that a compile error when using the Build button or an IntelliSense error? The IntelliSense won’t be able to find that framework files if you haven’t built it at least once, because then it will download the framework. Also when in doubt, use the project task “Rebuild IntelliSense” after a build.
I can compile perfectly fine and the IntelliSense works.
I will check it, the next time i create this project and test this issue.
My second step would to be able to debug the program while running, could you please help me with it also?
Like the documentation says, the board doesn’t have an on-board debugging device. You need an external SWD debugger device like a ST-Link (or general CMSIS-DAP), JLink or Black Magic Probe and connect it to the board’s SWD pins (SWDIO+SWCLK+GND,RST,3V3 ofc), which are on the back of the board