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.

AM6442: Add UART to RPMSG project breaks RPMSG and DebugP_log()

Part Number: AM6442

I have an R5F project on the AM64442 (SK and EVM) using RPMSG which works.  DebugP_log() logs correctly to shared memory with Linux.  I can see all of my DebugP_log() output in /sys/kernel/debug/remoteproc/remoteproc0/trace0.  I can communicate with RPMSG using rpmsg_char_simple example from Linux.

I modify syscfg file to add a UART.

DebugP_log() stops working.

RPMSG tests using rpmsg_char_simple return errors with no channel detected.

Tracked down to ti_power_clock_config.c, in the call to Module_clockSetFrequency(). The code uses the following table with an entry for the UART.

If I DO NOT initialize the UART clock, then RPMSG and DebugP_log() to trace0 work just fine.

If I DO initialize the UART clock, then RPMSG and DebugP_log() to trace0 immediately stop working.

void Module_clockSetFrequency(void)
{
int32_t status;
uint32_t i = 0;

DebugP_log("Module_clockSetFrequency() - ENTRY\n");
while(gSocModulesClockFrequency[i].moduleId!=SOC_MODULES_END)
{

DebugP_log("Module_clockSetFrequency() - SOC_moduleSetClockFrequency(%lu,%lu,%lu)\n",
gSocModulesClockFrequency[i].moduleId,
gSocModulesClockFrequency[i].clkId,
gSocModulesClockFrequency[i].clkRate);

status = SOC_moduleSetClockFrequency(
gSocModulesClockFrequency[i].moduleId,
gSocModulesClockFrequency[i].clkId,
gSocModulesClockFrequency[i].clkRate

);
DebugP_assertNoLog(status == SystemP_SUCCESS);
i++;
}
}

SOC_ModuleClockFrequency gSocModulesClockFrequency[] = {

// { TISCI_DEV_UART0, TISCI_DEV_UART0_FCLK_CLK, 96000000 },

{ SOC_MODULES_END, SOC_MODULES_END, SOC_MODULES_END },
};

???How do I use BOTH UART and my already-functioning RPMSG/DebugP_log()-to-trace0 in the same program???

  • Hello KCH,

    To confirm, is UART used by the R5 core, or the Linux A53 core?

    Regards,

    Nick

  • The UART is userd by the R5F core.

    I have two projects.

    The first uses RPMSG and DebugP_log() to shared memory and works.

    The second uses Matlab and UART, and works.

    Trying to merge the two projects leads to the failures, BEFORE ANY MATLAB CODE EXECUTES.

    The failure occurs during the SOC_moduleSetClockFrequency() call.  Before the call DebugP_log() calls show up in the trace0 shared-memory log on Linux. After the call, no more items show up in the trace0 log on Linux.

    I can only test the RPMSG code after the app is completely up, so I cannot say for certain that RPMSG is killed by that call, but if I comment-out the initializer entry in gSocModulesClockFrequency, which causes the while loop not to run, RPMSG works fine.  If I leave in the entry, then tests with rpmsg_char_simple fail:

    root@am64xx-evm:~# rpmsg_char_simple -r 2
    _rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio0.rpmsg_chrdev.-1.14
    Can't create an endpoint device: Success
    TEST STATUS: FAILED

  • Hello,

    Apologies for the delayed response. Are there any changes since your last post?

    Regards,

    Nick