AM6442: AM6442 - GPIO Interrupt on R5 while A53 runs linux

Part Number: AM6442

CCS 21.0.0

MCU plus sdk 12.01.00.33

syscfg 1.27.0

I have an AM6442 that I am trying to get a basic gpio interrupt working. I have linux running on the A53s and FreeRTOS running on the R5F0_0. I setup syscfg in the following manner:
image.png

I am calling the Board_gpioInit function after system and board init. I've called it before and after starting the scheduler. I went into the device tree and added the following lines:
&main_gpio0 {
    status = "reserved";
};

&main_gpio1 {
    status = "reserved";
};

&mcu_gpio0 {
    status = "reserved";
};

&main_gpio_intr {
    status = "reserved";
};

&mcu_gpio_intr {
    status = "reserved";
};

I have also added libgpiod to my build and can confirm no gpios are detected. Even so, in Board_gpioInit the program hangs on a DebugP_assert as the call to Sciclient_rmIrqSet alwasy returns -1 (I am doing this before setting up my HwiP parameters). Below is the following sciclient setup for rmIrqSet:

struct tisci_msg_rm_irq_set_req rmIrqReq;
struct tisci_msg_rm_irq_set_resp rmIrqResp;
rmIrqReq.valid_params = 0U;
rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_ID_VALID;
rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;
rmIrqReq.global_event = 0U;
rmIrqReq.src_id = TISCI_DEV_GPIO0;
rmIrqReq.src_index = TISCI_BANK_SRC_IDX_BASE_GPIO0 + GPIO_GET_BANK_INDEX(17);
rmIrqReq.dst_id = TISCI_DEV_R5FSS0_CORE0;
rmIrqReq.dst_host_irq = CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_7;
rmIrqReq.ia_id = 0U;
rmIrqReq.vint = 0U;
rmIrqReq.vint_status_bit_index = 0U;
rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;

