Part Number:AM5728Other Parts Discussed in Thread:AM5708
软件:CCS9.3
工程基于:ti-linux-ipc-examples\ex02_messageq
GPIO中断请问是如何实现的,目前尝试的几种方法都没有效果,或这会导致代码卡死。
代码如下:
GPIO_PinConfig gpioPinConfigs[] = {GPIO_DEVICE_CONFIG(6, 6) |GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_INPUT, }; GPIO_v1_Config GPIO_v1_config = {.pinConfigs = gpioPinConfigs,.numberOfPinConfigs = sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig), }; /* 0x4a003400U+0x20000000U */ CSL_FINS(regVal, CONTROL_CORE_PAD_IO_PAD_MCASP1_AXR15_MCASP1_AXR15_MUXMODE, 0x0000EU); ((CSL_padRegsOvly) PHYSTOVIR_REG_40000000(CSL_MPU_CORE_PAD_IO_REGISTERS_REGS))->PAD_MCASP1_AXR15 = regVal; /* GPIO initialization */ GPIO_init(); GPIO_setCallback(0, AppGpioCallbackFxn); GPIO_enableInt(0);
// GPIO_soc.c GPIO_v1_hwAttrs_list GPIO_v1_hwAttrs = { ... { #ifdef _TMS320C6XCSL_DSP_GPIO6_REGS,OSAL_REGINT_INTVEC_EVENT_COMBINER, #elif defined(__ARM_ARCH_7A__)CSL_MPU_GPIO6_REGS,66, #else #ifdef PHYSTOVIRT_EANBLEPHYSTOVIR_GPIO6_REGS, // 0x6805d000U #elseCSL_IPU_GPIO6_REGS, #endif49, #endif0,CSL_XBAR_GPIO6_IRQ_1,0}, ... }; // GPIO_app.c GPIO_PinConfig gpioPinConfigs[] = {GPIO_DEVICE_CONFIG(6, 6) |GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_INPUT, }; GPIO_v1_Config GPIO_v1_config = {.pinConfigs = gpioPinConfigs,.numberOfPinConfigs = sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig), }; /* 0x4a003400U+0x20000000U */ CSL_FINS(regVal, CONTROL_CORE_PAD_IO_PAD_MCASP1_AXR15_MCASP1_AXR15_MUXMODE, 0x0000EU); ((CSL_padRegsOvly) PHYSTOVIR_REG_40000000(CSL_MPU_CORE_PAD_IO_REGISTERS_REGS))->PAD_MCASP1_AXR15 = regVal; /* GPIO initialization */ GPIO_init(); /* */ CSL_xbarIrqConfigure (CSL_XBAR_IRQ_CPU_ID_IPU1, (49 - 22), CSL_XBAR_GPIO6_IRQ_1); // IntXbar_connectIRQ(49, CSL_XBAR_GPIO6_IRQ_1); GPIO_setCallback(0, AppGpioCallbackFxn); GPIO_enableInt(0);
Nancy Wang:
请问是否参考过例程?
www.ti.com.cn/…/PROCESSOR-SDK-RTOS-AM57X
https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_index_device_drv.html
,
zStoneTh:
版本:ti-processor-sdk-rtos-am57xx-evm-04.03.00.05/
之前看过这几个示例,目前不一样的地方在没有使用,不过在直接使用GPIO输出控制时,没有使用以下初始化也可以正常使用,所以之前没有初始化。
boardCfg = BOARD_INIT_PINMUX_CONFIG |BOARD_INIT_MODULE_CLOCK |BOARD_INIT_UART_STDIO;Board_init(boardCfg);
,
Nancy Wang:
您的代码是卡死在哪个地方?
,
zStoneTh:
IPU仿真目前卡在以下代码,不能继续查找GPIO问题
Log_print1(Diags_USER1, "VirtQueue_startup: VDEV status: 0x%x\n",Resource_getVdevStatus(VIRTIO_ID_RPMSG));Log_print0(Diags_USER1, "VirtQueue_startup: Polling VDEV status...\n");while (Resource_getVdevStatus(VIRTIO_ID_RPMSG) != VRING_BUFS_PRIMED);Log_print1(Diags_USER1, "VirtQueue_startup: VDEV status: 0x%x\n",Resource_getVdevStatus(VIRTIO_ID_RPMSG));InterruptProxy_intRegister(hostProcId, &intInfo, (Fxn)VirtQueue_isr,(UArg)NULL);Log_print0(Diags_USER1, "Passed VirtQueue_startup\n");
,
Nancy Wang:
我将您的问题升级到了英文论坛,请关注,如果有补充的部分也可以添加,谢谢!
e2e.ti.com/…/am5728-ipu-gpio-interrupt
,
zStoneTh:
好的,谢谢
,
Nancy Wang:
不客气
,
zStoneTh:
结果描述:在DSP1上使用相同函数还是,成功实现了gpio中断功能。问题记录:基于IPU2的GPIO中断还是未成功,和DSP1上的配置类似,后续如果有人知道问题,请告我一下,谢谢!记录:GPIO8_13 GPIO_INIT_LINE_2
#define GPIO_INPUT1_PORT (8) #define GPIO_INPUT1_PIN(13)GPIO_PinConfig gpioPinConfigs[] = {GPIO_DEVICE_CONFIG(GPIO_INPUT1_PORT, GPIO_INPUT1_PIN)|GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_INPUT, };GPIO_v1_Config GPIO_v1_config = {.pinConfigs = gpioPinConfigs,.numberOfPinConfigs = sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig), };void user_gpio_init() {CSL_FINS(regVal, CONTROL_CORE_PAD_IO_PAD_VOUT1_D13_VOUT1_D13_MUXMODE, 0xEU);((CSL_padRegsOvly) PHYSTOVIR_REG_40000000(CSL_MPU_CORE_PAD_IO_REGISTERS_REGS))->PAD_VOUT1_D13 = regVal; /* vout1_d13gpio8_13 */CSL_xbarDspIrqConfigure(1,CSL_XBAR_INST_DSP1_IRQ_49,CSL_XBAR_GPIO8_IRQ_2);Hwi_Params hwiParams;Hwi_Handle myHwi;Error_Block eb;Error_init(&eb);Hwi_Params_init(&hwiParams);hwiParams.enableInt = FALSE;hwiParams.eventId = 49;myHwi = Hwi_create(4, AppGpioCallbackFxn, &hwiParams, &eb);if (myHwi == NULL) {Log_print0(Diags_INFO, "--> user_debug_gpio_input_function: Hwi_create error!");} else {Hwi_enableInterrupt(4);}/* GPIO initialization */GPIO_init();GPIOPinIntClear(PHYSTOVIR_GPIO8_REGS,GPIO_INT_LINE_2,(13));GPIOPinIntEnable(PHYSTOVIR_GPIO8_REGS,GPIO_INT_LINE_2,(13));}void AppGpioCallbackFxn(UArg arg) {/* Toggle LED1 */GPIO_toggle(DEBUG_LED0);GPIOPinIntClear(PHYSTOVIR_GPIO8_REGS,GPIO_INT_LINE_2,(13));Hwi_clearInterrupt(4); }void app_update_gpio_interrupt(void) {GPIOTriggerPinInt(PHYSTOVIR_GPIO8_REGS, GPIO_INT_LINE_2, (13)); }
,
user3688025:
你好,
((CSL_padRegsOvly) PHYSTOVIR_REG_40000000(CSL_MPU_CORE_PAD_IO_REGISTERS_REGS))->PAD_VOUT1_D13 = regVal;
上面这句的,PHYSTOVIR_REG_40000000是什么,编译器会报错误,是不是应该是,、
((CSL_padRegsOvly) CSL_DSP_CORE_PAD_IO_REGISTERS_REGS)->PAD_VOUT1_D13=regVal;
我用你的这个配置方式,配置后,还是进不了中断函数内。
我有芯片是AM5708,用的DSP核心
你的工程能发一下么