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

mgmt: mcumgr: transport: smp: Fix smp_init runlevel. #82142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bas-archembedded
Copy link
Contributor

Move priority to POST_KERNEL to make sure smp_init() is called before smp_init_uart as it initializes the transport list in case CONFIG_SMP_CLIENT is enabled.

The smp_init() routine was called after smp_init_uart(), causing the list to be emptied again after registration of the uart client transport.

@zephyrbot zephyrbot added size: XS A PR changing only a single line of code area: mcumgr labels Nov 27, 2024
@bas-archembedded bas-archembedded force-pushed the fix_smp_init_run_level branch 2 times, most recently from b2dbac9 to 24b353f Compare November 27, 2024 15:07
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

This is not correct, APPLICATION is correct. If there is an order that is needed than you could add Kconfigs to specify the run levels

Make initialization priority of smp_init() higher when CONFIG_SMP_CLIENT
is enabled.

The smp_init() routine was called after smp_init_uart(), causing
the list to be emptied again after registration of the uart client
transport.

Signed-off-by: Bas van Loon <[email protected]>
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

As an alternative without having to mess with init levels which seems messy, have you tried having the slist init'd statically instead using https://docs.zephyrproject.org/latest/doxygen/html/group__single-linked-list__apis.html#ga7f4710125f45643b7acdaa58dbfff225 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcumgr size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants