First of all,I don't study the LOG module yet,just copy & paste from example.
I'm trying to process APP_USBD_CDC_ACM_USER_EVT_RX_DONE event,print debug info to monitor the execution.
This is the buffer to receive data from USB,5 bytes max per time,reserve 1 byte for '\0':
Limit the packet size to 5 bytes to test the code:
Debug info is not right if data count from USB is bigger than 6:
7 bytes data means:
1) 1 byte returned by previous call to app_usbd_cdc_acm_read();
2) 5 bytes returned by current 1st call to app_usbd_cdc_acm_read();
3) 1 byte returned by current 2nd call to app_usbd_cdc_acm_read();
But the actual output like this(send string: "2345678"):
We can see the the info for 1st call is wrong, it is same with 2nd call,and no info for whole string("2345678").
I have traced the code,the returned data are right.
I thought the reason:
1)this is based on event processing model, the real process should delay for some time;
2)when real process executed,the data in variable has been changed(m_rx_buffer will keep the last data:"8" )
But I don't think the real data not buffered by LOG module.
How to do it?