Any ideas what I might be doing wrong? I am new to this architecture and still working out some of the details.
  • Hello Sean,

    The first thing to check is definitely the settings to make sure you don't have a resource conflict. You can also double-check the actual Linux devicetree information that was loaded into the EVM by checking /sys/firmware/devicetree/.

    This is one thing you can try to find the GPIO nodes and make sure they are actually disabled (to rule out not actually loading the correct .dtb file during boot):
    // let's figure out where the pinmux devicetree node is
    root@am335x-evm:/sys/firmware/devicetree/base# cd __symbols__/
    root@am335x-evm:/sys/firmware/devicetree/base/__symbols__# cat i2c0_pins
    /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/pinmux_i2c0_pins

    You can also check the boot logs to see what the R5F is reporting. Refer to AM64x multicore academy > Application development on remote cores > Debug the remote core alongside Linux:
    https://dev.ti.com/tirex/explore/node?isTheia=false&node=A__AU9Punu4yTQu9hRP62aoug__AM64-ACADEMY__WI1KRXP__LATEST

    Debug through the Linux terminal - shows how to check the trace log for prints

    Debug through CCS - good for deeper debug

    Regards,

    Nick

  • Hi Nick,

    Thanks for your response. I doubled check the device tree path you recommended. Mine looked like this:

    /sys/firmware/devicetree/base/gpio@600000

    I checked the status file and it reported "reserved" I also checked it for the other gpio groups and they reported reserved as well. Currently looking into this link next: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1063028/am64x-understanding-interrupts

    But still no luck with anything. The code always returns -1 from Sciclient_rmIrqRequest still. Nothing I have done has seem to improve the situation.

  • Maybe a bit more context for someone that might know more than me. I started off with the basic IPC example TI has for all the cores to allow them to communicate with Linux via rpmsg. I basically tried to splice the code from the input interrupt example for the r5. The IPC is using FreeRTOS while the input interrupt is baremetal. Is there a specific point in the FreeRTOS I should be calling Board_gpioInit? Also, is there anything else I need to be doing in the device tree to get this work? I reserved all those gpio and gpio_intr nodes, is there something else to modify?

  • Just some more debugging notes: Tried a different gpio (gpio1_68), unfortunately no dice on that.

  • Hello Sean,

    Based on your /sys/firmware/devicetree info, it looks like you are applying the Linux devicetree settings as expected. This does not look like a resource allocation issue (at least from the perspective of Linux claiming the GPIO module).

    I am sending your thread over to a team member who is more familiar with MCU+ programming. Please ping the thread if you do not get another response within a couple of business days.

    Regards,

    Nick

  • Hi Sean,

    Can you please check your resource allocation is correct or not for the R5F0-0 core? Are the GPIO MUX routers allocated to the R5F0-0 core?

    You can run the below command from linux userspace to see the list of allocated resources for each core.

    k3conf dump rm

    Please also refer  [FAQ] TDA4VM: K3conf: Capabilities with options(help) for k3conf tool usage. 

    Regards,

    Tushar

  • Hi Tushar,

    Thanks for help! I added k3conf to my yocto build, I've added the output here:

    |-----------------------------------------------------------------------------------------------------|
    | VERSION INFO                                                                                        |
    |-----------------------------------------------------------------------------------------------------|
    | K3CONF           | (version 0.4-nogit built Thu Feb 12 06:06:58 UTC 2026)                           |
    | SoC              | AM64x SR2.0                                                                      |
    | SoC identifiers  | [0x328cdce4] 0x19466 Func-Safe Non-Secure 'S' Grade -40 C to 105 C  ALV Package  |
    | SYSFW            | ABI: 4.0 (firmware version 0x000b '11.2.5--v11.02.05 (Fancy Rat))')              |
    | F/w Capabilities | 0x1: GEN                                                                         |
    |-----------------------------------------------------------------------------------------------------|
    
    |-----------------------------------------------------------------------------------------------------------------------------------------|
    | Resource allocation => [Primary start +count] (Secondary start +count)                                                                  |
    |-----------------------------------------------------------------------------------------------------------------------------------------|
    | utype  | type | subtype | A53_2         | M4_0          | MAIN_0_R5_0   | MAIN_0_R5_1   | MAIN_0_R5_3   | MAIN_1_R5_1   | MAIN_1_R5_3   |
    |-----------------------------------------------------------------------------------------------------------------------------------------|
    | 0x0040 | 1    | 0       | [    0 +  16] |               | [   16 +   4] | [   16 +   4] | [   20 +   4] | [   24 +   4] | [   28 +   4] |
    | 0x00c0 | 3    | 0       | [    0 +  12] |               |               |               |               | [   12 +   2] | [   14 +   2] |
    | 0x0140 | 5    | 0       | [    0 +   4] | [    4 +   4] |               |               |               |               |               |
    | 0x0180 | 6    | 0       |               |               |               |               |               |               |               |
    | 0x0682 | 26   | 2       |               |               |               |               |               |               |               |
    | 0x0683 | 26   | 3       |               |               |               |               |               |               |               |
    | 0x068d | 26   | 13      | [    0 +  12] | [   26 +   1] | [   12 +   6] | [   12 +   6] | [   18 +   2] | [   20 +   4] | [   24 +   2] |
    | 0x068e | 26   | 14      | [   48 +   6] |               | [   54 +   6] | [   54 +   6] | [   60 +   2] | [   62 +   4] | [   66 +   2] |
    | 0x068f | 26   | 15      | [   28 +   6] |               | [   34 +   6] | [   34 +   6] | [   40 +   2] | [   42 +   4] | [   46 +   2] |
    | 0x06a0 | 26   | 32      | [    0 +  12] | [   26 +   1] | [   12 +   6] | [   12 +   6] | [   18 +   2] | [   20 +   4] | [   24 +   2] |
    | 0x06a1 | 26   | 33      | [    0 +   6] |               | [    6 +   6] | [    6 +   6] | [   12 +   2] | [   14 +   4] | [   18 +   2] |
    | 0x06a2 | 26   | 34      | [    0 +   6] |               | [    6 +   6] | [    6 +   6] | [   12 +   2] | [   14 +   4] | [   18 +   2] |
    | 0x070a | 28   | 10      | [    5 +  35] | [  168 +  16] | [   44 +  14] | [   44 +  14] | [   58 +  14] | [   92 +  14] | [  106 +  14] |
    | 0x070d | 28   | 13      | [   16 + 512] | [ 1424 +  96] | [  528 + 256] | [  528 + 256] | [  784 + 192] | [  976 + 256] | [ 1232 + 192] |
    | 0x070f | 28   | 15      |               |               |               |               |               |               |               |
    | 0x0710 | 28   | 16      |               |               |               |               |               |               |               |
    | 0x0711 | 28   | 17      |               |               |               |               |               |               |               |
    | 0x0712 | 28   | 18      |               |               |               |               |               |               |               |
    | 0x0713 | 28   | 19      |               |               |               |               |               |               |               |
    | 0x0714 | 28   | 20      |               |               |               |               |               |               |               |
    | 0x0715 | 28   | 21      |               |               |               |               |               |               |               |
    | 0x0716 | 28   | 22      |               |               |               |               |               |               |               |
    | 0x0717 | 28   | 23      |               |               |               |               |               |               |               |
    | 0x0718 | 28   | 24      |               |               |               |               |               |               |               |
    | 0x0719 | 28   | 25      |               |               |               |               |               |               |               |
    | 0x071a | 28   | 26      |               |               |               |               |               |               |               |
    | 0x071b | 28   | 27      |               |               |               |               |               |               |               |
    | 0x071c | 28   | 28      |               |               |               |               |               |               |               |
    | 0x071d | 28   | 29      |               |               |               |               |               |               |               |
    | 0x071e | 28   | 30      |               |               |               |               |               |               |               |
    | 0x0783 | 30   | 3       |               |               |               |               |               |               |               |
    | 0x0790 | 30   | 16      | [    0 +   4] | [   15 +   1] | [    4 +   3] | [    4 +   3] | [    7 +   2] | [    9 +   4] | [   13 +   2] |
    | 0x0791 | 30   | 17      | [   16 +  64] |               | [   16 +  64] |               |               |               |               |
    | 0x0792 | 30   | 18      |               |               |               |               |               |               |               |
    | 0x0793 | 30   | 19      | [   88 +   8] |               |               |               |               |               |               |
    | 0x0794 | 30   | 20      | [   96 +   8] |               |               |               |               |               |               |
    | 0x0795 | 30   | 21      | [  104 +   8] |               |               |               |               |               |               |
    | 0x0796 | 30   | 22      | [  112 +   4] | [  127 +   1] | [  116 +   3] | [  116 +   3] | [  119 +   2] | [  121 +   4] | [  125 +   2] |
    | 0x0797 | 30   | 23      | [  128 +  16] |               | [  128 +  16] |               |               |               |               |
    | 0x0798 | 30   | 24      |               |               |               |               |               |               |               |
    | 0x0799 | 30   | 25      |               |               |               |               |               |               |               |
    | 0x079a | 30   | 26      | [  152 +   8] |               |               |               |               |               |               |
    | 0x079b | 30   | 27      | [  152 +   8] |               |               |               |               |               |               |
    | 0x079c | 30   | 28      | [  160 +  64] |               |               |               |               |               |               |
    | 0x079d | 30   | 29      | [  224 +  64] |               |               |               |               |               |               |
    | 0x07a3 | 30   | 35      | [    0 +   4] | [   15 +   1] | [    4 +   3] | [    4 +   3] | [    7 +   2] | [    9 +   4] | [   13 +   2] |
    | 0x07a4 | 30   | 36      | [   16 +   8] |               | [   16 +   8] |               |               |               |               |
    | 0x07a5 | 30   | 37      |               |               |               |               |               |               |               |
    | 0x07a6 | 30   | 38      | [   25 +   1] |               |               |               |               |               |               |
    | 0x07a7 | 30   | 39      | [   26 +   8] |               |               |               |               |               |               |
    | 0x07a8 | 30   | 40      | [   34 +   8] |               |               |               |               |               |               |
    | 0x07a9 | 30   | 41      | [    0 +   4] | [   15 +   1] | [    4 +   3] | [    4 +   3] | [    7 +   2] | [    9 +   4] | [   13 +   2] |
    | 0x07aa | 30   | 42      | [    0 +   4] | [   15 +   1] | [    4 +   3] | [    4 +   3] | [    7 +   2] | [    9 +   4] | [   13 +   2] |
    | 0x07ab | 30   | 43      | [   16 +   1] |               | [   16 +   1] |               |               |               |               |
    | 0x07ac | 30   | 44      | [   16 +  16] |               | [   16 +  16] |               |               |               |               |
    | 0x07ad | 30   | 45      |               |               |               |               |               |               |               |
    | 0x07ae | 30   | 46      |               |               |               |               |               |               |               |
    | 0x07af | 30   | 47      |               |               |               |               |               |               |               |
    | 0x07b0 | 30   | 48      |               |               |               |               |               |               |               |
    | 0x07b1 | 30   | 49      | [   19 +   1] |               |               |               |               |               |               |
    | 0x07b2 | 30   | 50      | [   40 +   8] |               |               |               |               |               |               |
    | 0x07b3 | 30   | 51      | [   20 +   1] |               |               |               |               |               |               |
    | 0x07b4 | 30   | 52      | [   40 +   8] |               |               |               |               |               |               |
    | 0x07b5 | 30   | 53      | [   21 +   4] |               |               |               |               |               |               |
    | 0x07b6 | 30   | 54      | [   48 +  64] |               |               |               |               |               |               |
    | 0x07b7 | 30   | 55      | [   25 +   4] |               |               |               |               |               |               |
    | 0x07b8 | 30   | 56      | [  112 +  64] |               |               |               |               |               |               |
    | 0x0840 | 33   | 0       |               |               |               |               |               |               |               |
    | 0x084a | 33   | 10      | [    2 +   2] |               |               |               |               |               |               |
    | 0x084c | 33   | 12      |               |               | [   20 +   2] | [   20 +   2] | [   22 +   2] | [   24 +   2] | [   26 +   2] |
    |-----------------------------------------------------------------------------------------------------------------------------------------|
    
    

  • Ok great news: After using that k3conf tool, it seems like by default the r5f1 core has access to the gpiomux interrupt router. Moving the code to that I was able to get an interrupt to occur. My next question is how do I configure the system so the r5f0 cores have access as well?

  • Hi Sean, 

    Thank you for the above confirmation. To allocate resources to R5F0-0 core, you can use the k3-resource partitioning tool.

    Please refer  [FAQ] How to use K3 resource partitioning tool with Processor SDK v9.0 or v9.1? for details on resource partitioning tool usage.

    Regards,

    Tushar 

  • Ok, I'll take a look at that and if I have any issues I will make a new thread then. Thanks!