I'm in the progress of porting BACnet MSTP from STM32 to ESP32. (The STM32 is programmed by Steve Karg https://github.com/bacnet-stack/bacnet-stack).
Now I'm able to compile the Code with the IDF 4.1. And it kind of runs on the ESP32.
At the moment I'm struggling with the following part. Or with other words I think that's the reason why the ESP is not able to receive data.
For the STM32 it looks like this:
Code: Select all
void USART2_IRQHandler(void)
{
uint8_t data_byte;
if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) {
/* Read one byte from the receive data register */
data_byte = USART_ReceiveData(USART2);
(void)FIFO_Put(&Receive_Buffer, data_byte);
}
}
Code: Select all
{
uint8_t data_byte;
uart_read_bytes(UART_NUM_1, &data_byte, 1, 100 / portTICK_RATE_MS);
(void)FIFO_Put(&Receive_Buffer, data_byte);
}
How do I trigger the Interrupt correct?
I also put both files I compared into the attachments.
If someone is more interested in helping me with the backnet-stack, here is my git where I have the actual build: https://github.com/waterfox207/bacnet-s ... esp32_mstp
hope that someone can help me.