Linux serial_posix vs. Windows serial_w32

Post here first, or if you can't find a relevant section!
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Linux serial_posix vs. Windows serial_w32

Post 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?
by simpleboy » Tue Aug 16, 2022 5:28 am
Hello all,

Just to update on this issue. I have solved it already. It seems I missed out to provide modifications on my LMIC library. Problem does not occur beause my my operating system. The cause of the stall is when the program is trying to connect with the LoRaWAN network server. I just add the necessary files for my ACSIP variant. Thank you all for your help. :D :D :D
Go to full post
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

No idea. Without more details hard to help.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Linux serial_posix vs. Windows serial_w32

Post 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"
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post 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"
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post 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.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Linux serial_posix vs. Windows serial_w32

Post 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).
Last edited by ag123 on Sat May 21, 2022 5:16 am, edited 1 time in total.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

Which core you used?
If it is stm32 core, it sounds strange it use stm32flash or you used a very older version?
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post 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.
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post 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?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Linux serial_posix vs. Windows serial_w32

Post 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
Post Reply

Return to “General discussion”