Skip to content

optional enable can activities#29

Closed
alploskov wants to merge 2 commits intoZubax:masterfrom
alploskov:master
Closed

optional enable can activities#29
alploskov wants to merge 2 commits intoZubax:masterfrom
alploskov:master

Conversation

@alploskov
Copy link

Opportunity of disable some can activities to optimize memory usage

Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

  • Disabling the main activity makes the CAN module useless. What is the rationale behind this?

  • Plug-and-play and bitrate detection are essential to avoid bricking the device by accidentally starting the bootloader with incorrect settings, or losing the power mid-upgrade, when the bootloader has to start with unknown configuration. These cannot be disabled.

  • To a lesser extent, the above applies to the version detection as well. The difference is that there may be setups that only need a single version of the protocol, which is known in advance. In that case, however, you can just supply the desired protocol version to the CANNode; a good compiler should be able to weed out dead branches automatically.

Please elaborate on your rationale, or I will close this PR.

@alploskov
Copy link
Author

Your right i don't need disable main activity, if i choose version in compile time, but i need disable version, node and bitrate detection to decline memory usage, because in current version compiler don't remove this code

I am use gcc version 13.3.1 20240614 (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))

@pavel-kirienko
Copy link
Member

pavel-kirienko commented Mar 11, 2025

Features disabling the plug-and-play node-ID allocation and bitrate detection will not be accepted.

The version detection could be made optional, but first I would like to take a closer look at your case to understand why the compiler is not eliding the code when it is not used. Please share the relevant part of your application and the full list of compiler flags.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants