When i flash my arduino Giga with 1 MB on M7 and 1 MB on M4, then boot the m4 using bootM4() and then print out the prescaler of timer TIM2, it is set to 239 (and a few other registers of TIM2 as well).
Is this intended? I could not find out why this is happening.
Steps to reproduce:
- use blink script example sketch, select 1MB flash split in arduino IDE and flash to M4 co-processor.
- use the following script and flash it with same memory split on M7:
#include <Arduino.h>
extern "C" uint32_t SystemCoreClock;
void setup() {
Serial.begin(115200);
bootM4();
delay(4000); // important, takes a bit to take effect
Serial.println(TIM2->PSC);
}
void loop() {
}
Expected result: TIM2->PSC should be 0
Actual result: TIM2->PSC is 239
Any idea what is going on here? Can I safely use TIM 2 for different purposes? I planned on using it in encoder mode to process a quadrature encoder.
So far, reconfiguring TIM 2 seems to work but I would like to have some clarity in order to not have my back bitten by this down the line.