STM32U5 with Azure RTOS, having issue with TraceX corrupted data when full.

Riscy00 Riscy00 25 Reputation points
2023-12-09T17:41:16.4266667+00:00

TraceX has 64K buffer arranged with added tx_trace_buffer_full_notify() to cap off further trace data in an attempt to resolve corrupted file due to overflowed data which led to a Truncation error by TraceX Viewer App.

It did jump to my_trace_is_full() but still has this Truncation error. It seems it not working, any suggestions?, apart from increasing the buffer size? Thanks.

UINT App_ThreadX_Init(VOID *memory_ptr)
{
  UINT ret = TX_SUCCESS;

  /* USER CODE BEGIN App_ThreadX_MEM_POOL */

  // filter out certain events
  // See https://learn.microsoft.com/en-us/azure/rtos/tracex/chapter5 for list of filter
  ret = tx_trace_buffer_full_notify(my_trace_is_full);  // Mitigate transacted issue when overflowed.
  ret = tx_trace_event_filter(TX_TRACE_TIMER_EVENTS);   // filter out unneeded item.
  // enable trace.
  ret = tx_trace_enable(&tracex_buffer,TRACEX_BUFFER_SIZE,30);
...
...
}

and

void
{
    tx_trace_disable();   // Stop collecting data
}

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
326 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,871 Reputation points
    2024-01-04T14:54:01.8733333+00:00

    Hi @Riscy00 Riscy00 Thank you for posting the solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .

    Issue:

    TraceX is running into corruption error when overloaded with data even when tx_trace_buffer_full_notify() is added to cap off further trace data.

    Solution:

    Issue seem to be fixed due to missing ALIGN(4) in linker file.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    I hope this helps!

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Riscy00 Riscy00 25 Reputation points
    2024-01-03T14:19:08.52+00:00

    Issue seem to be fixed due to missing ALIGN(4) in linker file.

    1 person found this answer helpful.
    0 comments No comments