bldc icon indicating copy to clipboard operation
bldc copied to clipboard

Fixed two issues relating to libcanard and updated library

Open sprenger120 opened this issue 5 years ago • 3 comments

After updating libcanard (50c95ac) and enabling UAVCAN in appconfig the canard thread locked up due to setNodeId being called in every iteration (068f5ad). This happens now because the update put in the assertions again that were commented out. Was there a specific reason for this? A local fork runs the library with assertions without problems.

Also after looking through the code appconfig is loaded after the can thread is started 1321299 which needs config to be ready for nodeId. This might not be an issue because its unlikely that the main thread is preempted exactly before the loading is finished.

sprenger120 avatar Oct 20 '20 20:10 sprenger120

It was long ago that I worked with uavcan, but I think I set the ID in every iteration so that changing the appconfig would take effect without a reboot. Setting the ID was a light operation too, so there was not really a problem.

I would prefer changing libcanard so that the ID can be changed any time. So far I have tried to make all configuration changes take effect instantly as that is quite nice.

vedderb avatar Oct 21 '20 07:10 vedderb

Thanks for the clarification this makes sense. I've updated the PR so setting Id now always works.

sprenger120 avatar Oct 22 '20 15:10 sprenger120

I independently found the initialization order issue and fixed it the same way in #625, found this looking through open PRs afterwards, for reference.

bsilver8192 avatar May 15 '23 03:05 bsilver8192