Skip to main content
PR.4
Associate II
July 27, 2020
Question

Programming brand new STM32L432 over USB with factory bootloader

  • July 27, 2020
  • 2 replies
  • 1064 views

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

This topic has been closed for replies.

2 replies

Andreas Bolsch
Lead III
July 27, 2020

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

PR.4
PR.4Author
Associate II
September 24, 2020

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 :)