2018-12-31 07:41 AM
I have been doing a lot of reading lately about the flashing process and bootloaders and not everything is clear.
The datasheet of my microcontroller says that it is stlink that enables mbed. I have confirmed that I have to upload via stlink in order for mbed to work. I uploaded an mbed program using stm32flash via uart and it didn't work. My question is why? Why does the way in which I upload firmware affect how it runs? Is there a workaround (a way to use mbed while uploading with stm32flash and uart)?
My next question has to do with the stlink firmware. As I understand it, the nucleo boards have the main microcontroller and an stm32f103cbt6 or similar for stlink. If I create a pcb and want mbed support, will I need to add this ic also? Will I need to flash stlink firmware onto it instead of the factory bootloader? Would this be doable for someone who has made pcbs in the past but is still not an expert?
Edit:
Looks like I had an error in my code and that's why flashing over uart didn't work with my mbed code. I have fixed the error and confirm that you can compile with mbed and upload over uart.
Solved! Go to Solution.
2018-12-31 08:19 AM
Hi,
The ST-LINK/V2-1 is based on dedicated STM32F103CBT6, makes the STM32 Nucleo / Discovery boards Mbed Enabled.
When you plug in an mbed Microcontroller in to your PC using USB, it appears like a USB flash disk. This small disk is presented by the mbed Interface, and allows you to save ARM microcontroller binaries you want to run directly on to the mbed, without needing drivers. Note that when you save a binary file to the mbed disk, it is not immediately loaded in to the internal microcontroller FLASH memory.
By using STM32 Flash Loader, you are able to program the flash of you mcu application without using onboard STLink. You need to place mcu in bootloader mode (ie UART) The AN2606 (STM32 microcontroller system memory boot mode) describe the process for all STM32 familly.
I don't know the STM32 device you use, usually bootloader mode is enabled when Boot0 = VDD.
Then STM32 Flash Loader can talk with internal bootloader and allow erase or programming flash memory with .s19 or .bin or .hex file (.bin generated by Mbed compiler should work)
For a custom board with Mbed enabled, you have many possibilities:
BR
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-12-31 07:51 AM
The mbed mode is you dragging-and-dropping a .BIN file into the pseudo mass storage device.
stm32flash is NOT an ST application
ST has been poked on several occasions to provide an "ST-LINK OB" type chip where you can use a F103 or F723 to implement the on-board functionality, similar to those chips from ATMEL/MICROCHIP
2018-12-31 08:19 AM
Hi,
The ST-LINK/V2-1 is based on dedicated STM32F103CBT6, makes the STM32 Nucleo / Discovery boards Mbed Enabled.
When you plug in an mbed Microcontroller in to your PC using USB, it appears like a USB flash disk. This small disk is presented by the mbed Interface, and allows you to save ARM microcontroller binaries you want to run directly on to the mbed, without needing drivers. Note that when you save a binary file to the mbed disk, it is not immediately loaded in to the internal microcontroller FLASH memory.
By using STM32 Flash Loader, you are able to program the flash of you mcu application without using onboard STLink. You need to place mcu in bootloader mode (ie UART) The AN2606 (STM32 microcontroller system memory boot mode) describe the process for all STM32 familly.
I don't know the STM32 device you use, usually bootloader mode is enabled when Boot0 = VDD.
Then STM32 Flash Loader can talk with internal bootloader and allow erase or programming flash memory with .s19 or .bin or .hex file (.bin generated by Mbed compiler should work)
For a custom board with Mbed enabled, you have many possibilities:
BR
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-12-31 08:26 AM
You can
https://www.st.com/en/development-tools/stm32cubeprog.html
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-12-31 12:25 PM
Thanks for the reply. If I understand correctly, they have been poked but have not done it?
2018-12-31 01:02 PM
Thanks for the reply. It is very informative. Is there any way to flash over uart without messing around with boot0? Maybe another bootloader?
2018-12-31 01:07 PM
Thanks for the reply. I have confirmed that stm32cubeprog works over uart. However, the board needs to be in the bootloader, correct? Is there any way to flash without messing with the boot0 pin? Maybe some bootloader that detects when it is being flashed over uart like how the default bootloader can be flashed over usb without boot0?