Logging in Amazon FreeRTOS (dynamic buffers)

lesudu wrote on May 12, 2018:

Hello,

I am trying to port Amazon FreeRTOS logging function to Atmel SAM4E Xplained pro.

I initialized the heap memory as we are using dynamic buffers.

Whenever the configPRINTF is called, I can see the debug messages in Atmel Studio 7.0.
in aws_logging_task_dynamic_buffers.c :
I can see that string is being stored in the dynamic memory when this function is called:

 xQueueSend( xQueue, &pcPrintString, loggingDONT_BLOCK )

(here, the string is sent to the logging task)

But, inside the logging task, whenever it is in this function,

xQueueReceive( xQueue, &pcReceivedString, portMAX_DELAY ) 

the debug window shows,
0xa5a5a5a5 <error: Cannot access memory at address 0xa5a5a5a5>

So, the log message is not printed in the UDP console (I am using UDP logging).

Kindly suggest a solution! Thanks!

Regards,
Sudarshan

AWSRyanB wrote on May 18, 2018:

Hello Sudarshan,

1. I'd like to know a little more about your configuration. Can I get the
   values for the following configuration constants?
  • INCLUDE_xTaskGetSchedulerState

  • configUSE_TIMERS

  • configUSE_QUEUE_SETS

    1. Also, I’m assuming 0xa5a5a5a5 is not the literal address that you see.
      Is that correct?

    2. What do you see when prvCopyDataFromQueue() is called?

Regards,
-Ryan

lesudu wrote on May 22, 2018:

Hi,

  1. Regarding configuration,
    the constants INCLUDE_xTaskGetSchedulerState , configUSE_TIMERS and configUSE_QUEUE_SETS are set to 1.

  2. 0xa5a5a5a5 is the literal address I see everytime.

  3. I see this when the function is called, the state of variables are:
    pvBuffer 0x2000b2c8 <uxTimerTaskStack.12207+440>
    pxQueue 0x200007d0 <xStaticTimerQueue.6631>

Best regards,
Sudarshan

Edited by: lesudu on May 22, 2018 6:03 AM

AWSRyanB wrote on May 23, 2018:

Off hand, that’s not the queue for the logging task.
Note there will be multiple queues in operation at any given time.

Can you check to see if xQueueReceive is called with xQueue from aws_logging_task_dynamic_buffers.c? You may want to rename that variable to make it easier to check for in the debugger.

If xQueueReceive is never called on the logging queue, then it may be that the logging task is not running.

Are you able to give us more information about the port you are working on?

AWSRyanB wrote on May 23, 2018:

Can I also ask what specifically is pointing to 0xA5A5A5A5?

Is it xQueue? pxQueue? pvBuffer? Or one of the member variables for pxQueue?

0xA5A5A5A5 is what we initialize the stack memory to (

stack_macros.h

). So, that indicates that you’re looking at an uninitialized variable. And so, I am trying to figure out a bit more about which variable is uninitialized.

-RB