4 years, 11 months ago.

Can not use the serial port of nucleo-f412zg on ubuntu 16.04

Hi, I have bought a nucleo-f412zg board, and plugin the usb cable in the computer, then I compile the Nucleo-printf example, and save the .bin file to the board. The LED1 blinks very well, but the serial software (cutecom) of my computer can't receive any message. Is there any way to solve this problem? P.S. The OS of my computer is ubuntu 16.04, 32bit.

Hi, I do not have an experience with any Linux platform but your description looks like you do not have a driver for the ST-link installed.

posted by Jan Kamidra 20 May 2019

Hi, Jan Kamidra, thank you for telling me the points. I have not install the driver of st-link on ubuntu. After installing the driver according to this page "https://github.com/texane/stlink", the serial port works very well. Best Regards.

I paste the steps hopes for helping others using ubuntu:

sudo apt-get install libusb-1.0
sudo apt-get install cmake
sudo apt-get install libgtk-3-dev 
git clone https://github.com/texane/stlink.git
cd stlink
make release
make debug
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
cd Release; sudo make install;sudo ldconfig
cd  ../..                   (return to the path of stlink)
sudo  cp  etc/udev/rules.d/*  /etc/udev/rules.d/
udevadm control --reload-rules
udevadm trigger

After the steps above, the cutecom works. P.S. use "dmesg|grep ttyS*" to list the serial ports, in my case, the port of my board is ttyACM0, then use "sudo chmod 666 /dev/ttyACM0", and in the cutecom software, typing "/dev/ttyACM0" in Device section.

posted by wang gaoteng 20 May 2019
Be the first to answer this question.