Skip to main content
Explorer
June 10, 2024
Solved

Can't get uart output on terminal emulator - NUCLEO-L432KC

  • June 10, 2024
  • 6 replies
  • 2702 views

I'm working with a nucleo-L432kc board. I use a mac, VSC, Platformio and I use screen as a terminal. I used MXcube to setup a UART to use the VCP. MX cube generates the code. I have followed the instructions from several online sources to get it to work, but no luck seeing any output with "screen". I must be missing something fundamental. Does anyone have working sample code for this board I can look at to see what I'm doing wrong.

    This topic has been closed for replies.
    Best answer by Karl Yamashita

    The only thing i can see wrong is that you have word length set for 7 bits instead of 8. 

    KarlYamashita_0-1718151477082.png

     

     

    I'm using the same Nucleo-L432KC dev board, added the same code you have in main.c. This is the output i get.

     

    KarlYamashita_2-1718151987127.png

     

    Are you sure you have selected the correct COM port?

     

     

     

    6 replies

    Graduate II
    June 10, 2024

    https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Projects/NUCLEO-L432KC/Examples/UART/UART_TwoBoards_ComIT/Src/main.c

    Fundermentals:

    Clocks

    Clocks for GPIO

    Clocks for UART

    Configuration of pins and associativity with UART

    Configuration of UART at the right baud rate and data format

    Use the UART plumbed to the ST-LINK/V2-1 VCP

    Check the connectivity, watch for options, links, solder bridges, contention with Arduino shield on NUCLEO-64 designs.

    Graduate II
    June 10, 2024

    Show your code. Upload your IOC file.

    mleo2Author
    Explorer
    June 11, 2024

    I've attached the .ioc and main.c

    mleo2Author
    Explorer
    June 11, 2024

    I posted the main.c and .ioc file as attachements above

    I know serial com through the USB is possible. I can upload an Arduino Serial com sketch and screen on the Mac works fine.

    Graduate II
    June 12, 2024

    The only thing i can see wrong is that you have word length set for 7 bits instead of 8. 

    KarlYamashita_0-1718151477082.png

     

     

    I'm using the same Nucleo-L432KC dev board, added the same code you have in main.c. This is the output i get.

     

    KarlYamashita_2-1718151987127.png

     

    Are you sure you have selected the correct COM port?

     

     

     

    mleo2Author
    Explorer
    June 12, 2024

    I got the 7 bit thing from one of the many sites I looked at. I thought it odd, but I tried it. I'll double check the com port as you suggest.

    Thanks for taking the time to verify my code. It helps a lot to know it can work.

    mleo2Author
    Explorer
    June 13, 2024

    So, changing the toolchain/IDE environment in STMCubeMX from EWARM ( the default ) to STMCubeIDE fixed the problem. I've been using "stm32pio" tools to convert CubeMX output to a Platfomio env. This user manual is out of date.