12 months ago.

nrf52 blinky on mbed - Error compilling original sample...

Hi

I would like to give a try to nrf52 on mbed. So I went to:

https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/

and clicked Import to compiler

I check the update... check box and the project was imported. The target board is selected on the top right corner ("Nordic nRF52-DK")

When I click Compile | Build only Lots of warnings as displayed but one error is also displayed:

Error: Non-constant-expression cannot be narrowed from type 'int' to 'std::uint8_t' (aka 'unsigned char') in initializer list [-Wc++11-narrowing] in "extras/mbed-os.lib/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGap.cpp", Line: 749, Col: 9

Why is this error appearing with the original source code? How to solve it?

By the way, is mbed using the softdevice from nordic or an alternative one?

Thanks

Alex

1 Answer

12 months ago.

Hi Imo,
I have reproduced the error.
Please update mbed-os form 5.12.1(imported rev.) to 5.13.0(as of today).
You can compile it without an error message but still lots of warnings.
I don't test the program because I'm using the board at another place right now.

Mbed's revision control is always running, and I have never seen a stable bug-free one for the past nine years.
Be careful even the official sample program.
The lack of a stable program is likely to be the cause of the moving to Arduino from Mbed.
/questions/83388/Official-release/

Yes, Mbed nRF5x serises use Noridic Softdevice as you expect.
You can confirm it by following readme file (see SoftDevice explanation, near the end of line).
https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NORDIC/TARGET_NRF5x/README.md

Hello Kenji Arai Thanks it works now!

By the way, are you saying that you have put mbed apart and went to Arduino? I have been using nordic SD and the interrupt oriented way of programming but I think I will feel more confortable with a thread riented operating system hence I decided to move to mbed. But Now I reaized that you have moved from mbed to arduino . Is it true? Can I ask your advice about this issue? In arduino wich libraries do you use to program nrf52 based boards? What about energy consumption? Is arduino libraries energy efficient? thanks a lot!

posted by Imo Co 13 Jul 2019

Hi Imo,
No, I am in the Mbed community !!
I pointed out that even a very simple LED flashing program does not work correctly with Mbed.
This is too bad for those who have started studying Mbed for the first time.
I am concerned that such a person may choose to Arduino.
There is no objection to the big goal of Mbed such as RTOS and IOT connection, but I think that bug-free, stable condition is more important than the new function for the released mbed-os5.
For your several question, please give me a private message and discuss it separately.
Do you know the way to send a private message?

posted by Kenji Arai 13 Jul 2019

No I dont know how to post a private message. The mbed platform seems interesting for me. I have at least 2 questions

posted by Imo Co 13 Jul 2019

Click my name (blue part)
/media/uploads/kenjiArai/mbed_0.png
Appear my profile page then click "private message"
/media/uploads/kenjiArai/mbed_1.png

posted by Kenji Arai 14 Jul 2019

I have sent already...

posted by Imo Co 14 Jul 2019