The Am335x on our custom board runs at 19.2MHz instead of 24MHz. What do we need to add to the .cfg file to inform SysBios to use 19.2MHz when configuring the 1ms system clock?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
The Am335x on our custom board runs at 19.2MHz instead of 24MHz. What do we need to add to the .cfg file to inform SysBios to use 19.2MHz when configuring the 1ms system clock?
Hi Henlee,
To change the timer frequency in SYS/BIOS you need to add the following to your config file:
var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer'); Timer.intFreqs[index] = {hi: 0, lo: 19200000};
Where index is the SYS/BIOS timer ID. Please remember that timer IDs do not necessarily match the number in the peripheral name. For example on AM335x SYS/BIOS Timer 0 actually corresponds to DMTimer2 on the device. Use the Timer Mapping Table to determine which timer corresponds to each Timer ID.
Regards,
-- Emmanuel
This line is already in the config file:
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
Do the two lines you suggested replace this one?
I verified that DMTimer2 (index 0) is the only timer displayed in the ROV.
Does SysBios always use DMTimer2 for the the 1ms system clock on Am335x if no other timer is configured?
Hi Henlee,
My mistake, I thought you had already configured the HW and only needed to inform BIOS of the change.
The error above is raised when there is a discrepancy between the BIOS CPU frequency and the Timer frequency. Firstly, have you already configured your PLL to generate the MPU clock you desire? If not, please see section 8.1.6.9.1 of the AM335x TRM for the steps. After configuring the PLL, you should know the actual system frequency will be (for example: 720 MHz).
Now you need to tell BIOS what the actual CPU frequency is; this can be done by adding the following to your *.cfg file:
BIOS.cpuFreq.lo = 720000000;
Assuming you did not change the CLKSEL_TIMER2_CLK register mux value (defaul 0x01 which uses CLK_M_OSC), you need to add the Timer configuration I had mentioned above.
henlee said:var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
Timer.intFreqs[0] = {hi: 0, lo: 19200000}; // 19.2MHz clock source for 1ms tick
henlee said:Does SysBios always use DMTimer2 for the the 1ms system clock on Am335x if no other timer is configured?
If no timer has been explicitly specified BIOS will use the first time available (DMTimer2). However, you can explicitly tell the Clock to use a particular timer by adding the following to your .cfg file:
Clock.timerId = 0;
Hope this helps,
-- Emmanuel