# Logging in Amazon FreeRTOS (dynamic buffers)

**URL:** <https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843>\
**Category:** AWS\
**Created:** [May 12, 2018, 8:47am UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843 "2018-05-12T08:47:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 12, 2018, 8:47am UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843/1 "2018-05-12T08:47:10Z")

</div>

**[lesudu](https://forums.aws.amazon.com/profile.jspa?userID=451231)** 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:

```auto
 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,

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 18, 2018, 6:21pm UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843/2 "2018-05-18T18:21:09Z")

</div>

**[AWSRyanB](https://forums.aws.amazon.com/profile.jspa?userID=426853)** 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

Regards,  
-Ryan

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 22, 2018, 1:03pm UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843/3 "2018-05-22T13:03:24Z")

</div>

**[lesudu](https://forums.aws.amazon.com/profile.jspa?userID=451231)** 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

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 23, 2018, 2:16am UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843/4 "2018-05-23T02:16:16Z")

</div>

**[AWSRyanB](https://forums.aws.amazon.com/profile.jspa?userID=426853)** 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?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 23, 2018, 6:17pm UTC](https://forums.freertos.org/t/logging-in-amazon-freertos-dynamic-buffers/8843/5 "2018-05-23T18:17:41Z")

</div>

**[AWSRyanB](https://forums.aws.amazon.com/profile.jspa?userID=426853)** 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 (

```auto
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
