cancel
Showing results for 
Search instead for 
Did you mean: 

Combine USART and USB for bootloader selection?

MBC
Associate III

I had a passing thought. I have two pins that I can connect to a PC in my enclosure. I'd like to use USB OR USART. I'd like the PC to select.

My idea was to tie the pins together and let the bootloader's selection process pick the correct one on the correct start signal (USB seems to be cable detected, and USART seems to be receives 0x7F.

I'd need to test it, but something like this possible where using USB -OR- UART on my mating device or PC would allow the bootloader to select the correct one (in which case it shuts the other one off and proceeds setting up and the rest of the process).

 

MBC_0-1696549765205.png

I can't tell if there is anything to this idea, and if there is, if this is backwards. I assume "CABLE DETECT" on USB means D+ high and D- low. So in that case, I would probably want USART TX to be tied to D+, because TX is high-Z until a valid RX is received right? In that case, I could manipulate UART RX / D- all I like and the bootloader shouldn't detect this as USB cable / data.

Is there anything to this?

1 ACCEPTED SOLUTION

Accepted Solutions

> let the bootloader's selection process pick the correct one

You may have more faith in the "bootloader selection process" than it deserves.

> I assume "CABLE DETECT" on USB means D+ high and D- low.
> TX is high-Z until a valid RX is received right?

There are too many shady areas in the bootloader for these to be said definitively, just from reading the documentation.

One way to approach this would be to get this approved by ST, if you are that kind of customer. Other is to disassemble the bootloader.  But I personally would simply not do this.

JW

View solution in original post

2 REPLIES 2

> let the bootloader's selection process pick the correct one

You may have more faith in the "bootloader selection process" than it deserves.

> I assume "CABLE DETECT" on USB means D+ high and D- low.
> TX is high-Z until a valid RX is received right?

There are too many shady areas in the bootloader for these to be said definitively, just from reading the documentation.

One way to approach this would be to get this approved by ST, if you are that kind of customer. Other is to disassemble the bootloader.  But I personally would simply not do this.

JW

Piranha
Chief II

I assume "CABLE DETECT" on USB means D+ high and D- low.


Haven't you thought about... just looking up the documentation or just a quick search?
https://www.beyondlogic.org/usbnutshell/usb2.shtml#SpeedIdentification

And the USART Rx pin needs a pull-up also.

Totally agreed to Jan about the system bootloader. 

Edited to adhere to community guidelines.