STM32G431KBTx (Nucleo-32 board), UART and I2C EEPROM makes problems
- November 1, 2022
- 4 replies
- 2597 views
Hello together,
I'm using Nucleo-32 board (with a STM32G431KBTx) and have got some problems...
In my project I'm using:
-> UART (here I'm using RX-DMA and interrupt with an IDLE-flag)
-> ADC, one channel
-> I²C with an EEPROM (no DMA, no Interrupt)
Problems and attempted solutions
Problem 1: if I write some bytes to EEPROM (I'm using HAL_I2C_Mem_Write(...) for that), and wait 5ms after the writing a page, the MCU stucks in HAL_Delay forever. After some googling I found a solution for this, increase interrupt priority for SysTick_Handler. Okay, all my interrupts have 0 as "preemption priority", so I've configured priorities like this:
After that fix, reading/writing from/to EEPROM runs like a charm.
BUT:
The uart communication broke. That means, I request some data (exactly 70 Bytes) from MCU by sending a character (i.e. an V), but I get just 65 bytes, or 67 bytes, or 70 bytes, or 64 bytes... so it's not deterministic, but in 98% the requests I get less then 70bytes...
If I set all the priorities to 0, the uart communication is fine, but HAL_Delay stuck...
Any ideas? I've attached the whole project (STM32CubeIDE 1.10.1)
Thank you very much & kind regards,
Heinrich