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.

AM2634: configure several ADC instances at start-up of freeRTOS

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I tried to initialize 3 ADC instances (0, 1, 4) at start-up task. When I initialize only ADC0 and ADC1, the code works correctly. However, if I add another instance ADC4 from Sysconfig, the code will abort at setting the clock for ADC4. These 3 ADC instances are using the same configuration. Is there a conflict to initialize ADC in freeRTOS task, or I should initialize them before starting the task scheduler?

Thanks for the reply.

Lync

  • Hi,

    After debuging step by step, I found the software will always be stuck at HwiP_data_abort_handler after calling following function:

    /* Configures the analog-to-digital converter module prescaler. */
    ADC_setPrescaler(CONFIG_ADC1_BASE_ADDR, ADC_CLK_DIV_4_0);

    And it happens only when CONFIG_ADC1_BASE_ADDR is set to ADC3 or ADC4 from sysconfig, for ADC 0, 1, 2, the initialization completes without an issue.

    Can anyone help on this issue?

    Thanks.

    Lync

  • Hi Lync, 

    I have tried to enable all the ADCs including CONFIG_ADC1_BASE_ADDR being ADC 3/4. in each of the following 2 cases. in each of these cases, the error mentioned in the thread is not observed. 

    1. Drivers_open(); Board_driversOpen(); before the freeRTOS_main Task is created.
    2. Drivers_open(); Board_driversOpen(); within the freeRTOS_main Task is created.

    I see you have marked resolved, could you please help me what changed? 

    thanks and regards,

    Madhava