How to use ADC components in FreeRTOS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use ADC components in FreeRTOS

ソリューションへジャンプ
1,411件の閲覧回数
kimdukyu
Contributor II

Hi.

It is being developed at S32DS Design studio, and MPC5746C MCU chip is used. I am using FreeRTOS component and ADC component together. The problem is that it stops at IVOR1_Handler in the process of ADC_Init() function processing. I don't know why for this problem. I am attaching the source code, so please answer the question. 

For reference, the symbol "USING_OS_FREERTOS" is defined as shown in the figure below.

Please give me a quick reply.

Thank you to everyone.

0 件の賞賛
返信
1 解決策
1,377件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Dukyu,

sorry for delayed response.

I have only MPC5748G here today, so I tried to load your project to this board. I didn't re-compiled the project, I used your elf file directly to be sure it's exactly the same. I can see that the ADC Init function is successfully executed and  then it continues the execution, I can see no exceptions.

I can try it directly on MPC5746C on Monday to see if there's a difference.

Regards,

Lukas

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,405件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Dukyu,

It seems you uploaded wrong project, I can’t see ADC there.

But common mistake is: if a function/driver uses OS services, it's mandatory to call them after starting the scheduler. Maybe this is the reason.

I can remember this discussion which could be helpful:

https://www.freertos.org/FreeRTOS_Support_Forum_Archive/March_2017/freertos_What_is_normal_method_fo...

Regards,

Lukas

0 件の賞賛
返信
1,387件の閲覧回数
kimdukyu
Contributor II

Dear Lukas,

 

First of all, thanks for the quick reply. The source code is attached again. According to your answer, do I need to initialize the ADC in the function registered in the scheduler? Even if I initialize the ADC in the task, the same symptom was present. Please give me a more detailed answer.

 

Can you please check whether ADC group setting and code writing in the attached source code are correct?

 

Thank for Lukas.

 

0 件の賞賛
返信
1,360件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

I tested it on MPC5746C now and it also works. Where does it fail exactly in the project? Which instruction?

Regards,

Lukas

0 件の賞賛
返信
1,378件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Dukyu,

sorry for delayed response.

I have only MPC5748G here today, so I tried to load your project to this board. I didn't re-compiled the project, I used your elf file directly to be sure it's exactly the same. I can see that the ADC Init function is successfully executed and  then it continues the execution, I can see no exceptions.

I can try it directly on MPC5746C on Monday to see if there's a difference.

Regards,

Lukas

0 件の賞賛
返信