Hi,
prototype of PWR driver is attached. It supports L1 and L4 on MSI/HSI.
Power Driver for stm32l1
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Power Driver for stm32l1
Hi,
Having checks on STM32-specific macros into the high level part is a problem. Another problem is that some drivers could be active and be compatible with stop/halt modes.
It is not a general solution.
Giovanni
Having checks on STM32-specific macros into the high level part is a problem. Another problem is that some drivers could be active and be compatible with stop/halt modes.
It is not a general solution.
Giovanni
Re: Power Driver for stm32l1
Hi,
I will move STM32-specific checks to lld, not a problem.
Second issue hardly may be resolved without changes in drivers as we discussed earlier: counter or bit mask field.
I will move STM32-specific checks to lld, not a problem.
Second issue hardly may be resolved without changes in drivers as we discussed earlier: counter or bit mask field.
Vitaly
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Power Driver for stm32l1
Yes, it requires an architectural change in HAL, I am not sure yet about the best way to proceed.
For 4 weeks I will be busy with work or travelling so don't worry if I am not very reactive. In August I will be off for vacations
Giovanni
For 4 weeks I will be busy with work or travelling so don't worry if I am not very reactive. In August I will be off for vacations
Giovanni
Re: Power Driver for stm32l1
Hi,
All STM32 specific checks moved to pwr_lld_common.h,
fixed min sleep/stop period bug,
added support ST based on RTC (will create new post for ST on RTC topic).
Sources are attached.
All STM32 specific checks moved to pwr_lld_common.h,
fixed min sleep/stop period bug,
added support ST based on RTC (will create new post for ST on RTC topic).
Sources are attached.
- Attachments
-
- pwr.zip
- (11.16 KiB) Downloaded 200 times
Vitaly
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Power Driver for stm32l1
Hi,
I think the concept is not right yet, the driver is mutually exclusive with DAC, MAC, I2S, look at checks in pal_pwr.h.
Such a driver needs to know the state of other drivers, it requires some kind of system-wide registration system. It is not that simple.
Giovanni
I think the concept is not right yet, the driver is mutually exclusive with DAC, MAC, I2S, look at checks in pal_pwr.h.
Such a driver needs to know the state of other drivers, it requires some kind of system-wide registration system. It is not that simple.
Giovanni
Re: Power Driver for stm32l1
Do you mean this:
#if HAL_USE_I2S == TRUE
#error "PWR driver does not support I2S."
#endif
?
It is just a stub. I do not use these drivers, so not check these drivers state. There is no problem to add support of DAC, MAC and etc.
#if HAL_USE_I2S == TRUE
#error "PWR driver does not support I2S."
#endif
?
It is just a stub. I do not use these drivers, so not check these drivers state. There is no problem to add support of DAC, MAC and etc.
Vitaly
Re: Power Driver for stm32l1
Hi,
I would like to suggest to discuss concept once more:
1. Power module can activate low power sleep/stop mode when all drivers are not active.
2. Drivers have to notify Power module on beginning and ending activities using Power module interface:
void pwrOnStartActivityNotification(void);
void pwrOnStopActivityNotification(void);
3. Notifications can be implemented using Driver State Machine transition:
- xxxStart() calls pwrOnStartActivityNotification()
- xxxStop() calls pwrOnStopActivityNotification()
4. Drivers with low power support should use different transition to notify Power module about activities (it is MCU and peripheral specific)
Additional note:
In OSAL_IRQ_HANDLER(ST_HANDLER) should be added call:
#if HAL_USE_PWR == TRUE
pwrOnExitIdleThread();
#endif
to prevent execution of chvt code on low mcu frequency.
I would like to suggest to discuss concept once more:
1. Power module can activate low power sleep/stop mode when all drivers are not active.
2. Drivers have to notify Power module on beginning and ending activities using Power module interface:
void pwrOnStartActivityNotification(void);
void pwrOnStopActivityNotification(void);
3. Notifications can be implemented using Driver State Machine transition:
- xxxStart() calls pwrOnStartActivityNotification()
- xxxStop() calls pwrOnStopActivityNotification()
4. Drivers with low power support should use different transition to notify Power module about activities (it is MCU and peripheral specific)
Additional note:
In OSAL_IRQ_HANDLER(ST_HANDLER) should be added call:
#if HAL_USE_PWR == TRUE
pwrOnExitIdleThread();
#endif
to prevent execution of chvt code on low mcu frequency.
Vitaly
Return to “Development and Feedback”
Who is online
Users browsing this forum: No registered users and 50 guests