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.
9 years, 9 months ago.
Question about porting MBED code to custom developed board
I am new to mbed. I have understood that the online compiler allows rapid programming of the mbed enabled boards described in the platform section.
However when I decide to design my own board, how can be used the mbed code? For example, let's say I buy a ST Nucleo L152RE board that is mbed enabled and develop a program and the online compiler produces the .bin file to be uploaded on the Nucleo board. When the prototyping phase has ended I decide to build my own electronic board featuring the same microcontroller as the development board (STM32L152RET6 in this case) and all the interconnection that are used in my code. In this case I have not the ST-Link port thus programming must be performed with the programmer at the JTAG port. Is there any way to use the mbed code for the new developed board? if yes, how?
Thanks.
5 Answers
9 years, 9 months ago.
For nRF51822 based PCBs I was able to use FOTA to load mbed compiled code to non-mbed platforms:
Maybe similar is possible for some other MCUs?
9 years, 9 months ago.
The ST-Link part of the nucleo can be used to program the processor on your own board. All it takes is a few pins for the SWD programmer port. Alternatively you can use an external programmer such as a standalone ST-Link or a Segger JLINK. Most platforms also support some kind of serialport bootloader as alternative.
The same approach is possible with the other mbed platforms eg the NXP devices. Some of those (eg LPC1549) also allow programming through the USB port of the target processor. It will show up as a USB stick when you boot it while pressing a special key. Just delete the file you see on the stick, drag and drop the new bin, reset and go.
9 years, 9 months ago.
A while ago now but I only use the Mbed boards as a programmer for my own boards. See here:
http://developer.mbed.org/cookbook/Prototype-To-Hardware-KL25Z
The same should be for the ST boards (standard SWD interface).
9 years, 9 months ago.
The STM32 has a serial bootloader. Look at http://wiki.eluaproject.net/STM32F103 , this is a nice presentation of several easy tools. Some time ago I used http://github.com/jsnyder/stm32loader which is compatible with Linux. I used this to test elua . I hope this can give you some ideas.
9 years, 9 months ago.
If you don't own a JTAG debugger, you can use the built-in bootloader (refer to the datasheet to the datasheet, read about the boot mode and the BOOT pins for STM32) and you can use FlashMagic to upload your code through one of the serial ports (again, refer to the datasheet).