-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Description
Describe the bug
When SDO is used frequently, the value of csdo->Tfer.Tmr keeps increasing and quickly exceeds the maximum number of timers, causing COTmrCreate() to return -1.
To Reproduce
Steps to reproduce the behavior:
- Repeated use of CSDO download or upload operations
- Looking at the value of csdo->Tfer.Tmr in the code below:
csdo->Tfer.Tmr = COTmrCreate(&(csdo->Node->Tmr), ticks, 0, &COCSdoTimeout, csdo);
Expected behavior
The value of csdo->Tfer.Tmr keeps increasing and will exceed the maximum number of timers.
CANopen Stack (please complete the following information):
- Version V4.4.0
Additional context
In the function static void COCSdoTransferFinalize(CO_CSDO *csdo), the timer was not deleted; csdo->Tfer.Tmr was simply assigned the value -1:
csdo->Tfer.Tmr = -1;
After making the following modifications, this issue no longer occurs:
@@ -160,7 +160,8 @@ static void COCSdoTransferFinalize(CO_CSDO *csdo)
if (call != NULL) {
call(csdo, idx, sub, code);
}
+ (void)COTmrDelete(&(csdo->Node->Tmr), csdo->Tfer.Tmr);
/* Reset finished transfer information */
csdo->Tfer.Type = CO_CSDO_TRANSFER_NONE;
csdo->Tfer.Abort = 0;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels