This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

[FAQ] TDA4VM: How Can I View Remote Core Traces with QNX HLOS?

Intellectual 2145 points

Replies: 1

Views: 144

Part Number: TDA4VM

I have a remote core firmware that is printing debug traces, and I have QNX HLOS running on A72. How can I view the remote core traces with QNX HLOS?

  • On TDA4x/DRA82x devices, A72 based applications have a couple options for getting the remote core traces, depending on how the remote core application is printing the traces.

     

    1. The remote core application can print traces to a shared buffer and then use a simple function or application on the QNX host to read and dump the contents of the shared buffer. Some A72 based apps (like vision apps) already do this and provide an logger application (for example, vx_app_qnx_arm_remote_log.out located in …/vision_apps/apps/basic_demos/app_remote_log/main_remote_log.c).

     

    Below is a simple example of how to dump the traces from a specified memory address.

    A function like this could be used to print traces from, for example, the IPC echo test examples that print to the SysMin buffer. (The address and size of the SysMin outbuf can be found in the map file for the remote core image.)

     

     

    void printTraces (void * bufferAddress, int32_t bufferSize)

    {

        char                * traceBuffer;

        uint32_t              numBytesToCopy;

        void                * vaddr;

        char                * tempBuffer;

     

        /* Get the user virtual address of the buffer */

        vaddr = mmap_device_memory(NULL, bufferSize, PROT_READ|PROT_WRITE|PROT_NOCACHE, 0, (uint64_t)(bufferAddress));

        if (vaddr == MAP_FAILED) {

            printf("Failed to mmap device memory\n");

            return;

        }

        traceBuffer = (char *)(vaddr);

     

        /* Allocate temp buffer for adding '\0' at end of trace buffer */

        tempBuffer = malloc(bufferSize + 1);

     

        numBytesToCopy = strnlen(vaddr, bufferSize);

        memcpy (tempBuffer, traceBuffer, numBytesToCopy);

        tempBuffer [numBytesToCopy + 1] = 0;

        fprintf (log, "%s", tempBuffer);

        fflush (log);

     

        free(tempBuffer);

        munmap(vaddr, bufferSize);

     

        return;

    }

     

    2. If traces are printed using the SYS/BIOS SysMin module, you can additionally connect to the core and view the traces using ROV in CCS (view the SysMin module’s OutputBuffer).

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.