Receive queue non-empty if previous CAN_Uninitialize missing
Posted: Fri 5. Dec 2014, 16:17
Hello,
If a user program is ended without calling CAN_Uninitialize (e.g. due to forced termination from task manager) at high bus loads on restart (e.g. also visible in PCAN View) the receive buffer contains false messages (i.e. theses messages are not currently on the bus - instead this is traffic at previous programm termination without calling CAN_Uninitialize()).
I tried a workaround to ensure CAN_Uninitialize() is called via atexit(). But I noticed the status from CAN_Uninitialize() within atexit() is 0x40000 (i.e. PCAN_ERROR_INITIALIZE).
So I assume there is a bug (e.g. race condition) in the driver during release of the interface if invocation of CAN_Uninitialize() does not happended. As I noted atexit() seems no workaround.
This behavoiur is observed with driver 3.13.0.15462.
Do you know a way to ensure CAN_Uninitialize() is called correctly for a console application?
Thanks
H. Mueller
If a user program is ended without calling CAN_Uninitialize (e.g. due to forced termination from task manager) at high bus loads on restart (e.g. also visible in PCAN View) the receive buffer contains false messages (i.e. theses messages are not currently on the bus - instead this is traffic at previous programm termination without calling CAN_Uninitialize()).
I tried a workaround to ensure CAN_Uninitialize() is called via atexit(). But I noticed the status from CAN_Uninitialize() within atexit() is 0x40000 (i.e. PCAN_ERROR_INITIALIZE).
So I assume there is a bug (e.g. race condition) in the driver during release of the interface if invocation of CAN_Uninitialize() does not happended. As I noted atexit() seems no workaround.
This behavoiur is observed with driver 3.13.0.15462.
Do you know a way to ensure CAN_Uninitialize() is called correctly for a console application?
Thanks
H. Mueller