The following conflicts occurred when I configured the clock of MCU:
"System clock under MCU control" and "SIRC under MCU control "& "firc under MCU control" cannot coexist.
This will cause MCAL to ignore the initialization of SIRC and firc after using "System clock under MCU control" to initialize SPLL
Or vice versaF
Using "SIRC under MCU control" or "Firc under MCU control" does not initialize SPLL
Other peripherals will use SIRC and Firc as clock
The generated code ignores the configuration of firc and SIRC sources.
Solved! Go to Solution.
Hello @ou_gangxun ,
Best regards,
Hung.
I am still observing the same issue while configuring AUTOSAR MCAL 4.2 RTM 1.0.4
Description: System or Bus clock is initializing by MCU correctly. However, other configured clocks such as SOSC, SIRC, FIRC, SPLL, etc. are not initializing , as configured in EB Tresos. This leads to the other dependent peripherals on these clocks stopped working.
Analysis: If System clock is under MCU control then clocks such as SIRC and FIRC won’t be under MCU control. I tried several combinations and one of such scenario is to “Disable System Clock under MCU control” and then “Enable SIRC and FIRC for MCU control”
Observation: There may be other reasons but I am observing the below macros ‘ALWAYS’ set to “STD_OFF” during auto-code generation from EB Tresos.
/* This define Enable/Disable the SOSC clock under Mcu control */
#define MCU_SOSC_UNDER_MCU_CONTROL (STD_OFF)
/* This define Enable/Disable the SIRC clock under Mcu control */
#define MCU_SIRC_UNDER_MCU_CONTROL (STD_OFF)
/* This define Enable/Disable the FIRC clock under Mcu control */
#define MCU_FIRC_UNDER_MCU_CONTROL (STD_OFF)
/* This define Enable/Disable the SPLL clock under Mcu control */
#define MCU_SPLL_UNDER_MCU_CONTROL (STD_OFF)
Validation: If we manually initializing the clocks by making direct function calls, then it seems to work for certain peripherals such as CAN Driver. This confirms the implementation of the driver is correct. We initialize following clocks for CAN driver.
SOSC_init_8MHz(); /* Initialize system oscillator for 8 MHz xtal */
SPLL_init_160MHz(); /* Initialize SPLL to 160 MHz with 8 MHz SOSC */
NormalRUNmode_80MHz(); /* Init clocks: 80 MHz sysclk & core, 40 MHz bus, 20 MHz flash*/
Please find below the versions of tools we are using:
Hello @ou_gangxun ,
Best regards,
Hung.