2021-02-15 11:33 PM
Hi Experts,
I am planning to use stm32l431cb - as it is sufficient controller with 48 pin for my use case. Basically I am trying to find out, how to flash my code into stm32l431cb controller.
I referred to
a. https://www.st.com/resource/en/datasheet/stm32l431cb.pdf - data sheet
b. https://www.st.com/resource/en/reference_manual/dm00151940-stm32l41xxx42xxx43xxx44xxx45xxx46xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf - User manual
and could not get any clear information.
Referred to AN2606 (https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf) and this (page 32) says USART1/USART2/USART3/ (and various others like I2C, SPI etc) are supported.
Have any one used these USART for stm32l431cb? What is the procedure you followed? How do you put stm32l431cb into boot mode - I saw PH3 - BOOT0 pin - should we make it high (or low) during reset? Is there any thing else is needed? What tool is used on PC to dump the code? Any writeup/ document describing these things?
Any pointers on this - would help me.
With best regards,
Phani.
2021-02-16 12:27 AM
The integrated bootloader using UART etc.. is not needed if you use a SWD debug probe like ST-LINK. Using SWD is preferrable for bringing-up a new design and during development if you intend to debug or trace (via SWO) the code in the lab. Pull BOOT0 low for that. Check Getting started with STM32L4 Series and STM32L4+ Series hardware development as reference.
The UART... bootloader (system memory boot) comes in handy for in-the-field upgrades or initial production flashing without using a SWD debug probe, called IAP (in application programming). The firmware should already be well debugged before considering this approach. Needs BOOT0 pulled high, or you can implement a jump to to system memory under certain circumstances in your firmware.
What toolchain/IDE are you using? STM32CubeIDE comes with gcc toolchain so all gcc related commands apply like arm-none-eabi-objdump, arm-none-eabi-readelf, ...
hth
KnarfB
2021-02-16 08:48 AM
I use the st-link and SW pins so i can use the stm debugging options (like the discovery/nucleo boards do)
Are you using a stm dev board or your own design?
2021-02-16 08:56 AM
Normally BOOT0 should be pulled low for operation out of FLASH. To execute the ROM loader pull BOOT0 High at reset. Should also enter if FLASH is blank.
The STM32 UART Protocol is described in various documents, should be the Flash Loader Demonstrator for older parts, and there are open source examples. It's not that complex a protocol.
The thing to watch for would be other noisy devices attached to the other UART and interfaces the loader is checking for connectivity. A GNSS receiver spitting out NMEA sentences at startup will get the System Loader's attention more quickly than an end user.
You might want to swap the RX/TX pins around and use the USART level ability to remedy that for your own interfaces.
Providing access to SWDIO/SWCLK/NRST and SWO perhaps, is the sure-fire way of guaranteeing you can access, program and debug your design.
I use the 32-pin L432KB/KC devices.
2021-02-16 09:36 PM
Thanks a lot guys :folded_hands::folded_hands::folded_hands:. Now I have some idea on how to progress and again some questions :)
As always, your suggestions/ comments would be great help to me.
Thanks in advance.
With best regards,
Phani.
2021-02-17 12:19 AM
Hi Phani,
for reference schematics see "Getting started with STM32L4 Series and STM32L4+ Series hardware development" document.
> was thinking of using internal crystal
Thats fine unless you need more precision clocks, e.g. for the RTC. The above document has a chapter on clocks. Check also "AN2867 Application note Oscillator design guide for STM8AF/AL/S, STM32 MCUs and MPUs".
Finallay there are STM32L432KC and STM32L433 Nucleo boards which you may study or use for prototyping.
hth
KnarfB
2021-02-17 06:53 AM
To add to what Knarf already said - all ST boards have schematics and other design documentation available. You can study them all. And yes, read the AN4555.