MQX-based code does not execute if task is in a different source file

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

MQX-based code does not execute if task is in a different source file

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

I have a feeling this is going to be an embarrassing post for me and my question has a really obvious answer.

I have the httpserv demo debugging just fine.  I added a task to app_mqx and was still able to run it in the debugger.  However, if I move this task to another source file (e.g. task.c), the code builds, but it doesn't run.  When the code is working and I debug, I'll see the Segger window with the four progress bars appear while the code is downloading.  After the function is moved to test.c, the window never pops up and therefore nothing executes.


I'm totally confused as to why this would happen.  Can anyone shed some light on this for me?  I'm pretty sure it's not a build problem, as the command line args to gcc look totally correct to me.

Thank you!

タグ(5)
0 件の賞賛
返信
1 解決策
1,386件の閲覧回数
dave408
Senior Contributor II

It turned out that the solution was to make all of the function definitions extern.  I do not understand how the code could compile and link just fine without extern, yet not run.  I have other MQX projects with tasks in different .c files, but they aren't marked extern either *and* they work.

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,387件の閲覧回数
dave408
Senior Contributor II

It turned out that the solution was to make all of the function definitions extern.  I do not understand how the code could compile and link just fine without extern, yet not run.  I have other MQX projects with tasks in different .c files, but they aren't marked extern either *and* they work.

0 件の賞賛
返信
1,386件の閲覧回数
soledad
NXP Employee
NXP Employee

Hi,

Thanks for sharing your solution!

Regards

Sol

0 件の賞賛
返信
1,386件の閲覧回数
dave408
Senior Contributor II

Can you provide an explanation as to why some projects need it, and some don't?  It's very strange.

0 件の賞賛
返信