Hi @Celeste_Liu ,
Thanks for the reply, this helps a lot.
I followed the steps and made some progress.
Now I can see some loggings for interrupts, but nothing from RTCS, even though I have turned on all logging for RTCS.
I have made sure that in user_config.h file:
#define RTCSCFG_LOGGING 1
#ifndef NDEBUG
#define MQX_KERNEL_LOGGING 1
#endif
I built the library in DEBUG configuration.
Here is my code:
void Task_Log_Display(uint32_t initial_data)
{
_mqx_uint result;
_mqx_uint i;
/* Create the kernel log */
result = _klog_create(2 * 1024, 0);
if (result != MQX_OK) {
printf("Main task: _klog_create failed %08x", result);
_task_block();
}
/* Clear all the control bits and then set particular ones: */
_klog_control(0xFFFFFFFF, FALSE);
/* Enable kernel logging */
_klog_control(KLOG_ENABLED | KLOG_FUNCTIONS_ENABLED | RTCSLOG_FNBASE | KLOG_INTERRUPTS_ENABLED, TRUE);
/* Tell RTCS to start logging */
RTCSLOG_enable(RTCS_LOGCTRL_ALL);
/* Write data into kernel log */
for (i = 0; i < 10; i++) {
_time_delay_ticks(5 * i);
}
/* Read data from the kernel log */
printf("\nKernel log contains:\n");
while (_klog_display()) {
_time_delay(100);
printf("k");
}
_task_block();
}
Any more clues?
Thanks,
Chin