Question
uart receive buffer queue
Posted on June 19, 2018 at 15:00
hi everyone,
i am using stm32f103 mcu and silicon labs' bgm113 ble module in ncp mode. bgm113 sends datas over uart and mcu handles the operation. in ncp mode there two types receiving data: command and event. command data is response to commands and that type is works good. but event data comes when event trigered and unexpected time and that is creates bugs sometimes. Also if i connect more than 2 modules problems occured again. a data packet comes and while mcu is busy (for example sending data to internet) another data packet comes too. So mcu doesn't know previous packet. i tried receive data with two dimension receive buffer like circular buffer i failed again. is there anyone worked bgm modules or what can you give me algorithm offer about that ?