7 years, 10 months ago.

Serial reading keeps finding nothing on the ST-LINK of my STM32F746G-DISCO

I have combined a few embed projects for the included touchscreen successfully, but when I try to read the Serial/USB input via a number of code examples, I get nothing. I saw that someone hacked around their problem by reading a USART1 register directly , but their MACRO definitions are not found in my compile..

Her is some code:

  1. include "mbed.h"
  2. include "Serial.h" ... ... gotc = 'x'; strcpy (dbgtlk, "-pt1-"); BSP_LCD_DisplayStringAtLine((12), (uint8_t *)dbgtlk); while (gotc != '\r' && gotc != '\n' && rawq < 127 && duds < 10) { if (pc.readable()) { duds = 0; reset timeout counter gotc = pc.getc();
  • rawp = gotc; rawq++; rawp++; } strcpy (dbgtlk, "-pt3-"); BSP_LCD_DisplayStringAtLine((12), (uint8_t *)dbgtlk); wait(.05); duds++; } strcpy (dbgtlk, "-pt4-"); BSP_LCD_DisplayStringAtLine((12), (uint8_t *)dbgtlk); if (rawq > 0) *rawp = '\0'; sbuf[20] = '\0'; just for test .... truncate the line BSP_LCD_DisplayStringAtLine((11), (uint8_t *)sbuf);

} wait(2.0); }

There are many examples where pc.readable() and pc.getc() are used, with nothing else. We are getting the chars on TeraTerm, so the emitting program is fine...

Is this a problem with mbed / STM32F7 ? Is there a workaround ?

Be the first to answer this question.