-
Notifications
You must be signed in to change notification settings - Fork 6k
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
drivers: can: socketCAN: move code from drivers to its own file #41847
drivers: can: socketCAN: move code from drivers to its own file #41847
Conversation
7b60e58
to
3e4c617
Compare
7c68a2c
to
4498ad6
Compare
Doc CI fail is unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean-up, just a few minor observations.
4498ad6
to
0c0d163
Compare
@alexanderwachter Any progress on this? Any more information on the errors, you are seeing? Are they also present on |
@alexanderwachter Please provide further details on the issues you are seeing? |
051a0aa
to
38888b7
Compare
@henrikbrixandersen it was a stack overflow, caused by log immediate and a -115. I used the wrong symbol for the loopback Kconfig (forgot the CONFIG_ prefix). |
38888b7
to
d2be9e8
Compare
@@ -176,6 +180,10 @@ static int setup_socket(void) | |||
return -ENOENT; | |||
} | |||
|
|||
#ifdef CONFIG_SAMPLE_SOCKET_CAN_LOOPBACK_MODE | |||
can_set_mode(DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)), CAN_LOOPBACK_MODE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With loopback mode, we should be able to remove the harness
from samples/net/sockets/can/sample.yaml
and add a console fixture for validating the sample in CI.
d2be9e8
to
2797326
Compare
Move the code for socket instanciation from each driver to a generic driver, that makes an instance of a socketCAN net device for the chosen node. Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Add loopback mode config to the sample so that the code can be tested without an actual CAN network, but wit a single board. Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Do not log immediate in the sample, because it causes stack overflows. Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Cleanup the drivers from socketCAN and make its own driver that instantiates the net interface.