RAK5148 issue with serial port

Hi,
I am using the lora_2g4_gateway code to communicate with the STM32 which controls the 2.4 G transceivers. On running with full Debug, I see that the read() of loragw_mcu.c returns 0 bytes and then it enters into an infinite loop trying to read 0 bytes. On modifying the code to skip that packet (REQ_GET_RX_MSG), I get an error saying “failed to write command header to com port”. The code works completely fine on the Semtech gateway dev kit, the issue comes up only while using the concentrator.