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

Wrong log settings in can_stm32 driver #31573

Closed
KozhinovAlexander opened this issue Jan 24, 2021 · 7 comments
Closed

Wrong log settings in can_stm32 driver #31573

KozhinovAlexander opened this issue Jan 24, 2021 · 7 comments

Comments

@KozhinovAlexander
Copy link
Collaborator

LOG_MODULE_DECLARE(can_driver, CONFIG_CAN_LOG_LEVEL);

It must be LOG_MODULE_REGISTER instead of LOG_MODULE_DEFINE.

@KozhinovAlexander KozhinovAlexander added bug The issue is a bug, or the PR is fixing a bug area: Drivers platform: STM32 ST Micro STM32 area: CAN labels Jan 24, 2021
@alexanderwachter
Copy link
Member

LOG_MODULE_REGISTER(can_driver);
Is called in can_common.c:13.
You can only register a module once.

@KozhinovAlexander
Copy link
Collaborator Author

LOG_MODULE_REGISTER(can_driver);
Is called in can_common.c:13.
You can only register a module once.

LOG_MODULE_DEFINE not worked for me with samples/can/driver

@alexanderwachter
Copy link
Member

the sample builds without error on the latest HEAD.
west build -b nucleo_f746zg zephyr/samples/drivers/can

@KozhinovAlexander
Copy link
Collaborator Author

KozhinovAlexander commented Jan 24, 2021

nucleo_f746zg

Sorry. It was my bad. It is not worked for me with my h7 can driver under dev. Thus I will close this issue. Your pointing on register in can_common will help me in investigation.

@KozhinovAlexander
Copy link
Collaborator Author

Found it out.

I've used LOG_MODULE_DECLARE(can_stm32h7_driver, CONFIG_CAN_LOG_LEVEL); with different name than can_driver, thus I need LOG_MODULE_DEFINE since it is not declared in can_common.c

@alexanderwachter alexanderwachter removed the bug The issue is a bug, or the PR is fixing a bug label Jan 24, 2021
@alexanderwachter
Copy link
Member

alexanderwachter commented Jan 24, 2021

BTW @Nukersson #31061 should work on the H7 too.

@KozhinovAlexander
Copy link
Collaborator Author

BTW @Nukersson #31061 should work on the H7 too.

Thank you very much! I will try to help in PR pointed by you.

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

No branches or pull requests

2 participants