Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 1 month ago.
Why link MBED OS to a board instead of an MCU ?
Hello, I just want to know why is MBED linked tightly to boards instad of MCUs ? If I want to use MBED to program a custom board having an STM32F405 for example, I cannot do until I define a whole new target with this MCU, despite the fact that this MCU is almost the same as the STM32F407VG (that is on the the F4DISCOVERY board). Why is it necessary to define a whole board instead of only the MCU ? My code after all will have to deal only with the MCU peripherals and pins.
1 Answer
5 years, 1 month ago.
You're sort of asking two questions. If an mbed compatible devboard uses STM32F407VG, you can use that same micro on your own board no problem. Just select the corresponding devboard in mbed. Their are usually some extra pin names in PinNames.h corresponding to components on the devboard, like LED1, etc, but this won't really affect your custom board. And then you'll need to pay attention to the way some peripherals are configured in PeripheralPins.c. Again some choices for peripheral configuration have been made based on components on the devboard, but there are alternate pin configurations you can use as well by using pin names such as PA_0_ALT1. Or if you compile from source it's easy to adjust the function of each pin. And you will need to setup the clock on your custom board in a way that is compatible with how mbed tries to setup the clock on that micro. This usually means using the internal oscillator or an external 8MHz crystal.
If you want to use a different microcontroller, then yes you have to go through the process of adding that micro to mbed.
same opinion with you. the devoleper of mbed should work with the effort to provide a mcu family specified frame but not a boarded specified.
posted by fei liu 18 Oct 2019