Search found 129 matches

by iggarpe
Fri May 08, 2020 10:12 am
Forum: STM32 Support
Topic: Support for use of LPTIMx as system timer in freerunning mode
Replies: 10
Views: 626

Re: Support for use of LPTIMx as system timer in freerunning mode

That is not a planned situation, there is not a specific behaviour defined for that, it is to be verified. In general it is responsibility of the timer driver to behave as expected by upper layers. Giovanni This comment in the STM32 ST interrupt (LLD/TIMv1/hal_st_lld.c) suggests that it would be ha...
by iggarpe
Fri May 08, 2020 10:10 am
Forum: STM32 Support
Topic: Support for use of LPTIMx as system timer in freerunning mode
Replies: 10
Views: 626

Re: Support for use of LPTIMx as system timer in freerunning mode

I put the link to that thread of yours in my first message. Your code and ideas were super helpful, but I would several problems (maybe specific to my STM32L476?): 1- The RM states that CMP must be strictly lower than ARR. 2- The RM states that IER cannot be modified with the timer enabled. Thats w...
by iggarpe
Thu May 07, 2020 8:43 pm
Forum: STM32 Support
Topic: Support for use of LPTIMx as system timer in freerunning mode
Replies: 10
Views: 626

Re: Support for use of LPTIMx as system timer in freerunning mode

Hi, It is required to be able to count to full 16 or 32 bits or the overflow would lead to inaccurate results. See the function that add intervals or check intervals range. Giovanni Quick question: what happens if the ST alarm is stopped but still an interrupt is triggered? will ChibiOS just ignore...
by iggarpe
Thu May 07, 2020 8:41 pm
Forum: STM32 Support
Topic: Support for use of LPTIMx as system timer in freerunning mode
Replies: 10
Views: 626

Re: Support for use of LPTIMx as system timer in freerunning mode

Hi. I am sorry that fit into the conversation. The main reason is convenience and versatility: you use standard multitasking application, which will sleep (and draw minimum current) every moment it can without special dances with RTC or other non standard techiquies. For example, how to use sdGetTi...
by iggarpe
Thu May 07, 2020 8:34 pm
Forum: STM32 Support
Topic: Support for use of LPTIMx as system timer in freerunning mode
Replies: 10
Views: 626

Re: Support for use of LPTIMx as system timer in freerunning mode

I'm somewhat curious what the use case is for your work. If it's just a matter of waking a sleeping device, there are other options. With the stm32l432 I can get comfortably below 1uA using the RTC alarms to wake from standby. Geoffrey It's a LoRaWAN irrigation controller. It spends most of the tim...
by iggarpe
Thu May 07, 2020 8:29 pm
Forum: STM32 Support
Topic: Minimum IRQ priority that won’t wreak havoc
Replies: 4
Views: 313

Re: Minimum IRQ priority that won’t wreak havoc

Giovanni wrote:HAL already does not allow to set invalid priorities.

Manually setting priorities using NVIC API is not an error, priorities 0 and 1 are meant to be used as fast interrupts.

Giovanni


The DMA HAL does indeed allow to set invalid priorities 0 and 1.
by iggarpe
Thu May 07, 2020 8:28 pm
Forum: STM32 Support
Topic: STM32L476 in STOP2 mode
Replies: 10
Views: 766

Re: STM32L476 in STOP2 mode

Besides the already mentioned DBGMCU->CR clear, two other things to check: 1- Disconnect any TTL serial adapters. They'll cause current consumption in the order of hundreds of uA. 2- Disconnect STLink or any other debugger interface. They also cause small current consumption that becomes very signif...
by iggarpe
Thu May 07, 2020 8:24 pm
Forum: STM32 Support
Topic: STM32L476 in STOP2 mode
Replies: 10
Views: 766

Re: STM32L476 in STOP2 mode

Don't forget to turn off the debugger hardware: DBGMCU->CR = 0; This is a considerable current draw. This drove me crazy for oh so many hours. The most expensive lines of code I wrote in 2019: DBGMCU->CR &= ~(DBGMCU_CR_DBG_SLEEP | DBGMCU_CR_DBG_STOP | DBGMCU_CR_DBG_STANDBY);
by iggarpe
Thu May 07, 2020 8:22 pm
Forum: STM32 Support
Topic: STM32L476 in STOP2 mode
Replies: 10
Views: 766

Re: STM32L476 in STOP2 mode

Don't forget to turn off the debugger hardware: DBGMCU->CR = 0; This is a considerable current draw. Does this also stop the DWT counter? this would disable the RTC unit in the RTOS so no polled delays and no time measurement services. Giovanni I do not think so. I have a design that clears DBGMCU-...
by iggarpe
Wed May 06, 2020 5:01 am
Forum: STM32 Support
Topic: Minimum IRQ priority that won’t wreak havoc
Replies: 4
Views: 313

Re: Minimum IRQ priority that won’t wreak havoc

May I suggest to add an assertion in the code?

ChibiOS checks and assertions are a blessing, and that one would have saved quite a bit of time.

Go to advanced search