Infineon / XMC-for-Arduino

Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Other
103 stars 64 forks source link

serial.write function seems to freeze the program after a certain time. #281

Open marshallgb opened 2 weeks ago

marshallgb commented 2 weeks ago

Prerequisites

Description: The program on the XMC2Go Board freezes after a certain period, especially when actively using the pulseIn function, sending UART data, and displaying speed on the OLED display. The issue becomes reproducible within a few minutes. Removing the serial.write function from the send() function allows the program to run without any problems. Additionally, only the first byte out of 8 is outputted over the UART interface shortly before the program freezes.

Steps to Reproduce:

  1. Activate the pulseIn function
  2. Display speed on the OLED display
  3. Send UART data (serial.write)

Expected Result: The program runs continuously without freezing, and all UART data is transmitted correctly.

Actual Result: The program freezes after a certain period, and only the first byte is outputted over the UART interface before freezing.

Frequency (1/1, 1/50, 1/100): 1/1

Build/Commit: Infineon's XMC Microcontroller Lib v3.1.0

Target: XMC 2GO (XMC1100) and 3D Magnetic Sensor 2GO kit

Host OS and Version: Windows 10

Compiler: Arduino IDE 2.3.2

Environment Arduino IDE 2.3.2 Infineon's XMC Microcontroller Lib v3.1.0 Bounce2 Lib v2.71 U8g2lib v2.34.22 Wire Lib

It seems like the issue might be related to a buffer overflow. I have attached the code example.

THANKS!

MCU_Board_17_06_20234_20_35.zip