Hi wareagle,
First of all I would recommend that you try build the Custome application that the Beestack Application developers user's guide describes step by step. When you got that working you can then add your own code.
Regarding to your code below. you do not have a "MSG_Free" problem, but you have the problem that the UART will access the data in the message after it got freed.
Try replacing your uart code with the following:
if (UartTxFlag == FALSE) // only transmit if we are not already transmitting...
{
UartTxFlag = TRUE;
FLib_MemCpy(UartTxBuffer, pIndication->pAsdu, pIndication->asduLength);
(void) UartX_Transmit(UartTxBuffer, pIndication->asduLength, UartTxCallBack);
}
And then add the following extra code :
uint8_t UartTxBuffer[20]; // NOTE must be the bigger than the maximum size telegram you can receive.
bool_t UartTxFlag = FALSE;
static void UartTxCallBack(unsigned char const *pBuf) {
(void) pBuf;
UartTxFlag = FALSE; // Signal that Tx is done by setting tx flag to false
}
Br,
Mads