Aurix Triboard TC277Tricore clock

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DSRnathan
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins
hello All,
i am using Aurix Triboard board with TC277 microcontroller. i can understand the Aurix board startup frequency is 100Mhz. but it is not swiching to frequency in correspondance with external oscillator(20Mhz) on board.
How to define the clock in the code for swtching the internal clock source to required clock frequency using External oscillator?

Kindly help me in this regard.

many thanks in advance to all.

Kind Regards,
Deepak Ramanathan.
0 Likes
5 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi Deepak. Are you using Infineon's iLLD? You can find these clock settings in 0_Src\AppSw\CpuGeneric\Config\Ifx_Cfg.h:


#define IFX_CFG_SCU_XTAL_FREQUENCY (20000000) /**#define IFX_CFG_SCU_PLL_FREQUENCY (200000000) /**
0 Likes
DSRnathan
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins
Hi UC_wrangler,
yes, indeed i found this macro already and it is defined to 200Mhz, But when I managed to retrieve the cpu frequency IfxScuCcu_getCpuFrequency(IfxCpu_getCoreIndex());(stm example from illd) it returns 100Mhz and all the pheriperal bus are 50Mhz. I would like to set the CPU frequency to 180Mhz.
Thank you very much.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi Deepak. Can you verify your application is using the iLLD's _Core0_start function (e.g., from BaseSw\iLLD\TCxxx\tricore\cpu\cstart\IfxCpu_CStart0.c)?

The key part for initializing the clocks is this part at the end of the function:

/*Initialize the clock system */
IFXCPU_CSTART_CCU_INIT_HOOK();

Also make sure you do not have this empty definition in your Ifx_Cfg.h, because that would cause the default macro handler in IfxCpu_CStart0.c to do nothing:

#define IFXCPU_CSTART_CCU_INIT_HOOK()
0 Likes
DSRnathan
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins
hello UC wrangler,
please can you shed some of your thoughts regarding iLLD Qspi output clock frequency.

I am trying to set the frequency baudrate for Qspi transfer where the baudrate is clipped or prescaled for below circumstances.

Scenario 1) When the clock hook function is not commented out from Ifx_Cfg.h. (#define IFXCPU_CSTART_CCU_INIT_HOOK() )
PLL initialized: Normal mode, fosc: 20 MHz & fpll: 200 MHz
PLL freq: 6 MHz
CPU freq: 100 MHz
SPB freq: 50 MHz
GTM freq: 50 MHz
SRI freq: 100 MHz
STM freq: 50 MHz
Source Freq: 100 MHZ
Max freq: 100 MHZ
Fbaud2: 25 MHz

The Qspi tranfer is working but when measure the output clock of SPi using scope it is prescaled by 4 (baudrate /4), because i guess the Fbaud2 is prescaled by 4 (I set 5Mhz baudrate and the output clock is 1.25Mhz).
However i tried to increase the baudrate to 8Mhz and it gives me data mismatch and Qspi transfer stopped working.

Scenario 2) - When the #define IFXCPU_CSTART_CCU_INIT_HOOK() is disabled it tried to use the external clock frequency as a source frequency but i cannot find any difference of above scenario.

The only difference you can notice is fbaud is equal to max frequency.

PLL initialized: Normal mode, fosc: 20 MHz & fpll: 200 MHz
PLL freq: 33 MHz
CPU freq: 100 MHz
SPB freq: 50 MHz
GTM freq: 50 MHz
SRI freq: 100 MHz
STM freq: 50 MHz
Source Freq: 100 MHZ
Max freq: 100 MHZ
Fbaud2: 100 MHz fbaud2 has no prescalar divider.
For the above scenario I get the output clock frequency as it is as I configured in code but my Qspi transfer is not working. (I set my baudrate 5Mz and the output clock also 5MHz from the scope).

My question, The iLLD Qspi demo os only works for the baudrate prescaled by 4 (fbaud/4), How to get the correct frequency for my Qspi transmit and receiving for the baud rate I set.



Kind Regards,
Deepak

Hello Deepak,

were u able to change the Baud rates of QSPI?

0 Likes