Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED} Nucleo need to run screen before minicom for work.

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
lekto
Apprentice
Apprentice
Posts: 231
Joined: Sat Sep 20, 2014 6:48 pm
Location: Ancient Rome

[SOLVED} Nucleo need to run screen before minicom for work.

  • Quote

Post by lekto » Fri Mar 06, 2026 4:08 pm

Hi, I recently bought STM32 Nucleo (F401RE) to learn Zephyr. Nucleo boards connect to a PC with only USB and have build in programmer, debugger and serial console over it. Because Zephyr development uses package manager (West) that is not available in Gentoo and it needs to download over 20G of stuff and put them into home directory I've decided to not use my main machine, but an older laptop were I can make a mess in the home directory: Dell D630 (Intel Core 2 Duo T7250 with 4GB of RAM). I've successfully run blinky example (blinking LED on board), but I have an issue with running hello_world (hello world over serial).
When I run minicom (--device /dev/ttyACM0 --baud 115200) it prints few random characters [1]. I've confirmed with oscilloscope that baud is correct (width of bit slightly less than 10µs), tried every USB port on the laptop and different cable, but nothing changed. Then I tried two other machines and it just worked [2]. Then I've tried screen (/dev/ttyACM0 115200) and it worked without an issue, and even minicom started to work, until I unplugged it and it stopped working again. So, there is something that causes Nucleo's serial port on minicom to not work on that one particular machine unless I run screen before. I tried to run setserial (-a /dev/ttyACM0) to check if there is any difference between before and after screen, but I don't see any [3]. Dmesg looks same on every machine [4]. How to fix this?

[1]

Code: Select all

Welcome to minicom 2.10

OPTIONS: I18n
Compiled on Feb 15 2026, 11:53:04.
Port /dev/ttyACM0, 16:42:38 [F]

Press CTRL-A Z for help on special keys

�j��|3�
[2]

Code: Select all

Welcome to minicom 2.10

OPTIONS: I18n
Compiled on Apr  3 2025, 22:04:57.
Port /dev/ttyACM1, 16:41:52 [F]

Press CTRL-A Z for help on special keys

*** Booting Zephyr OS build v4.3.0-7117-g6006d5c3a5ba ***
Hello World! nucleo_f401re/stm32f401xe
[3]

Code: Select all

/dev/ttyACM0, Line 0, UART: unknown, Port: 0x0000, IRQ: 0
        Baud_base: 0, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal
[4]

Code: Select all

[ 7124.007572] usb 1-2: new full-speed USB device number 15 using xhci_hcd
[ 7124.374853] usb 1-2: New USB device found, idVendor=0483, idProduct=374b, bcdDevice= 1.00
[ 7124.374856] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7124.374857] usb 1-2: Product: STM32 STLink
[ 7124.374858] usb 1-2: Manufacturer: STMicroelectronics
[ 7124.374859] usb 1-2: SerialNumber: 066BFF554869774867232444
[ 7124.528867] usb-storage 1-2:1.1: USB Mass Storage device detected
[ 7124.528913] scsi host11: usb-storage 1-2:1.1
[ 7124.534873] cdc_acm 1-2:1.2: ttyACM1: USB ACM device
[ 7125.550746] scsi 11:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[ 7125.550810] sd 11:0:0:0: Attached scsi generic sg1 type 0
[ 7125.554065] sd 11:0:0:0: [sdb] 1096 512-byte logical blocks: (561 kB/548 KiB)
[ 7125.554255] sd 11:0:0:0: [sdb] Write Protect is off
[ 7125.554256] sd 11:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 7125.554444] sd 11:0:0:0: [sdb] No Caching mode page found
[ 7125.554445] sd 11:0:0:0: [sdb] Assuming drive cache: write through
[ 7125.606488] sd 11:0:0:0: [sdb] Attached SCSI removable disk
Last edited by lekto on Sun Mar 08, 2026 11:49 am, edited 1 time in total.
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Fri Mar 06, 2026 10:18 pm

Does `stty -a` show any differences between before and after running screen?
https://wiki.gentoo.org/wiki/User:Flexibeast
My most recent wiki contributions
Top
lekto
Apprentice
Apprentice
Posts: 231
Joined: Sat Sep 20, 2014 6:48 pm
Location: Ancient Rome

  • Quote

Post by lekto » Sat Mar 07, 2026 6:42 am

Running stty -a --file=/dev/ttyACM0:

when board was just connected:

Code: Select all

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
when I run minicom --device /dev/ttyACM0 --baud 115200:

Code: Select all

ispeed 9600 baud; ospeed 0 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
When I closed minicom:

Code: Select all

ispeed 9600 baud; ospeed 0 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
When I run screen /dev/ttyACM0 115200:

Code: Select all

stty: /dev/ttyACM0: Device or resource busy
When I killed screen:

Code: Select all

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 100; time = 2;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
When I run minicom again:

Code: Select all

ispeed 230400 baud; ospeed 0 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
Top
lekto
Apprentice
Apprentice
Posts: 231
Joined: Sat Sep 20, 2014 6:48 pm
Location: Ancient Rome

  • Quote

Post by lekto » Sat Mar 07, 2026 7:00 am

Looks like this is a minicom-2.10 bug, because when I upgraded it to 2.11.1 it started working:

Code: Select all

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Sat Mar 07, 2026 7:13 am

Comparing the last two groups of output, there are a number of differences between the two, but a particular difference that stands out is `-iexten` (i.e. 'iexten' option disabled) vs `iexten` (i.e. option enabled): as described in the stty(1) man page, iexten "enable[s] non-POSIX special characters". i'm wondering if that's the setting making the difference? What settings does it have on the machines where there's no issue? What happens if you use stty(1) to modify that setting?
https://wiki.gentoo.org/wiki/User:Flexibeast
My most recent wiki contributions
Top
lekto
Apprentice
Apprentice
Posts: 231
Joined: Sat Sep 20, 2014 6:48 pm
Location: Ancient Rome

  • Quote

Post by lekto » Sat Mar 07, 2026 8:12 am

On a working machine:

Code: Select all

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
Changing iexten doesn't change anything.
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2187
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Sat Mar 07, 2026 1:49 pm

I guess it have something to do with "speed". The buggy minicom seems have problem setup baud rate.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Sat Mar 07, 2026 4:02 pm

I'm using another board (NXP i.MX 93 FRDM board) with the same built-in USB to serial chip. Minicom is flawless with this board. The one difference in my setup is that I've configured the serial port in the built-in configuration dialog rather than specifying it on the command line. This one is a bit hard to understand, but I'm giving it some thought.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56108
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Mar 07, 2026 5:29 pm

lekto,

Go into minicoms setup

Set the serial port, baud rate, start bits data bits and parity there. That's the 115200,8N1 or whatever you need.

In another menu, set handshaking to None. You won't have the wires for hardware handshaking and with Xon, Xoff its not possible to send binaries.
You have Xon/Xoff set now, that's the

Code: Select all

start = ^Q; stop = ^S;
If you get some rubbish that includes the stop character, you have are unlikely to get a start character, so it all appears to stop. It does.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
sam_
Developer
Developer
User avatar
Posts: 2822
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Sun Mar 08, 2026 4:17 am

lekto wrote:Looks like this is a minicom-2.10 bug, because when I upgraded it to 2.11.1 it started working:

Code: Select all

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc
Ugh, sorry, I thought I'd stablereq'd 2.10-r1 already. Done now. It's a glibc-2.42 incompatibility fixed in >=2.10-r1.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic