I'm using a K60FX512 MCU with MQX4.0 and CW10.4. I have created klog in my program. And I can see 'Performace data view' and 'stack usage'. But when I tried to open timeline, It tells me that 'no task switches found'. In cpu usage it shows nothing.
I've tried both online and offline mode. Neither of them worked.
I've used this in my last project which is on MQX3.8. And it just worked well. I don't know what's the difference.
Hi Yang,
Since you already saw it working on MQX 3.8 I will assume you already added these two lines in the user_config.h file:
#define MQX_USE_LOGS | 1 |
#define MQX_KERNEL_LOGGING | 1 |
Make sure you recompiled PSP and BSP again after this change.
If so, then you need to check the example code I am attaching which I already tested and is showing with context switch timeline.
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Kernel log contains:
1. 0x00000000:37B91 -> FUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
2. 0x00000000:37F9B -> FUN _sched_yield 0x1FFF1B9C 0x10002 0x2 0x1FFF21BC 0x0
3. 0x00000000:38393 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
4. 0x00000000:3874E -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
5. 0x00000000:38C14 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
6. 0x00000000:38FC8 -> FUN _time_delay_ticks 0x5 0x0 0x0 0x0 0x0
7. 0x00000005:048E -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
8. 0x00000005:0865 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
9. 0x00000005:0D97 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
10. 0x00000005:1146 -> FUN _time_delay_ticks 0xA 0x0 0x0 0x0 0x0
11. 0x0000000F:046A -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
12. 0x0000000F:0836 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
13. 0x0000000F:0D5A -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
14. 0x0000000F:1117 -> FUN _time_delay_ticks 0xF 0x0 0x0 0x0 0x0
15. 0x00000001E:0445 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
16. 0x00000001E:081B -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
17. 0x00000001E:0D2C -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
18. 0x00000001E:10E6 -> FUN _time_delay_ticks 0x14 0x0 0x0 0x0 0x0
19. 0x000000032:0461 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
20. 0x000000032:0827 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
21. 0x000000032:0D42 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
22. 0x000000032:1109 -> FUN _time_delay_ticks 0x19 0x0 0x0 0x0 0x0
23. 0x00000004B:045B -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
24. 0x00000004B:082D -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
25. 0x00000004B:0D48 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
26. 0x00000004B:10F7 -> FUN _time_delay_ticks 0x1E 0x0 0x0 0x0 0x0
27. 0x000000069:0455 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
28. 0x000000069:0817 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
29. 0x000000069:0D2B -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
30. 0x000000069:10EB -> FUN _time_delay_ticks 0x23 0x0 0x0 0x0 0x0
31. 0x00000008C:0461 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
32. 0x00000008C:083B -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
33. 0x00000008C:0D54 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
34. 0x00000008C:1103 -> FUN _time_delay_ticks 0x28 0x0 0x0 0x0 0x0
35. 0x0000000B4:045B -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
36. 0x0000000B4:0813 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
37. 0x0000000B4:0D1C -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
38. 0x0000000B4:10D7 -> FUN _time_delay_ticks 0x2D 0x0 0x0 0x0 0x0
39. 0x0000000E1:0442 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
40. 0x0000000E1:0801 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
41. 0x0000000E1:0D10 -> XFUN _time_delay_ticks 0x0 0x0 0x0 0x0 0x0
42. 0x0000000E1:BC05 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
43. 0x0000000E7:73597 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
44. 0x0000000E7:73AC4 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
45. 0x0000000E7:73EA6 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
46. 0x0000000E7:742C5 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
47. 0x0000000E7:747D8 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
48. 0x0000000E7:8048B -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
49. 0x0000000EE:51C55 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
50. 0x0000000EE:52172 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
51. 0x0000000EE:5253A -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
52. 0x0000000EE:52941 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
53. 0x0000000EE:52E3A -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
54. 0x0000000EE:5DE25 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
55. 0x0000000F5:30334 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
56. 0x0000000F5:3081D -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
57. 0x0000000F5:30BF2 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
58. 0x0000000F5:30FF9 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
59. 0x0000000F5:314C2 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
60. 0x0000000F5:3A50F -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
61. 0x0000000FC:EA10 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
62. 0x0000000FC:EEE9 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
63. 0x0000000FC:F2B0 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
64. 0x0000000FC:F6B1 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
65. 0x0000000FC:FB98 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
66. 0x0000000FC:1AEA5 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
67. 0x00000012:7F8A9 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
68. 0x00000012:7FDE7 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
69. 0x00000012:801B7 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
70. 0x00000012:805BF -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
71. 0x00000012:80A8E -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
72. 0x00000012:8BF93 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
73. 0x00000019:5DF91 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
74. 0x00000019:5E49D -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
75. 0x00000019:5E85E -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
76. 0x00000019:5EC77 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
77. 0x00000019:5F146 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
78. 0x00000019:6A9E1 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
79. 0x000000110:3C68B -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
80. 0x000000110:3CBA3 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
81. 0x000000110:3CF64 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
82. 0x000000110:3D37D -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
83. 0x000000110:3D87C -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
84. 0x000000110:491EB -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
85. 0x000000117:1AD7D -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
86. 0x000000117:1B2BD -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
87. 0x000000117:1B6A0 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
88. 0x000000117:1BA95 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
89. 0x000000117:1BF6A -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
90. 0x000000117:27BE9 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
91. 0x00000011D:8BC06 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
92. 0x00000011D:8C0E0 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
93. 0x00000011D:8C4AC -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
94. 0x00000011D:8C8B3 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
95. 0x00000011D:8CD82 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
96. 0x00000011E:6445 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
97. 0x000000124:6A2F1 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
98. 0x000000124:6A819 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
99. 0x000000124:6ABED -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
100. 0x000000124:6B007 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
101. 0x000000124:6B500 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
102. 0x000000124:76CFF -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
103. 0x00000012B:489A9 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
104. 0x00000012B:48EC0 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
105. 0x00000012B:49288 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
106. 0x00000012B:49695 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
107. 0x00000012B:49B70 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
108. 0x00000012B:54681 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
109. 0x000000132:270B5 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
110. 0x000000132:275BD -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
111. 0x000000132:27988 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
112. 0x000000132:27D89 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
113. 0x000000132:2826A -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
114. 0x000000132:31AF5 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
115. 0x000000139:577D -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
116. 0x000000139:5C85 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
117. 0x000000139:606A -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
118. 0x000000139:6465 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
119. 0x000000139:6940 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
120. 0x000000139:11DD9 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
121. 0x00000013F:7664E -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
122. 0x00000013F:76B47 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
123. 0x00000013F:76F12 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
124. 0x00000013F:77319 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
125. 0x00000013F:77812 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
126. 0x00000013F:82C99 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
127. 0x000000146:54D2D -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
128. 0x000000146:55262 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
129. 0x000000146:5563A -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
130. 0x000000146:55A5B -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
131. 0x000000146:55F48 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
132. 0x000000146:6177D -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
133. 0x00000014D:33407 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
134. 0x00000014D:3391A -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
135. 0x00000014D:33CF4 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
136. 0x00000014D:3410D -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
137. 0x00000014D:3460C -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
138. 0x00000014D:4009F -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
139. 0x000000154:11AD6 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
140. 0x000000154:11FD7 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
141. 0x000000154:123B2 -> XFUN _task_ready 0x0 0x0 0x0 0x0 0x0
142. 0x000000154:127B3 -> XFUN _taskq_resume 0x0 0x0 0x0 0x0 0x0
143. 0x000000154:12CA2 -> XFUN _taskq_suspend 0x0 0x0 0x0 0x0 0x0
144. 0x000000154:1E703 -> FUN _taskq_suspend 0x1FFF174C 0x0 0x0 0x0 0x0
145. 0x00000015A:82990 -> FUN _taskq_resume 0x1FFF174C 0x1 0x0 0x0 0x0
146. 0x00000015A:82E91 -> FUN _task_ready 0x1FFF1B9C 0x0 0x0 0x0 0x0
This is what I get from serial terminal. It seems the log is normal?
Send your user_config.h file please.
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
/**HEADER**********************************************************************
*
* Copyright (c) 2008 Freescale Semiconductor;
* All Rights Reserved
*
*******************************************************************************
*
* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************
*
* $FileName: user_config.h$
* $Version : 3.8.4.0$
* $Date : Sep-5-2012$
*
* Comments:
*
* User configuration for MQX components
*
*END**************************************************************************/
#ifndef __user_config_h__
#define __user_config_h__
/* mandatory CPU identification */
#define MQX_CPU PSP_CPU_MK60DF120M
/* MGCT: <generated_code> */
#define BSPCFG_ENET_SRAM_BUF 1
#define BSPCFG_ENABLE_I2C0 0
#define BSPCFG_ENABLE_I2C1 1
#define BSPCFG_ENABLE_II2C0 0
#define BSPCFG_ENABLE_II2C1 1
#define BSPCFG_ENABLE_SPI1 1
#define BSPCFG_ENABLE_SPI2 1
#define BSPCFG_ENABLE_FLASHX 1
#define BSPCFG_ENABLE_IODEBUG 0
#define BSPCFG_HAS_SRAM_POOL 1
#define BSPCFG_ENABLE_TTYA 0
#define BSPCFG_ENABLE_ITTYA 1
#define BSPCFG_SCI0_BAUD_RATE 19200
#define BSPCFG_ENABLE_TTYB 0
#define BSPCFG_ENABLE_ITTYB 1
#define BSPCFG_SCI1_BAUD_RATE 19200
#define BSPCFG_ENABLE_TTYC 0
#define BSPCFG_ENABLE_ITTYC 1
#define BSPCFG_SCI2_BAUD_RATE 19200
#define BSPCFG_ENABLE_TTYD 0
#define BSPCFG_ENABLE_ITTYD 1
#define BSPCFG_SCI3_BAUD_RATE 19200
#define BSPCFG_ENABLE_TTYE 0
#define BSPCFG_ENABLE_ITTYE 1
#define BSPCFG_SCI4_BAUD_RATE 19200
#define BSPCFG_ENABLE_TTYF 0
#define BSPCFG_ENABLE_ITTYF 1
#define BSPCFG_SCI5_BAUD_RATE 19200
#define BSP_DEFAULT_IO_CHANNEL "ittyd:"
#define BSP_DEFAULT_IO_OPEN_MODE NULL
#define MQX_USE_IDLE_TASK 1
#define MQX_USE_MUTEXES 1
#define MQX_USE_LOGS 1
#define MQX_TASK_DESTRUCTION 1
#define MQX_KERNEL_LOGGING 1
#define MQX_ENABLE_LOW_POWER 0
#define RTCSCFG_ENABLE_ICMP 1
#define RTCSCFG_ENABLE_SNMP 0
#define RTCSCFG_ENABLE_UDP 1
#define RTCSCFG_ENABLE_TCP 1
#define RTCSCFG_ENABLE_STATS 1
#define RTCSCFG_ENABLE_GATEWAYS 1
#define FTPDCFG_USES_MFS 1
#define TELNETDCFG_NOWAIT FALSE
#define HTTPDCFG_POLL_MODE 0
#define HTTPDCFG_STATIC_TASKS 0
#define HTTPDCFG_DYNAMIC_TASKS 1
/* MGCT: </generated_code> */
/*
** include common settings
*/
/* use the rest of defaults from small-RAM-device profile */
#include "small_ram_config.h"
/* and enable verification checks in kernel */
#include "verif_enabled_config.h"
#endif /* __user_config_h__ */
Hi Yang,
Yes, your file looks fine. It should be another problem. Could you please add a break point in the dispatch.S file just in the line where the context switch is being logged into the kernel log? Just in the same line like the screen shoot shows:
Once you reach that break point go and take a look to your KLOG in the task aware debugging (MQX menu)
Hope that helps to find what is the issue.
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Have the same issue here. Activated both macros in the user_config.h file, recompiled and however can't even access kernel log via the MQX menu (as said in your reply). Can access, however, Stack Usage. CPU Usage View is also not working.
Using FRDM-K64F + MQX RTOS 4.1 + CW 10.6.
Thank you!
Luiz Fernando
Hi Luiz,
I just tested with a few modifications to the previous code and adding a break point in the line 119. I am able to see the context switching and the CPU usage with no issues. I am attaching the new code tested in MQX 4.1 for FRDM-K64
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I've tried klog.c. It didn't work. The result is just the same as my own program.