MQX3.4 _klog_show_stack_usage() not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX3.4 _klog_show_stack_usage() not working

Jump to solution
1,047 Views
CarlFST60L
Senior Contributor II

Hi,

I just ran the hello2 example in MQX3.4 with

void world_task

   (

      uint_32 initial_data

   )

{

   _task_id hello_task_id;

   hello_task_id = _task_create(0, HELLO_TASK, 0);

   if (hello_task_id == MQX_NULL_TASK_ID) {

      printf ("\n Could not create hello_task\n");

   } else {

      printf(" World \n");

   }

//ADDED CODE TO SHOW STACK USAGE

  _klog_show_stack_usage();

  fflush(stdout);

  _time_delay(1000);

  

   _task_block();

}

Here is the console output:

Hello

World

Stack usage:

Interrupt stack:    size 00001024    used 00000000

SIZE                  USED                 TASK ID      NAME

00000996(000003E4)    00000428(000001AC)   00010001     world

-536819368(E000C958)    -536819368(E000C958)   000035B6     JÈNs/R,H`ÙSfú,_Nu/,HN¹

I have a full production project which uses this feature in MQX3.7 (and has since MQX3.0), but suddenly it has this result!

Tags (2)
0 Kudos
1 Solution
625 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Yup you are right (for ColdFire CW1-.3 compiler....Kinetis seems OK).  Release has issue and Debug seems OK.

Please replace the klog.c in the following path:

C:\Freescale\Freescale_MQX_4_0\mqx\source\kernel

With the attach updated version and let me know if it works for you (it worked for me once I recompiled BSP and BSP then cleaned and re-compiled application).

I will update our MQX Development team with this issue (and potential workaround).

Regards,

David

View solution in original post

0 Kudos
13 Replies
624 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Sorry for your hassles.

A couple of questions.  Is the issue with MQX3.4 or MQX3.7?

If MQX3.4, what development tools are you using?  If CW7.1.2, which target configuration are you using for the BSP and PSP?

I used DebugRegABI, then compiled the hello2 application with your modification, flashed the Int Flash Debug image and got the following results on the TWRMCF52259:

ScreenHunter_16 Apr. 18 17.09.gif

In summary I added the #define MQX_KERNEL_LOGGING 1 to user_config.h and recompiled the BSP and PSP.

Then I added the  _klog_show_stack_usage(); to the hello2 source file.

Regards,

David

624 Views
CarlFST60L
Senior Contributor II

Sorry, I dont know how I managed to write 3.4, I mean 4.0! Latest MQX. I am using the release version on MQX4.0.

0 Kudos
624 Views
c0170
Senior Contributor III

Hello Carl Norman,

what board did you run with the output you showed? Please always mention board you are using.

I tested _klog_show_stack_usage on TWR K60N512 with MQX 4.0.

World

Stack usage:

Interrupt stack:    size 00001024    used 00000004

SIZE                  USED                 TASK ID      NAME

00000336(00000150)    00000100(00000064)   00010001     _mqx_idle_task

00001488(000005D0)    00000384(00000180)   00010002     hello

00001488(000005D0)    00000100(00000064)   00010003     hello

I asssume UART communication was loosy somehow during printf. Please set a breakpoint inside the _klog_show_stack_usage function line 651 and check please registers or variables in debugger view/stack if they show proper values.

Regards,

c0170


0 Kudos
624 Views
CarlFST60L
Senior Contributor II

I am using the 52259demo.

Why is there no more tad? Do you need to buy a license now? There is no functions that work in the mix menu???

0 Kudos
624 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Have you updated CW10.3 lately?

I just dusted off my M52259DEMO, updated the OSBDM driver, used MQX4.0 (quite the typo you had before....took me a bit to find MQX3.4 to test with ;-) ) and re-tested.  All is working.  Note that TAD worked fine before _klog_show_stack_usage();, then stopped after stepping that statement, then after stepping _task_block(); TAD was back alive.

ScreenHunter_17 Apr. 19 08.42.gif

ScreenHunter_22 Apr. 19 08.44.gif

ScreenHunter_21 Apr. 19 08.43.gif

Regards,

David

0 Kudos
624 Views
CarlFST60L
Senior Contributor II

Thanks for your effort.. I guess im about to reinstall everything and start over. I only just installed 4.0 so I didnt think it would be that. And everything else works perfectly.

CW10.2 is still a nightmare to deal with so hopefully 10.3 patch is not far off.

0 Kudos
624 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Attached is my S19 file for you to try on your M52259DEMO board.

I should have thought of that before....

Keep us posted.

Regards,

David

0 Kudos
624 Views
CarlFST60L
Senior Contributor II

Well, the problem is the release version, debug works fine!

All fresh installation of MQX4.0, CW10.2, hello world 2 with the above modifications.

If I use debug, it works, use Release, it fails. TAD is now working though, not sure why it wasnt, I did nothing, you just click install, so that has me stumped. Actually, I think I installed MQX3.7 after 4.0 and this broke the TAD.

Anyway, what to do now? I cant use the release version..

0 Kudos
626 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Yup you are right (for ColdFire CW1-.3 compiler....Kinetis seems OK).  Release has issue and Debug seems OK.

Please replace the klog.c in the following path:

C:\Freescale\Freescale_MQX_4_0\mqx\source\kernel

With the attach updated version and let me know if it works for you (it worked for me once I recompiled BSP and BSP then cleaned and re-compiled application).

I will update our MQX Development team with this issue (and potential workaround).

Regards,

David

0 Kudos
624 Views
CarlFST60L
Senior Contributor II

Thanks for that, I must owe you a favour by now!

I did step into this code and it lost me because the first line would print and it all initialised correctly (or looked like it did).

Do you happen to know when the 10.3 patch / update is coming? 10.2 is horrible to use and I'm stuck with it as we use MRAM.

0 Kudos
624 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

You can get CW10.3 from our web (either the offline or online installer).

I've been using CW10.3 for 4 months and it seems quite good (better than CW10.2).

Regards,

David

0 Kudos
624 Views
CarlFST60L
Senior Contributor II

Unfortunately MRAM does not program in the current release of 10.3. Apparently this has been fixed but there is no release for the new version as so we are stuck on the buggy 10.2.

Did you see my other thread about only two ADC converters being able to be open in MQX4.0?

0 Kudos
625 Views
CarlFST60L
Senior Contributor II

Unfortunately MRAM does not program in the current release of 10.3. Apparently this has been fixed but there is no release for the new version as so we are stuck on the buggy 10.2.

Did you see my other thread about only two ADC converters being able to be open in MQX4.0?

0 Kudos