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 meaning of 0x44E00508 in the full ethercat example

Other Parts Discussed in Thread: SYSBIOS

Hi,

I am learning the full ethercat example that comes with the am335x idk board. And I am very ashamed to ask a very basic question:

What is meaning of "0x44E00508" which appears in the following location in the sdk folder: \am335x_sysbios_ind_sdk_1.0.0.8\sdk\platform\am335x\src\am335x_indcomm_startup.c:

line 88:

void timer2Init(void)
{
// make sure our Timer2 (BIOS 1ms) uses 32kHz ref clock
// some boot loaders change that...
*(unsigned int*)0x44E00508 = 2; // select 32kHz
}

Moreover, is there any document that can explain the line of the code: *(unsigned int*)0x44E00508 = 2; // select 32kHz

Thank you!

Tao

  • I just got to know that 0x44E00508 means CLKSEL_TIMER2_CLK;

    But in the full ethercat example, I can not see the functionality of the timer2 and the initialization code of timer 2?


  • Hi Tao,

    you can always ask... as I am the one who made that I will try to answer.

    Here we are writing to a HW register that is part of the timer used for BIOS tick. If this is using wrong input clock all timing fails. Now this code might not be required in all cases (as the comment tells) but it is save to use it too. It is not related to EtherCAT at all but just the basic BIOS operation.

    HW regs are documented in the TRM. You can always look at the memory map and the address region should tell you what peripheral is configured here. Now I agree that hard coded addresses are not a good style and I never expected that code to end up in our SDK as it was done as part of quick-and-dirty demo development. But apparently I was wrong...

    Regards.

  • Hi  Frank,

    Thank you very much for your answer! Actually if given the HW regs documentation, the hard coded addresses are not so confusing:)

    Tao