2 years, 6 months ago.

Can Mbed be used in own PCB design?

I am new to Mbed, and I would like to know how to go from a development board like STM32F302 to my own PCB? Can I use the same programming style and compiler? And how should the two microcontrollers be connected on my own PCB? What happens if I decide to use a different microcontroller that also supports Mbed? Thanks for the help!

3 Answers

2 years, 6 months ago.

It's pretty easy to make your own PCB as long as you are using a micro supported by mbed. I've done it several times. Normally you would not want to put the mbed programming interface on your PCB. It's on the devboard for convenience but in production it adds cost and offers no real benefit. The mbed interface is more or less just an STLink V2 programmer with the extra drag and drop programming functionality. You would make your target PCB with a 6pin SWD header - make it match the 6pin sip header on your ST Nucleo board. The Nucleo and Disco boards are specifically designed to work as STLink debuggers for external targets like your custom board. There is a jumper on the devboard to set whether you want to use the devboard target or an offboard target over that 6pin header. Your target will need its own power. The stlink interface does not provide power to the target - the Vdd pin is a detection pin, not a supply pin.

The binary files produced by mbed are boring old binary files just like any other ARM toolchain creates. For example you can use STLink Utility to flash binaries created with mbed online compiler if you want. To flash parts, you can use any debugger/programmer that works with ST parts, it does not have to be an mbed-enabled debugger/programmer. Of course with binary format you have to pay attention to start address as that data is not encoded in the file like it is with hex or srec.

2 years, 6 months ago.

Not sure about the "no benefit" comment above. My customers actually love the drag-and-drop feature and the built-in serial. The ST-LINK feature provides no benefit to them. However, the code that resides on the USB processor (STM103) is protected by ST and requires a license agreement. I would love to see ST develop a community-based source for this processor and realize it will actually increase sales instead of taking away from ST-LINK.

2 years, 6 months ago.

Hi Tobias,

There is a tutorial related to creating a new target microcontroller for Mbed OS: https://os.mbed.com/docs/latest/reference/contributing-target.html

Let me know if you have any questions!

- Jenny, team Mbed