Serial baudrate limited to 115200 in Wine?

Questions about Wine on Linux
Locked
aklimaj
Newbie
Newbie
Posts: 3
Joined: Tue Jan 17, 2023 7:08 pm

Serial baudrate limited to 115200 in Wine?

Post by aklimaj »

I am trying to script firmware updates for a U-Blox GPS. The firmware update program needs to be run in Wine and it appears I am unable to use any baudrate higher than 115200 in Wine.

Is there some way to increase the baudrate of serial adapters within Wine? On native Ubuntu, I can use the same serial interface up to 921600 baud.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Serial baudrate limited to 115200 in Wine?

Post by jkfloris »

Wine should detect the speed. You can check this with:

Code: Select all

WINEDEBUG=+comm wine program.exe
aklimaj
Newbie
Newbie
Posts: 3
Joined: Tue Jan 17, 2023 7:08 pm

Re: Serial baudrate limited to 115200 in Wine?

Post by aklimaj »

Thanks for the tip. When I run the program with "WINEDEBUG=+comm" at the start it prints out this.

0.0 - Trying to open port /dev/serial/by-id/usb-SEGGER_J-Link_000851002631-if00
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_QUEUE_SIZE 0x31fb34 8 (nil) 0 0x31fad4
0009:fixme:comm:set_queue_size insize 4096 outsize 32768 unimplemented stub
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_TIMEOUTS 0x31fb6c 20 (nil) 0 0x31fae4
0009:trace:comm:BuildCommDCBAndTimeoutsA (baud=9600 parity=N data=8 stop=1,0x31fb80,(nil))
0009:trace:comm:BuildCommDCBAndTimeoutsW (L"baud=9600 parity=N data=8 stop=1",0x31fb80,(nil))
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_BAUD_RATE 0x31fb10 4 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_LINE_CONTROL 0x31fb0d 3 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_HANDFLOW 0x31fb1c 16 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_CHARS 0x31fb16 6 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_PURGE 0x31faa4 4 (nil) 0 0x31fa24
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f8c0 20 0x31f8b8
0.0 - Setting baudrate to 38400
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_BAUD_RATE (nil) 0 0x31fb00 4 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_LINE_CONTROL (nil) 0 0x31fafd 3 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_HANDFLOW (nil) 0 0x31fb0c 16 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_CHARS (nil) 0 0x31fb06 6 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_BAUD_RATE 0x31fb30 4 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_LINE_CONTROL 0x31fb2d 3 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_HANDFLOW 0x31fb3c 16 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_CHARS 0x31fb36 6 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958

I get this message spammed to the console while its running.

0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958

Then when it completes

125.9 CRC check SUCCESS
125.9 Rebooting receiver
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_PURGE 0x31fbdc 4 (nil) 0 0x31fb64
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f9f0 20 0x31f9e8
125.9 Firmware Update SUCCESS
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Serial baudrate limited to 115200 in Wine?

Post by jkfloris »

It looks like you are using ubxfwupdate
0.0 - Setting baudrate to 38400
What happens if you pass a higher baudrate?
aklimaj
Newbie
Newbie
Posts: 3
Joined: Tue Jan 17, 2023 7:08 pm

Re: Serial baudrate limited to 115200 in Wine?

Post by aklimaj »

Sorry the program first sets the baud rate to 38400, then later increases to 115200. I am unable to get anything higher than 115200 working with wine. When I am in Windows with the same hardware setup, I can get 230400.

0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f940 20 0x31f938
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f940 20 0x31f938
0.5 - Not merging anything
0.5 - Flash size: 2097152
0.5 - Flash block: 512 x 4096
0.7 - Setting baudrate to 115200
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_BAUD_RATE (nil) 0 0x31fb10 4 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_LINE_CONTROL (nil) 0 0x31fb0d 3 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_HANDFLOW (nil) 0 0x31fb1c 16 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_CHARS (nil) 0 0x31fb16 6 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_BAUD_RATE 0x31fb40 4 (nil) 0 0x31fad4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_LINE_CONTROL 0x31fb3d 3 (nil) 0 0x31fad4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_HANDFLOW 0x31fb4c 16 (nil) 0 0x31fad4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_CHARS 0x31fb46 6 (nil) 0 0x31fad4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_PURGE 0x31f6a4 4 (nil) 0 0x31f624
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f4c0 20 0x31f4b8
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958


0.0 - Trying to open port /dev/serial/by-id/usb-SEGGER_J-Link_000851002631-if00
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_QUEUE_SIZE 0x31fb34 8 (nil) 0 0x31fad4
0009:fixme:comm:set_queue_size insize 4096 outsize 32768 unimplemented stub
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_TIMEOUTS 0x31fb6c 20 (nil) 0 0x31fae4
0009:trace:comm:BuildCommDCBAndTimeoutsA (baud=9600 parity=N data=8 stop=1,0x31fb80,(nil))
0009:trace:comm:BuildCommDCBAndTimeoutsW (L"baud=9600 parity=N data=8 stop=1",0x31fb80,(nil))
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_BAUD_RATE 0x31fb10 4 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_LINE_CONTROL 0x31fb0d 3 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_HANDFLOW 0x31fb1c 16 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_CHARS 0x31fb16 6 (nil) 0 0x31faa4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_PURGE 0x31faa4 4 (nil) 0 0x31fa24
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f8c0 20 0x31f8b8
0.0 - Setting baudrate to 230400
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_BAUD_RATE (nil) 0 0x31fb00 4 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_LINE_CONTROL (nil) 0 0x31fafd 3 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_HANDFLOW (nil) 0 0x31fb0c 16 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_CHARS (nil) 0 0x31fb06 6 0x31fa94
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_BAUD_RATE 0x31fb30 4 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_LINE_CONTROL 0x31fb2d 3 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_HANDFLOW 0x31fb3c 16 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_SET_CHARS 0x31fb36 6 (nil) 0 0x31fac4
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
0009:trace:comm:io_control 0x2c IOCTL_SERIAL_GET_TIMEOUTS (nil) 0 0x31f960 20 0x31f958
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Serial baudrate limited to 115200 in Wine?

Post by jkfloris »

Does it make any difference if you use \\.\COM1 instead of /dev/serial/... ?
In case that doesn't work either, file a bug.
Locked