Other Parts Discussed in Thread: CC2652R, CC2652P, CC1352P, SYSCONFIG
Tool/software:
I use the function `zb_zcl_finish_and_send_packet_new(...zb_callback_t cb...)` to send data packets. In extremely rare cases, after calling the send function for 1.5 seconds, the callback function still hasn't been executed. After the timeout, I continue to send the next data packet, but the callback function still hasn't been executed. Since each data send requires dynamic memory allocation, and I release the memory in the callback function, this issue occurred multiple times consecutively, leading to failed memory allocations. When this problem occurs, you can only restart the CC2340 device to restore normal operation.
I use CC2340R52 ZED and CC2652P1 ZC tests, where each device sends data to the other every 50ms, with each packet carrying 64 bytes of application layer data. The software logic is as follows: The PC sends data to the MCU via a serial port, and then the MCU stores the data in a queue. Next, in the main loop, it retrieves one packet of data from the queue and sends it to another zigbee device, waiting for the callback function to execute before sending the next packet of data. If the callback function has not executed after 1.5 seconds, it continues to send the next packet of data. I can confirm that the devices are not crashing.
The attachment is part of my source code.