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.

AM6546: MessageQueue and HW Interrupt for Mailbox working together

Part Number: AM6546
Other Parts Discussed in Thread: SYSCONFIG

We are developing an application that involves PRU-0, RTU-0, R5F-0 and A53 cores.

The R5F-0  awaits events from the RTU-0 via hardware interrupts for mailbox.

/* Hwi creation */
Error_init(&eb);
Hwi_Params_init(&hwiParams);
hwiParams.maskSetting = Hwi_MaskingOption_LOWER;
hwiParams.arg = interruptNum;
Hwi_construct(&hwiStruct, interruptNum, mailbox_isr, &hwiParams, &eb);

/* Event creation */
Event_Params_init(&eventParams);
Event_construct(&eventStruct, &eventParams);
hEvent = Event_handle(&eventStruct);

// Mailbox Initialization
HW_WR_REG32(CSL_NAVSS0_MAILBOX_REGS3_BASE+CSL_MAILBOX_SYSCONFIG, 1); // soft reset
while (1 == HW_RD_REG32(CSL_NAVSS0_MAILBOX_REGS3_BASE+CSL_MAILBOX_SYSCONFIG)) {}; // wait for reset to clear

/* Enable interrupt for Mailbox 3 User 0 */
HW_WR_REG32(CSL_NAVSS0_MAILBOX_REGS3_BASE+CSL_MAILBOX_USER_IRQ_ENABLE_SET(0), 1);

However, I also need to establish communication between R5F-0 and the A53. This has  been done using the MessageQueue framework. An application was written in R5F and A53 to communicated via 2 queues ( similar to ex02_messageq) and this was found to work perfectly. 

However, when the message queue code is incorporated with the HW Interrupt (b/w RTU-0 & R5F-0) code, I found that the A53 application could not find the message queue created by the R5F-0.

Is there something that needs to be done so that both implementations to work together? It looks like some configuration of mailboxes need to be done.

Thanks in advance

  • Dhruva,

    To confirm, you have two working projects - one for R5F:RTU and one for R5F:A53, and the latter is the default IPC application in the Processor SDK?

    Can you confirm how you are loading the cores, the System Firmware, and splitting the board config? Assuming you are loading through Linux, you'll need to be sure that you are not configuring the system firmware under Linux and additionally performing a board init by the RTOS application. The System firmware should be loaded only once during boot and configured through rm-cfg.

    Best regards,

    Dave

  • Hello Dave,

    I just have the one project which contains both R5F:RTU. The R5F receives a hardware interrupt from the RTU ( RTU writes to Mailbox 3 Message 0 ). I also have another task that uses message-queue to communicate with the A53 ( derived from the ex02_messageq example that shipped as an IPC example with SDK ).

  • Hi Dave,

    The problem was in the following lines of code:

    // Mailbox Initialization
    HW_WR_REG32(CSL_NAVSS0_MAILBOX_REGS3_BASE+CSL_MAILBOX_SYSCONFIG, 1); // soft reset
    while (1 == HW_RD_REG32(CSL_NAVSS0_MAILBOX_REGS3_BASE+CSL_MAILBOX_SYSCONFIG)) {}; // wait for reset to clear

    The register controls the entire mailbox system and was resetting all Mailboxes.

  • Dhruva,

    Thanks for the update to this thread. To confirm, did updating this portion of the code correct the problem for you and the issue is resolved?

    Best regards,

    Dave