Search found 51 matches

by STM32_Newbbe
Wed Dec 07, 2022 10:00 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

In that case, I just achieved the impossible!
I must be the most terrific hacker of the whole planet :twisted:
by STM32_Newbbe
Mon Dec 05, 2022 8:59 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

Although it is not what I want, I thank you for this nice idea! Might really come in useful someday :)

What I wanted is activate the CDC USB Serial of Nucleo-L4R5, and simutaneously use some differente Usarts as well.
by STM32_Newbbe
Mon Dec 05, 2022 6:21 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

GonzoG wrote: Fri Dec 02, 2022 2:09 pmNot how USB works.
Allright then, thats where my main mistake lies! I was too focused on this being a "serial" connection!

Thanks for explaining and clarifying. Up to now I hadn't dived into the depths of a real USB connection...
by STM32_Newbbe
Fri Dec 02, 2022 1:27 pm
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

alright, I misinterpreted "open connection" then.
I assumed that a missing cable will be treated the same as a closed / no connection

Thanks for clarifying!
by STM32_Newbbe
Fri Dec 02, 2022 12:58 pm
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

GonzoG wrote: Fri Dec 02, 2022 12:33 pm Yes.

Code: Select all

if(Serial){..}
well this works only for Serial Monitor open/closed, but not for a missing cable!
If I unplug the cable, the LED remains dark.
Only when I plug it back in, the LED blinks for e few ms and goes off again.

Not quite what I wanted
by STM32_Newbbe
Thu Dec 01, 2022 10:25 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

Alright, found out myself about if(Serial) and while(!Serial)
I indeed have to assure that something is connected or have to implement some kind of timeout

Another thought:
can I check at runtime (i.e. in my code) whether CDC USB Serial is activated?
by STM32_Newbbe
Thu Dec 01, 2022 9:53 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

Maybe Sloeber issue... That thought occured to me as well, therefore I tried it in Arduino IDE with the same result. No output on LPUART1 until I redefine the pins. Thanks for the while(!Serial); idea! Is this non-blocking, or do I have to add a timeout some way or another? It takes about 350ms, so...
by STM32_Newbbe
Thu Dec 01, 2022 9:16 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

Now I noticed that output via the VCP is not happening in the first few moments... The above code should output a startup message Serial.println("L4R5 Test starting..."); but it appears only on th STLink Serial and not on the USB VCP Serial the next loop, 1 second later is output on both c...
by STM32_Newbbe
Thu Dec 01, 2022 8:54 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

Hah! Seems like I solved it :) I have absolutely no idea why, but redefining the Rx and Tx pins has fixed it! I only added SerialLP1.setRx(PG8); SerialLP1.setTx(PG7); before SerialLP1.begin(115200); and now I have output on all serial channels ! Although I am quite happy that it works now, I really ...
by STM32_Newbbe
Thu Dec 01, 2022 8:07 am
Forum: General discussion
Topic: can USB be used to create a virtual com port?
Replies: 33
Views: 8484

Re: can USB be used to create a virtual com port?

and this are the settings for the board:

Image

Go to advanced search