Page 1 of 1

32L0XX timers  Topic is solved

Posted: Wed Oct 10, 2018 11:28 am
by steved
1. Timer 3 reset, enable etc not present in stm32_rcc.h

2. GPT21/22 not handled in hal_lld_gpt.h (have individual interrupt vectors). (Reports 'no timer enabled' if just timer 21 or 22 enabled)
But their reset/enable functions are in stm32_rcc.h!

Re: 32L0XX timers

Posted: Thu Oct 11, 2018 1:34 pm
by steved
I've been looking a bit more into timers on the 32L071, and thought it might be helpful to summarise what I've found. (I've not changed any files - haven't dug that deeply yet)

a) In respect of tim_irq_mapping.txt
Timers 2, 3, 6, 7, 21, 22 all have unique interrupts

b) Timers 2, 3
Timer 3 enable/disable/reset macros are missing from stm32_rcc.h


c) Timers 6, 7
Not mentioned in the mcuconf.h for the L073 demo project
Compiles OK if they are added


d) Timers 21,22
The macros in hal_gpt_lld.h don't support - both specific timer checks, the check to ensure at least one timer is enabled when the GPT subsystem is enabled, and the IRQ priority check
Status blocks in hal_gpt_lld.h need to be defined
(Superficially they have the same functionality as TIM2, TIM3, with 2 channels instead of four)
(I note that timer 21 is used for Systick)


e) General
All timer definitions in the registry makes sense (but 32L071/072 need cloning/adapting from L073)
In gpt_lld_serve_interrupt(), in one-shot mode, while calling gpt_lld_stop_timer() makes the action obvious, it would be noticeably faster (I assume) to replace that call with the two register updates done in gpt_lld_stop_timer().
(And would use of the timer's one-shot bit help here?)

Re: 32L0XX timers

Posted: Thu Oct 11, 2018 1:49 pm
by Giovanni
Time for some cleanup on L0, weekend task.

Giovanni

Re: 32L0XX timers

Posted: Thu Oct 11, 2018 3:15 pm
by steved
Excellent!
While you're on the L0XX, it would be nice to have a 'proper' way of accessing the on-board EEPROM. I've attached my working files (there's a test project somewhere on the forum).
Main thing I'd like to see done properly are the scatter files. They work, but I'm sure they could be better.

Re: 32L0XX timers

Posted: Thu Nov 15, 2018 11:01 am
by Giovanni
Made the changes about timers.

Giovanni

Re: 32L0XX timers

Posted: Sat May 23, 2020 9:14 am
by Giovanni
Bumped. I still need to look into the EEPROM code.