7 years ago.

Clean compile for custom PCB

I would like to compile a mbed-os for the device STM32L1xx without nucleo boards defined. How do I select a device without board when compiling? I only have a custom PCB with STM32L1xx series device with custom periphery.

2 Answers

7 years ago.

Please see our porting guide - https://os.mbed.com/docs/v5.6/reference/targets.html

When adding the new board, you can inherit from the MCU that is already existing.

7 years ago.

Unless you have chosen a different package than what's on the Nucleo board you just use the Nucleo board with the same exact processor. That's what i do. I have downloaded the mbed-os sources and tweak for additional customization for clocking and RTC but that's it

Bill’s approach works very well with the online compiler. You will want to do a couple of checks to make sure your custom board does not conflict with any of the resources used by the mbed firmware or the hard-wired peripherals on particular mbed-enabled board target you are using as a placeholder. For the STM nucleo boards this includes the USART used for the ST-link, the timer used for the master timer, the User LED, and PWM outputs that use the same timer as the master timer.

You can easily check for conflicts by reviewing the "PeripheralPins.c" file for the specific mbed target board you are using as a placeholder. There is a link to this file on its board page, or you can find it by downloading the mbed source files. STM has done a nice job of providing all of the pin maps in this file and commenting out pin functions that conflict with the nucleo boards. If you do have conflicts, it is pretty easy to work around them as Bill suggests - by downloading the mbed source and them uploading the edited versions to your project folder. The downside of this is that you have to manually update the mbed files if you want to keep them current with the latest mbed release.

posted by J Roth 25 Nov 2017