Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mbed-os support for Nano 33 BLE #113

Closed
wants to merge 1 commit into from
Closed

Enable mbed-os support for Nano 33 BLE #113

wants to merge 1 commit into from

Conversation

maxgerhardt
Copy link
Contributor

@maxgerhardt maxgerhardt commented Mar 21, 2021

Supported since mbed-os 6.2.0 (and also in the used 6.6.0) per https://github.com/ARMmbed/mbed-os/tree/mbed-os-6.6.0/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840.

Tested compilation with a minimal

[env:nano33ble]
platform = nordicnrf52
board = nano33ble
framework = mbed

and src\main.cpp

#include "mbed.h"
int main() {
    DigitalOut led(LED_BUILTIN);
    while(true) {
        led = 1;
        ThisThread::sleep_for(chrono::milliseconds(1000));
        led = 0; 
        ThisThread::sleep_for(chrono::milliseconds(1000));
    }
    return 0;
}

which compiles.

Building .pio\build\nano33ble\firmware.bin
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.2% (used 11032 bytes from 262144 bytes)
Flash: [          ]   3.7% (used 36352 bytes from 983040 bytes)
================= [SUCCESS] Took 22.59 seconds =================

I don't have the board to test but there shouldn't be any major problems -- the board support is there in mainline mbed-os.

Note that the Arduino-mbed core also works on mbed-os base but applies some patches. Most of those seem to be for the Portenta H7 though, so they shouldn't impede operation for the Nano 33 BLE.

@valeros
Copy link
Member

valeros commented Mar 23, 2021

Thanks for the PR. The only thing that bothers me is that the firmware generated with mbed framework doesn't take into account the initial bootloader located from 0x0 to 0x10000. It seems we will override the bootloader and the board won't be usable with Arduino anymore.

@maxgerhardt
Copy link
Contributor Author

Hm indeed per

https://github.com/arduino/ArduinoCore-mbed/blob/a2c06d768f5ebb6821ae6505b2032ee58f4ef70d/variants/ARDUINO_NANO33BLE/linker_script.ld#L1-L7

and https://github.com/arduino/ArduinoCore-mbed/tree/1.3.2/bootloaders/nano33ble there's a bootloader that would be overwritten there. But there may also be users who only flash via SWD and want to run pure mbed-os without the bootloader. Maybe some code should be added to use the right linker script by default and only overwrite the bootloader when the user sets an option that explictitly says so.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants