-
Notifications
You must be signed in to change notification settings - Fork 2k
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
stm32/can: add option to enable deep-sleep per device #14911
Conversation
@@ -100,6 +100,7 @@ typedef struct { | |||
#ifndef CPU_FAM_STM32F1 | |||
gpio_af_t af; /**< Alternate pin function to use */ | |||
#endif | |||
bool en_deep_sleep_wake_up; /**< Enable deep-sleep wake-up interrupt */ |
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.
Why not extend the bit field below? (line 130)
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.
The bitfield was using uint8_t
as the base type and there were already eight bits in it. Also, the bits in the bit field correspond to a setting in the config register.
How can we test this ? I don't find any board that provides a default can configuration. The |
@aabadie Normally, the nucleo-f413zh provides a CAN configuration, but I must admit this is not straightforward, as a default |
So I guess the default can_params should be updated as well: RIOT/cpu/stm32/include/can_params.h Lines 30 to 31 in c6fe777
There's nothing related to CAN at this level. |
@vincent-d this one looks good, do you mind adding the default config as well? |
Deep-sleep was based on using rx pin as external interrupt to be able to wake up from stop mode. If rx pin cannot be used as interrupt or user does not need to wake up from stop from the CAN, an option is now present. If en_deep_sleep_wake_up is set to false, setting the device to sleep simply unblock stop mode. Otherwise the behavior is unchanged.
Add en_deep_sleep_wake_up = true in default candev_conf in can_params.h
5da9e09
to
2edf37e
Compare
Added |
All good, mind if I ask was what the use case for this is? |
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.
ACK.
On stm32, EXTIs are a bit annoying...for instance, you cannot configure PA1 and PB1 as an external interrupt pin at the same time (there are 15 lines for EXTI, shared among ports). |
Contribution description
Deep-sleep was based on using rx pin as external interrupt to be able to
wake up from stop mode. If rx pin cannot be used as interrupt or user
does not need to wake up from stop from the CAN, an option is now
present. If en_deep_sleep_wake_up is set to false, setting the device to
sleep simply unblocks stop mode. Otherwise the behavior is unchanged.