Unable to write to TIM2 Registers
I have this little project for the STM8L101F3 that just writes an arbitrary value to TIM2_CCR1H and TIM2_CCR1L and then tries to start the timer but I get nothing from the timer output.
If I run the project with a debugger and inspect the contents of the registers, I find them unchanged. I tried this with IAR Embedded Workbench under Windows 10 and with sdcc/openocd/stm8-gdb under Ubuntu 20.04LTS and I see the same behaviour. I am using one of those generic STLINK-V2 dongles.
I have another project that just toggles an IO and it works fine. I am just having trouble with TIM2.
So just yesterday I received a brand new STM8L-Discovery. I then downloaded en-stsw-stm8008.zip from st.com and unzipped it.
When I hook up the discovery board to my PC and run the IAR* project "Discovery", and while the debugger is stopped at main(), I open up a view registers window and bring up TIM2. When I try to modify any of the registers, they just stay at zero.
What am I missing?
*IAR EW STM8 V2.20.2
