You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCU I use is STM32F103ZET6. The original Wifi_RxCallBack function is as follows.This function cannot read characters normally through uart interrupt. It's like uart interrupt data cannot be written to the Wifi.usartBuff as expected.
When I change Wifi_RxCallBack to the following form, all function in ESP8266.c work fine. Why is this happening? Have you ever encountered similar problems?
Thanks to to reach out, I have worked a long time ago with this library, it was one of my first projects. Therefore, it is quite old and I am almost certain that the problem is that STM32 updated the HAL drivers and therefore is not longer 100% compatible.
The HAL_UART_Receive_IT seems now to have new header, which looks something like this, according to this manual:
My gut feeling is that you are sending a uint8_t pointer aka Wifi.usartBuff, but you are telling with the variable Size that you are waiting for a uint16_t. Maybe the compiler and the function would understand that you need is a uint8_t buffer is you explicit say it, instead of putting the 1 alone. You could try:
Another solution is to change the usartBuff to a uint16_t type and take only the first bits, similar as you already to with the change that you made.
/* After changing the Wifi.usartBuff to uint16_t */voidWifi_RxCallBack(void)
{
Wifi.RxBuffer[Wifi.RxIndex] = (uint8_t) (Wifi.usartBuff & 0x00FF);
if(Wifi.RxIndex < _WIFI_RX_SIZE)
Wifi.RxIndex++;
HAL_UART_Receive_IT(&_WIFI_USART,&Wifi.usartBuff,1);
}
According to the documentation the HAL interruption must put the information in the pData pointer, it has to be there, and you should reach it with any of those changes. If not, something is not working properly with the UART IRQ Handler.
Let me know if that helps, I would like to know if it works.
The MCU I use is STM32F103ZET6. The original Wifi_RxCallBack function is as follows.This function cannot read characters normally through uart interrupt. It's like uart interrupt data cannot be written to the
Wifi.usartBuff
as expected.When I change
Wifi_RxCallBack
to the following form, all function in ESP8266.c work fine. Why is this happening? Have you ever encountered similar problems?The text was updated successfully, but these errors were encountered: