2023-10-11 06:33 PM
I'm working on an application where the amount of wires is limited. In order to update firmware, the only thing I will have is a single half-duplex RS485 transceiver connected to the UART. I was going to connect this to a single UART pin in single-wire (half-duplex) mode.
Is there any way to make this work with the built-in bootloader?
2023-10-11 07:39 PM
interesting question, how do you manage the direction (Tx or Rx) for UART?
2023-10-13 05:10 PM
I'm not totally familiar with how the bootloader works. Is there a way to update the code using only one way communication (programmer -> MCU)? Or does the bootloader configuration need to read things from the MCU as well?
2023-10-14 06:59 AM
I suggest you read the document: AN2606 STM32 microcontroller system memory boot mode.
STM32 microcontroller system memory boot mode - Application note
2023-10-14 11:01 AM
Hi jiangfan,
I looked through that document, and it mostly talks about how to ente bootloader mode. It doesn't say anything about the host being required to read certain packets. Could you explain why read access to the MCU is required? That is, why a one way connection from the host to the MCU wouldn't work?
2023-10-15 07:15 AM
2023-10-15 07:50 AM
Right, the protocol is ping-pong / command/response in nature but is a) not accommodative of turn-around time, and b) not accommodative of loop-back echo that you see where RX-TX are effectively bonded.
To deal with specifics of YOUR HARDWARE you'll likely want your own loader, which you subsequently don't erase, to manage the field update of your equipment.
Or that you use enough of the protocol to push a staged loader into RAM that's more situationally aware, and call that for the primary delivery of the update.