rs485 half-duplex bootloader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 12:34 PM
I have an RS585 1/2 duplex transceiver hooked to USART2 configured for hardware flow control (RS485) on an STM32L412 micro.
Is it possible to program a virgin part using the STM32CubeProgrammer, and to later do a firmware update over this comm channel?
I searched the forums but did not find a definitive answer.
Solved! Go to Solution.
- Labels:
-
STM32CubeProgrammer
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:49 PM
Very nice thought, that would preserve the STM32Programmer capability.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 12:50 PM
>>I searched the forums but did not find a definitive answer.
Probably because its one of those "depends" situations. The protocol is admittedly half-duplex, but there is no consideration of any turn-around time, or reflection / echo-back of the data sent in response.
Also the protocol's method of auto-bauding is hair-triggered. It's not receiving the "0x7F" data pattern as much as it is timing the edges. If the wiring/transceivers are noisy it is apt to incorrectly determine the baud rate, and you need to reset and start-over.
What is perhaps more practical is your own small loader which has awareness of your hardware, and you can control expectations.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 12:52 PM
Just look in ds , boot modes :
So no "automatic" boot by the built in bootloader on rs485 here.
-> refer to AN2606 for bootmodes.
But you can write your own bootloader, that uses anything, also ...rs485 .
So for your question: yes, is possible, but you have to write this special bootloader.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:02 PM
How do you go about writing your own bootloader for a virgin part to be programmed over the RS485 half-duplex comm port?
How do you go about writing you own bootloader in general?
How do you get into into FLASH?
etc, etc, etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:09 PM - edited ‎2024-01-18 1:22 PM
>Is it possible to program a virgin part using the STM32CubeProgrammer, and to later do a firmware update over this comm channel?
You wrote it yourself - first time you program it by SWD / debug or boot connection, with STM32CubeProgrammer or CubeIDE.
Then , if you have your program and own bootloader on chip, it can start your bootloader , on rs485 or elsewhere.
And "how to ..." , look what others did, maybe here:
https://github.com/viktorvano/STM32-Bootloader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:30 PM
>>How do you go about writing your own bootloader for a virgin part to be programmed over the RS485 half-duplex comm port?
You'd design a board with final test programming, and debug in mind at the outset. Having a connector or pads to facilitate a SWD connection.
>>How do you go about writing you own bootloader in general?
Presumably a topic for embedded software engineering courses these days. As I recall Elecia White's 'Making Embedded Systems' had some coverage of the topic. ST has assorted IAP examples using different interfaces. You could perhaps work it from the angle of the protocols defined documented by ST, and how you might implement those within your own code, or use things like X-MODEM, or other protocols that might be better suited to half-duplex radio links, etc.
>>How do you get into into FLASH?
Via SWD, other supported USART, SPI or I2C for the chip in question
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:39 PM - edited ‎2024-01-18 1:41 PM
Put another STM32 board or a similar device in the middle. Wire out two UARTs, one in normal full duplex mode to the PC with CubeProgrammer, another to RS-485 adapter to your target board. Write a program to forward all received data from both UARTs to the other UART. Buffer the data as needed to ensure the delay to switch the RS-485 direction. Start it from listening for the 7F bytes from the target.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:49 PM
Very nice thought, that would preserve the STM32Programmer capability.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:53 PM
Oops, I'm wondering about how the 1/2 duplex side bootloader would manage the DE, and RE lines?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-18 1:55 PM
I think there’s still a problem w/ this notion in that the bootloader is not made to drive the ½ duplex transceiver,
So a custom bootloader would still be needed, right?
