Mbed OS onto custom PCB

12 Sep 2018

Hi all, I'm brand new to embedded systems development and I'm having some issues getting the Mbed OS onto a custom PCB. The PCB we're using has a Fanstel BT840 chip.

The specifications for this chip can be found here: http://www.fanstel.com/bt840f-nrf52840-ble-5-module-secure-iot-802154-thread-zigbee/

We've spoken with Fanstel directly, and they've told us that the chip does not ship with any operating system on it. It comes only with a little firmware of its own, not related to any Nordic or Mbed firmware, and the SoftDevice S140. My question is, how would I get the Mbed OS onto this chip?

13 Sep 2018

I've just spoken with someone at Nordic, and they informed me that I don't need to to flash any specific OS to the chip because when you build a project in Mbed, the Mbed OS is included in the generated hex file. I'm trying to build and flash the mbed-os-example-blinky application now, but I'm getting the following:

/media/uploads/algorhythymic/mbed-os-example-blinkyerror1.png /media/uploads/algorhythymic/mbed-os-example-blinkyerror2.png

13 Sep 2018

Hi Darien,

Based on your screen captures it looks like you have a good installation of Mbed CLI but you are supplying the -t ARM option which requires that you have the Arm Compiler installed. This comes bundled either with Keil MDK or Arm's DS-5. Neither of these are free, so if you don't have them we suggest installing GCC as described here:

You will see that there is a link to download GNU Arm Embedded toolchain v6. You can then use the -t gcc_arm switch once you set the GCC_ARM_PATH as described in the above article (see "Setting environment variable").

We see that Mbed detected your board as a nRF52_DK. In fact the board is based on the nRF52840 so you can try building with -m nRF52840_DK. If you are lucky this will work for the blinky project. However, you don't actually have a nRF52840_DK - you have a different board that is not formally supported by Mbed. Both boards are based on the same chip, but the peripheral options on the boards might be different which might cause problems. For instance, on the nRF52840_DK LED1 is mapped to pin 13 as defined in PinNames.h:

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/PinNames.h

If your board's LED1 is mapped to a different pin, then the blinky example won't work.

The solution to this is to perform a port to your board which is described here:

At the minimum you will need to define a new target ("BT840" for instance) and create a new folder under \mbed-os\targets\TARGET_NORDIC\TARGET_NRF5x\TARGET_NRF52\TARGET_MCU_NRF52840 that has a custom PinNames.h.

The first step however is to get a build working. Let us know how that goes.

BTW - this area of the Forums doesn't get as much attention as the general "Mbed" area so you might want to post there in the future or even use the Questions area (https://os.mbed.com/questions/). If you do have a new problem in the future, we encourage you to search the Questions area for an immediate answer.

- Ralph, Team Mbed

14 Sep 2018

Hi Ralph, thank you so much for the speedy and thorough response. We're doing well so far, I realized I was supplying the wrong value for the toolchain flag after a while, and was able to program the board after supplying the correct value, although the board did not behave as expected due to the pin mappings being different. I'm currently going through the guide you provided to perform a port to our custom board (porting-targets.html). Unfortunately, when I try to run the command "git branch my-new-target -u USERNAME" I get the following error:

/media/uploads/algorhythymic/mbed-os-example-blinkyerror3.png

I've searched the web for that error and attempted to resolve it with the only results I've found, however they don't work, and I'm not a git expert either. It's my understanding that these steps are for contributing to Mbed, which I would like to do, however I don't believe that this will prevent me from continuing for now.

I'm currently working on adding a new target. I'll let you know how that goes. Thanks again, Ralph!