While reading the ST7FLITEU0x datasheet, I found some confusing things.
The figure 1 at page 4 does not show the Debug Module, while Table 3 at page 10 lists the addresses of the debug modules registers. Which one is true? The same Table 3 and section 7.2 at page 24 say that the initial value of SICSR is 0000 0x00 (binary). Since SICSR(6:5) holds the RC calibration value, it means that the internal RC oscillator does not start at the lowest frequency, but a slight higher one. On the contrary, the Table 13 at page 38 shows that the reset value of SICSR(6:5) is 0110 0x00... The reset value of CKCNTCSR is confusing too. According to the datasheet, the AWU_FLAG and RC/AWU should both be 1. If I understand correctly page 22 and the following ones, it means that a ST7FLUTEU0x starts form the internal 33kHz AWU RC oscillator (if the option bytes are programmed to use the internal RC oscillator). To use the internal RC (8MHz) source, the AWU->RC changing sequence should be executed which I didn't find in the application notes. Thank you in advance for the help. EtaPhi
The restart value of the CKCNTCSR seems to depend on what you select as CKSEL in the option byte.
With a ST7LiteUS2 I've got the following results: ___Option CKSEL --> Restart Value CKCNTCSR_____ Internal RC as Startup Clock --> 0000 0100 AWU RC as a Startup Clock --> 0000 1001 External Clock on pin PA5 --> 0000 1001 Regards WoRo
Concerning CKCNTCSR, the 3 first CPU cycles are run at AWU RC frequency, so this register contains 0x09, then the option bytes are read and the clock switched if needed. If an internal RC is used then CKCNTCSR = 0x04 but in all other case CKCNTCSR keep unchanged even when external clock is selected. So your values are the one expected. Best regards Laurent