2025-08-22 3:09 PM
Hi STM community,
I’m working on a project with an STM32L031K6 paired with a Fujitsu FRAM MB85RC256V and an SHT31-D temperature/humidity sensor (on a breakout board). Both peripherals are on the I²C bus PB7 = SDA, PB6 = SCL.
I’m trying to test the setup using Tera Term, but I’m not seeing any UART output at all — even though I’ve added print statements. No text appears on the terminal.
Here’s what I’ve tried so far:
1. Verified that my code reaches the print statements; I added edge cases and test prints.
2. Confirmed my pinout configuration: PB7 → SDA, PB6 → SCL with pull-up resistors connected to 3v3 rail.
3. Enabled USART2 with TX = PA2, RX = PA15, and ensured the global interrupt is enabled with priority 0.
4. Enabled I²C communication.
Despite these steps, I’m still not getting any serial output.
Has anyone encountered a similar issue on the Nucleo-L031K6 where USART2 over the ST-Link Virtual COM Port does not show output in Tera Term? Any suggestions or troubleshooting steps would be greatly appreciated — I’ve been stuck on this and can’t seem to figure it out.
Thanks in advance!
2025-08-22 3:41 PM
Can you provide further details. Are you getting no serial output at all or just none from the sensor? One issue I initially had when using a Nucleo-L011K board was that the pin id printed on the board are for Arduino and do not reflect the actual uC pin id. The document UM1956 provides uC pin to board pin translations.
You set the global interrupt for USART2, but how are you handling the interrupts?
My initial suggestion for debugging would be to try to get code working that outputs a simple text string over the virtual serial port. Once that is working and you know that communications over the virtual serial port are in order, add in the i2c port and the data from the sensor. Don't worry about interrupts initially, just read the sensor every second and output the results.
I hope this helps.
-A