Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DroneCAN: added FlexDebug support #28450

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Oct 23, 2024

This allows lua scripts to receive FlexDebug DroneCAN messages, allowing for flexible arbitrary debug data from peripheral nodes
This was developed for debugging AM32 ESCs, but any vendor can reserve ranges of IDs

libraries/AP_DroneCAN/AP_DroneCAN.cpp Show resolved Hide resolved
libraries/AP_DroneCAN/AP_DroneCAN.h Outdated Show resolved Hide resolved
libraries/AP_Scripting/lua_bindings.cpp Outdated Show resolved Hide resolved
modules/DroneCAN/DSDL Outdated Show resolved Hide resolved
libraries/AP_Scripting/lua_bindings.cpp Outdated Show resolved Hide resolved

// new message ID, add to the list. Note that this gets called
// only from one thread, so no lock needed
auto *p = NEW_NOTHROW FlexDebug;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerned that DroneCAN devices can cause arbitrary amounts of flight controller memory to be consumed that is never released. I think there should be a Lua call that allocates a fixed size buffer (or at least sets a limit on the number of allowed allocations) like with the scripting CAN buffers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it will be a problem in practice, as amount of memory for a scripting capable flight controller isn't much
we could reduce the ram by only allocating up to the actual length of the message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants