I'm using S32 SDK to configure for the MPC5777C chip.
Before I have setup a FreeRTOS with 2 ms and 10 ms tasks, as well as an EMIOS_PWM output channel, to toggle three external LEDs, it works fine.
Now I try to add an EQADC input channel, then I use the same PE configuration as in the Example project adc_pal_eqadc_mpc5777c, but change the channel to ANB23 related to our hardware, and add the initialize function into main.c as below. However, the software seems to halt during ADC_Init() function. I try to debug step by step, but can't figure it out.
status = ADC_Init(&adc_pal1_instance, &adc_pal1_InitConfig0);
DEV_ASSERT(status == STATUS_SUCCESS);
I need help to solve this issue. Enclosed the project files I'm using. Thanks for your reply in advance.
Regards,
Lync
Solved! Go to Solution.
Hi,
seems you make it finally running by increasing heap of init task, as you mentioned in https://community.nxp.com/t5/MPC5xxx/Is-there-an-example-project-to-configure-ADC-PAL-with-freertos/...
BR, Petr
It seems inside the ADC_Init(), OSIF_TimeDelay() will be called. However, I put ADC_Init() before vTaskStartScheduler(), so there is no tick for OSIF_TimeDelay to count, which will block the software. Then I try to put ADC_Init() in 2 ms Task, however, it still doesn't work, it will stop where ADC_Init() is called. It looks like some functions inside OSIF component that ADC_Init() is using by default has a confilict with freeRTOS that added after.
I hope someone can help on this.
Hi,
try to add ADC init into 10ms task, which has higher priority. Does it pass ADC init in that case?
BR, Petr
No, it didn't work. I tried to creat only one task for ADC init, but not work as well.
Hi,
seems you make it finally running by increasing heap of init task, as you mentioned in https://community.nxp.com/t5/MPC5xxx/Is-there-an-example-project-to-configure-ADC-PAL-with-freertos/...
BR, Petr