UART garbage on STM32H750VBT6

Post Reply
smischny
Posts: 2
Joined: Tue Nov 30, 2021 6:34 pm
Answers: 1

UART garbage on STM32H750VBT6

Post by smischny »

So I made a board a while ago and it always worked using the Stm32CubeIDE, but never in Arduino. I picked it up again this week and downloaded the latest STM32 MCU Based Boards v2.1.0 package and it was working except the for the serial output was garbaged. I'm using PD0/PD1, so I tried PC10/PC11, same output (same exact garbage). I tried PA9/PA10 too, same thing. I compared the clock setups from my example in STMCubeIDE that work and the ones in the package and things looked right. I switched from 'Generic H750VBTx' to 'Generic H742IGKx' and it worked... The only real difference in generic_clock.c was the setting of the I2C4 clock source. I made the change in 'H742V(G-I)(H-T)_H743V(G-I)(H-T)_H750VBT_H753VI(H-T)'/generic_clock.c and the UARTs started working:

Code: Select all

smischny@smischny-VirtualBox:~/.arduino15/packages/STMicroelectronics/hardware/stm32/2.1.0/variants/STM32H7xx/H742V(G-I)(H-T)_H743V(G-I)(H-T)_H750VBT_H753VI(H-T)$ diff generic_clock.c generic_clock.save
80c80
<                                              | RCC_PERIPHCLK_SPI123
---
>                                              | RCC_PERIPHCLK_I2C4 | RCC_PERIPHCLK_SPI123
97a98
>   PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_D3PCLK1;
smischny@smischny-VirtualBox
This doesn't really make sense to me why removing this would fix the UARTs. The code is a simple blink sketch with some output, so it's not even using I2C. Maybe this will make sense to someone else????
by smischny » Fri Dec 03, 2021 3:05 am
Thank you @fpiSTM. It working for you helped me figure out my issue. When I was switching between versions of generic_clock.c, I had forgotten to touch the file for it to picked up. So the reason it worked when I removed the RCC_PERIPHCLK_I2C4 was that the file was updated and got re-compiled. Such a simple thing to overlook...
Go to full post
Last edited by smischny on Tue Nov 30, 2021 9:03 pm, edited 1 time in total.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: UART garbage on STM32H750VBT6

Post by fpiSTM »

Hi @smischny

I've tested the generic VB50Tx with the WeAct MiniH750VB using PA9/PA10.
I have no garbage with the default clock config.
Here the example used:

Code: Select all

const char lorem[]="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque elementum ullamcorper velit in pretium. In quis tellus eros. Duis neque diam, sagittis et condimentum a, consequat non nibh. Quisque ut pellentesque eros. Cras accumsan velit ex, in porttitor ligula malesuada at. Sed suscipit tellus nibh, et aliquam magna interdum at. Nam viverra magna augue, vitae dapibus justo commodo ultrices. Donec faucibus nulla quis felis iaculis volutpat. Nunc a dui aliquet purus luctus auctor. Ut tristique nisi et purus hendrerit, sed auctor orci mollis. Suspendisse placerat turpis elit, in tincidunt velit dapibus in. Vivamus eu mi sed elit scelerisque finibus. Curabitur ullamcorper sit amet risus eu mattis. Sed a mollis sem. Curabitur egestas convallis sapien. Suspendisse elementum, odio ac rhoncus tempus, dolor lacus consectetur lacus, quis congue mi sapien nec massa. Etiam convallis dolor massa, id iaculis dui suscipit quis. Sed quis nisl vel mi elementum blandit malesuada eu nibh. Donec sit amet turpis ut lacus rhoncus bibendum eget a nulla. Aliquam pretium elit vestibulum feugiat posuere. Nulla vel placerat lectus. Nullam consectetur bibendum fermentum. Praesent dignissim nunc quis dui lacinia aliquam. Vestibulum venenatis viverra tempor. Donec ullamcorper maximus sodales. Mauris ultricies nulla sed elit blandit imperdiet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Donec porttitor bibendum mi, vel commodo turpis. Mauris nec justo efficitur, congue tortor non, ornare ligula. Fusce euismod arcu ut elit maximus, vitae porta odio cursus. Nam vitae mauris eu erat commodo dignissim. Integer dignissim volutpat consequat. Cras at vestibulum lectus, id pretium ligula. Fusce vitae congue nulla. Morbi blandit lectus a dui hendrerit sodales. Mauris id lectus nisl. Quisque iaculis cursus posuere. Nullam nec rhoncus velit. Donec vitae elit arcu. Sed molestie ipsum justo, sit amet ultricies ligula pretium egestas. Fusce bibendum porttitor felis sit amet elementum. Class aptent taciti porttitor.";

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(250);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(250);                       // wait for a second
  Serial.println(lorem);
}
smischny
Posts: 2
Joined: Tue Nov 30, 2021 6:34 pm
Answers: 1

Re: UART garbage on STM32H750VBT6

Post by smischny »

Thank you @fpiSTM. It working for you helped me figure out my issue. When I was switching between versions of generic_clock.c, I had forgotten to touch the file for it to picked up. So the reason it worked when I removed the RCC_PERIPHCLK_I2C4 was that the file was updated and got re-compiled. Such a simple thing to overlook...
Post Reply

Return to “PR's bugs and enhancements”