Page 1 of 4

Linux serial_posix vs. Windows serial_w32

Posted: Wed Apr 27, 2022 9:05 am
by simpleboy
My program successfully uploaded on both windows and linux OS using FTDI serial uploader. But upon executing it, the program seems to crash or pause on the linux one. How can this be?

Re: Linux serial_posix vs. Windows serial_w32

Posted: Tue May 17, 2022 12:20 pm
by fpiSTM
No idea. Without more details hard to help.

Re: Linux serial_posix vs. Windows serial_w32

Posted: Tue May 17, 2022 1:17 pm
by ag123
it is in the Wiki in the FAQ
https://github.com/stm32duino/wiki/wiki/FAQ#linux
https://github.com/stm32duino/wiki/wiki ... itor-fails

create a udev rules file e.g. /etc/udev/rules.d/45-stm32duino.rules add a line like

Code: Select all

ATTRS{idProduct}=="5740", ATTRS{idVendor}=="0483", MODE="664", GROUP="plugdev" SYMLINK+="stm32duino" ENV{ID_MM_DEVICE_IGNORE}="1"

Re: Linux serial_posix vs. Windows serial_w32

Posted: Sat May 21, 2022 2:51 am
by simpleboy
ag123 wrote: Tue May 17, 2022 1:17 pm it is in the Wiki in the FAQ
https://github.com/stm32duino/wiki/wiki/FAQ#linux
https://github.com/stm32duino/wiki/wiki ... itor-fails

create a udev rules file e.g. /etc/udev/rules.d/45-stm32duino.rules add a line like

Code: Select all

ATTRS{idProduct}=="5740", ATTRS{idVendor}=="0483", MODE="664", GROUP="plugdev" SYMLINK+="stm32duino" ENV{ID_MM_DEVICE_IGNORE}="1"
I did what you suggest. Created rules in udev, but still the problem occur.

Image

maple:

Code: Select all

ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", MODE="664", GROUP="plugdev" SYMLINK+="maple", ENV{ID_MM_DEVICE_IGNORE}="1"
stm32duino:

Code: Select all

ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", MODE="664", GROUP="plugdev" SYMLINK+="stm32duino", ENV{ID_MM_DEVICE_IGNORE}="1"
stm32flash:

Code: Select all

ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", MODE="664", GROUP="plugdev" SYMLINK+="stm32flash", ENV{ID_MM_DEVICE_IGNORE}="1"

Re: Linux serial_posix vs. Windows serial_w32

Posted: Sat May 21, 2022 3:04 am
by simpleboy
fpiSTM wrote: Tue May 17, 2022 12:20 pm No idea. Without more details hard to help.

Here's a sample of successful uploading via FTDI USB serial programmer on Linux OS:
Image

When I check the serial monitor, the program freeze:
Image


But when I try to upload it via Arduino IDE using windows OS, the program runs smoothly.

Re: Linux serial_posix vs. Windows serial_w32

Posted: Sat May 21, 2022 4:05 am
by ag123
in Linux

run

Code: Select all

dmesg
look for the vid/pid when your stm32duino or libmaple (roger's core) device is connected.
That same vid/pid needs to be in the udev config file. you can have multiple different definitions for different vid/pids.
restart udev or restart your pc

and make sure you have selected USB (CDC) Serial from the menu as your serial device (stm32duino core).

Re: Linux serial_posix vs. Windows serial_w32

Posted: Sat May 21, 2022 4:57 am
by fpiSTM
Which core you used?
If it is stm32 core, it sounds strange it use stm32flash or you used a very older version?

Re: Linux serial_posix vs. Windows serial_w32

Posted: Wed May 25, 2022 2:49 am
by simpleboy
fpiSTM wrote: Sat May 21, 2022 4:57 am Which core you used?
If it is stm32 core, it sounds strange it use stm32flash or you used a very older version?
Yes I'm using stm32 core version 1.5.0. A very old version because my firmware has a lot of dependencies on that version.

Re: Linux serial_posix vs. Windows serial_w32

Posted: Wed May 25, 2022 2:57 am
by simpleboy
ag123 wrote: Sat May 21, 2022 4:05 am in Linux

run

Code: Select all

dmesg
look for the vid/pid when your stm32duino or libmaple (roger's core) device is connected.
That same vid/pid needs to be in the udev config file. you can have multiple different definitions for different vid/pids.
restart udev or restart your pc

and make sure you have selected USB (CDC) Serial from the menu as your serial device (stm32duino core).
On running "dmesg" this is what I got:

Code: Select all

[ 3536.516276] usb 2-1.2: new full-speed USB device number 3 using ehci-pci
[ 3536.635855] usb 2-1.2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[ 3536.635859] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3536.635861] usb 2-1.2: Product: FT232R USB UART
[ 3536.635863] usb 2-1.2: Manufacturer: FTDI
[ 3536.635865] usb 2-1.2: SerialNumber: A50285BI
[ 3536.793936] usbcore: registered new interface driver usbserial_generic
[ 3536.793944] usbserial: USB Serial support registered for generic
[ 3536.802621] usbcore: registered new interface driver ftdi_sio
[ 3536.802634] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 3536.802686] ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
[ 3536.802723] usb 2-1.2: Detected FT232RL
[ 3536.805461] usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
I think I set the vid/pid correctly. What do you think is the problem?

Re: Linux serial_posix vs. Windows serial_w32

Posted: Wed May 25, 2022 5:03 am
by ag123
you did not compile with USB (CDC) Serial selected.
USB Serial from your board did not appear in dmesg

you can actually disconnect the FTDI dongle and just connect your stm32 board to usb.
a USB Serial connection should appear in dmesg