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.
Hi,
I'm evaluating the AM243x family with a TMDS243GPEVM development board.
For my application I do need to route an PRU-IEP compare event to the R5 intr. For that I need to configure the CMP_EVENT_ROUTER.
The R5 can read from that address space at 0xa30000 but it gets an abort if the R5 writes to a mux-control register.
Via debugger I can change these registers. In comparison, writing to the TIME_SYNC_ROUTER (0xa40000) is no problem.
Do you have any idea? I'm using bare metal. No linux, no rtos until now.
Thanks and best regards
Bastian
Hi Bastian,
Apologies for delay in response, Allow me till Thursday to get back on this.
static void Sciclient_CMP_EVENT_ROUTER_IrqSet(void) { int32_t retVal; 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_PRU_ICSSG0; rmIrqReq.src_index = 12; rmIrqReq.dst_id = TISCI_DEV_R5FSS0_CORE0; rmIrqReq.dst_host_irq = 48; rmIrqReq.ia_id = 0U; rmIrqReq.vint = 0U; rmIrqReq.vint_status_bit_index = 0U; rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST; retVal = Sciclient_rmIrqSet(&rmIrqReq, &rmIrqResp, SystemP_WAIT_FOREVER); if(0 != retVal) { DebugP_log("[Error] Sciclient event config failed!!!\r\n"); DebugP_assert(FALSE); } return; } void IsrFxn(){ //isr defination make sure to clear compare event } int main(){ Sciclient_CMP_EVENT_ROUTER_IrqSet() HwiP_Params hwiPrms; HwiP_Object compHwiObject; HwiP_Params_init(&hwiPrms); hwiPrms.intNum = 48; hwiPrms.callback = &IsrFxn; retVal = HwiP_construct(&compHwiObject, &hwiPrms); }
References:-
C:\ti\mcu_plus_sdk_am64x_08_05_00_24\source\drivers\sciclient\include\tisci\am64x_am243x
9.5.1, 9.4.1.2 of techical reference manual
To get src_id & src_index :-
Go to 9.5.1 of TRM & get IR ID corresponding to PRU_ICSSG0_PR1_IEP0_CMP_INTR_REQ_0
IR ID= 16
Check below link to get rmIrqReq.src_id & rmIrqReq.src_index :- https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am64x/interrupt_cfg.html#cmp-event- introuter0-interrupt-router-input-sources
To get destination_id & destination_host_irq
Go to C:\ti\mcu_plus_sdk_am64x_08_05_00_24\source\drivers\sciclient\include\tisci\am64x_am243x to find destination id
Go to 9.4.1.2 to find get destination_host_irq
Thank you,
I was able to configure the router via the sci client, now.
Can you please explain why the sci client is needed for that at all?
One more problem with the sciclient. If I reload the program with the debugger
retVal = Sciclient_rmIrqSet(&rmIrqReq, &rmIrqResp, SystemP_WAIT_FOREVER); if(0 != retVal) { DebugP_log("[Error] Sciclient event config failed!!!\r\n"); DebugP_assert(FALSE); }
fails, since the cmp_event_router is still configured. I need to clear the corresponding register via debugger prior starting the execution.
I need to clear the corresponding register via debugger prior starting the execution.
you can call this function at the end of your program:-
static void Sciclient_CMP_EVENT_ROUTER_IrqRelease(void) { int32_t retVal; 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_PRU_ICSSG0; rmIrqReq.src_index = 12; rmIrqReq.dst_id = TISCI_DEV_R5FSS0_CORE0; rmIrqReq.dst_host_irq = 48; rmIrqReq.ia_id = 0U; rmIrqReq.vint = 0U; rmIrqReq.vint_status_bit_index = 0U; rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST; retVal = Sciclient_rmIrqRelease(&rmIrqReq, SystemP_WAIT_FOREVER); if(0 != retVal) { DebugP_log("[Error] Sciclient event reset failed!!!\r\n"); DebugP_assert(FALSE); } return; }
Can you please explain why the sci client is needed for that at all?
They are used here to configure any of the inputs of CMPINTRTR0 to any of the CMPINTRTR0 output
you can go through this link to understand more about sciclient:-