cancel
Showing results for 
Search instead for 
Did you mean: 

Programming brand new STM32L432 over USB with factory bootloader

PR.4
Associate II

Hello,

we want to program the MCU STM32L432 in our final product via USB-Interface, mainly in order to save pins due to limitid space.

Assuming we have a brand new microprocessor:

Refering to the reference manual RM0394 p. 74 and application note AN2606, I assume, that it is possible to program a brand new STML432 directly over USB by using it's factory bootloader.

A bit more on detail: If the BOOT0-Pin is pulled low, and the MCU is powered up for the first time, the MCU boots from system memory, which means, the facory-bootloader is executed. If (only) a usb-connection is detected (AN2606 page 277), the bootloader uses the usb-interface for DFU execution, which means, the mcu can directly be programmed over it's usb-interface.

Is that right so far?

Another direcly related question:

It is stated in RM0394 on page 74 in the second row of the table, that system memory is selected as boot area if BOOT0-pin==0 && nSWBOOT0==1 && Main Flash == empty.

What is the state of the nSWBOOT0-Bit in the FLASH_OPTR of a brand new MCU at first power-up? According to RM0394 page 107 the default value is "x". So is it undefined?

UPDATE: "Register bits 0 to 31 are loaded with values from Flash

memory at OBL." [RM0394]. So the value comes from the register 0x1FFF7800, which has the value 0xFFEF F8AA, fixed at chip-production time. --> nBOOT0 == 1, nSWBOOT0 == 1, nBOOT1 == 1.

Kind regards and thanks for help!

Patrick

2 REPLIES 2
Andreas Bolsch
Lead II

Please read the whole chapter, not just about FLASH_OPTR. Section 3.4.1 answers your question.

PR.4
Associate II

Thank you for your answer, and excuse me for my late response. I've read the chapter many times. Perhaps I should have expressed my question somewhat differently: "Did anyone tried that out..."... The point is, that I'm new to that topic, and therefore I wanted to be as sure as possible before producing anything.... Anyway.... Now we have tried it out with a small prototype-series and fortunately it works like expected 🙂