Nextion Display Communication problems with STM32
Hello everyone,
for a project at the university i have to programming an nextion display with a stm32f401re or a stm32g474re. (i can choose between them, i have both here). My problem is that i have configurate the display with the nextion editor. There i can change the text and it works. When i use the stm32f401re, connect the tx from the display to the rx from the processor (D0) and the rx from the display to the tx from the processor(D1) and the 5v with 5v, GND with GND, then i don`t can change the values. In my programm, i write
HAL_UART_Transmit(&huart2, (uint8_t*)"t0.txt=\"Hello\"\xFF\xFF\xFF", sizeof("t0.txt=\"Hello\"\xFF\xFF\xFF"), 1000); HAL_Delay(1000);
When i use a logic analyzer on the pin tx, i see, that i get datas. Furthemore i looked at PuTTy. There i get the correct messages.
My baudrate is 9600 bps. in addition my clock settings are:
|Clock Source|HSE (8 MHz extern)|
|PLL Source|HSE|
|PLL_M|8|
|PLL_N|336|
|PLL_P|4|
|PLL_Q|7|
|System Clock (SYSCLK)|84 MHz|
|AHB Prescaler|1|
|APB1 Prescaler|2|
|APB2 Prescaler|1|
|UART Clock |42 MHz|
In addition i looked which signal level that display need. It need 3.3V. The stm32f401re had also an signal level of 3.3V. So this is also fine.
Now i have no idea what the problem is. Has anyone an idea?
