Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:44 11 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : STM Virtual Com Port

Author Message
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 01:00am 26 Jan 2025
Copy link to clipboard 
Print this post

Is anyone else having problems with the STM virtual comport for USB. I have not been able to get a console connection to my STM32F4VE boards via the USB connector. I have tried 3 different PC's running different versions of Windows 10 but all complain of the USB device is not recognized. I have downloaded the "LATEST" driver from ST but unfortunately they are WIN7 and WIN8 variants. I have deleted the existing drivers and installed the supplied with admin rights but still have not had any success.

Any help with this problem would be much appreciated.

OA47
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2606
Posted: 01:28am 26 Jan 2025
Copy link to clipboard 
Print this post

The only time I had this issue on a F4 was due to forgetting to put the jumper back after a firmware update.

If that isn't the problem and the built-in W10 drivers don't recognize it it may mean the firmware is corrupted.

Can the STM32CubeProgrammer recognize it?
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 01:39am 26 Jan 2025
Copy link to clipboard 
Print this post

  Quote  Can the STM32CubeProgrammer recognize it?


I have recently updated the firmware on two of these units with success from STM32CubeProgrammer and my next step was to load the program on them and that is where I am stuck without console access. (I still have the problem on units that were flashed months ago}

OA47
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1000
Posted: 01:42am 26 Jan 2025
Copy link to clipboard 
Print this post

Have you tried an MMBasic reset. i.e. K1 (PE3 to GND) down when applying power. I have many times thought I killed an F4 only to have it revived by an MMBasic reset.
Have you loaded new firmware? The existing program is not deleted so if new commands are in the firmware the program can be nonsense to the new firmware so will need to be delete via MMBasic Reset. If you are trying the PC13Reset version you need to GND PC13 to get the MMBasic reset.
Edited 2025-01-26 11:46 by disco4now
Latest F4 Latest H7 FotS
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 02:25am 26 Jan 2025
Copy link to clipboard 
Print this post

I have one of the PC13RESET units in front of me and grounding that pin on power up has made no difference. I still get USB Device not recognised.

(Time passes)

Gathered up some more boards and did some more investigation. A PC13reset unit I programmed a while ago works ok, console works and program boots. Another with MMBV 5.05 works also. I have come the conclusion that the first bad unit is bad becuase the PE3 was used as an input and has reset the unit and the other PC13RESET unit has been corrupted when I updated the firmware.

I have multiple units showing the same fault for different reasons and sent me off on a wild goose chase.

Will keep plodding

Thankyou
OA47
 
erbp
Senior Member

Joined: 03/05/2016
Location: Australia
Posts: 195
Posted: 02:38am 26 Jan 2025
Copy link to clipboard 
Print this post

Hi,

I find the mini USB connector used on F4 modules to be of particularly poor quality and the cause of many connection issues.

My preferred method for F4 modules is to use an external power source (USB charger / power adapter). Use a good quality USB (to mini USB) power lead and use the on-board mini USB connector for power ONLY - NOT for the console connection.

For the console use a Serial to USB Adapter (or Microbridge if you have one of those). The F4 has a Serial Console connector (J6 - 4 pins - near the micro SD Card socket). Connect the GROUND, TX and RX pins from J6 to the Serial to USB adapter - remembering to cross over the TX and RX connections between F4 and Adapter boards. Do NOT connect anything to the 5v or 3v3 pins on the adapter. Connect the USB cable from the adapter to the PC, the adapter will be powered from the PC, but the F4 will be powered from the external USB power source.

By default the F4 firmware is configured to use USB Console. To switch to use the Serial Console, hold the K0 switch during power on (may require pressing the RESET button to get the command prompt to be displayed the first time after this). The Console setting is persisted, so will remain set to Serial until you use the appropriate Option command to switch it back to USB or reload firmware.

I find I get 100% connection every time using this method, attempting to use the on-board mini USB connector for both power AND Console gives me almost 100% FAILURE! Strangely enough using the on-board mini USB connector to load/re-load firmware seems to work OK most of the time.

Hope this helps.
Phil.
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 02:41am 26 Jan 2025
Copy link to clipboard 
Print this post

I have just noticed an issue with (PC13Reset) in that if I set OPTION AUTORUN ON it is lost when power is removed.




After applying power.




OA47
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2606
Posted: 02:43am 26 Jan 2025
Copy link to clipboard 
Print this post

I vaguely remember a flat coin cell causing a problem.**
Replaced the cell holder with a CR2032 one. Lasts much longer.

** I guess all coin cells are flat but you know what I mean ;)
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1000
Posted: 03:54am 26 Jan 2025
Copy link to clipboard 
Print this post

A grounded PE3 will switch to the Serial Console and disconnect USB console on the normal firmware. Should not do anything on the PC13Reset software.

Options are still stored in battery backup ram so option AUTORUN is lost if battery is gone. Use MM.STARTUP to ensure a dead battery is not fatal.

SUB MM.STARTUP
OPTION AUTORUN ON
END SUB
Latest F4 Latest H7 FotS
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 03:58am 26 Jan 2025
Copy link to clipboard 
Print this post

New battery seems to have been the answer to the AUTORUN issue.

  Quote  Options are still stored in battery backup ram so option AUTORUN is lost if battery is gone. Use MM.STARTUP to ensure a dead battery is not fatal.

SUB MM.STARTUP
OPTION AUTORUN ON
END SUB


Have added to the code.

Thankyou
OA47
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 04:39am 26 Jan 2025
Copy link to clipboard 
Print this post

Unfortunately I have had to scrap another F4 board, this one programs and verifies on
STM32CubeProgrammer but will not communicate via the USB or the serial console port.
I have lost 4 of these boards all with low level issues over the past few years.

OA47
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5054
Posted: 11:43am 26 Jan 2025
Copy link to clipboard 
Print this post

Hi OA47,

I also scrapped one F4 that would program nice using Cube, but in essence would not communicate on USB when running MMBasic. UART serial worked. After days of testing, and measuring, no solution found. In the waste bin...

Volhout
Edited 2025-01-26 21:44 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1094
Posted: 05:50am 28 Jan 2025
Copy link to clipboard 
Print this post

  Quote  A grounded PE3 will switch to the Serial Console and disconnect USB console on the normal firmware

On checking on a F4 board & the manual, I'm sure that it is PE4 that is connected to K0. Thanks for the info though. (There's lots of good stuff in the Manual).
Can PE4 be left permanently grounded or can it only be a momentary connection during boot up?

Good info on MM.STARTUP. Thanks.

I also have lots of trouble with the mini USB port on my boards. Using the serial port usually solves the problem although I have a powered USB hub which sometimes plays silly buggers with connecting. I have to use a USB socket on the front of my PC to get a connection.

I had one lose everything a while ago. Replaced the battery & reprogrammed OK. It was dead again the other day. Opened up the case it was in & found that my recently replaced battery had fallen out. Clicked it back in properly & now OK. I have now got 2032 holders so I will wire one of those in. This one actually connected via the USB yesterday but not today.....  

Thanks OA47 for the thread. Sorry to hear about the dead board(s). I've a number of dead ones as well.

GPS Question. Is there a flag or something set when the incoming GPS data has been parsed by the firmware & is ready for interrogation? Normal serial inputs can have an interrupt set. Probably not needed as the data is virtually continuous. Just asking

Brian
ChopperP
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025