Hello.
I’ve been checking dozens of registers, lines, source code, etc, and I do not find what is wrong.
The interrupt is set in the DW1000:
[code] /* Configure DW1000. See NOTE 3 below. */
dwt_configure(&config);
/* Register RX call-back. */
dwt_setcallbacks(&tx_conf_cb, &rx_ok_cb, &rx_to_cb, &rx_err_cb);
/* Enable wanted interrupts (TX confirmation, RX good frames, RX timeouts and RX errors). */
dwt_setinterrupt(DWT_INT_TFRS | DWT_INT_RFCG | DWT_INT_RFTO | DWT_INT_RXPTO | DWT_INT_RPHE | DWT_INT_RFCE | DWT_INT_RFSL | DWT_INT_SFDT, 1);[/code]
The GPIOs clock is enabled, the interrupt line is read by the STM32F103C8
[code] /* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin : DW_IRQn_Pin */
GPIO_InitStruct.Pin = DW_IRQn_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
HAL_GPIO_Init(DW_IRQn_GPIO_Port, &GPIO_InitStruct);[/code]
I transmit in immediate mode and check sys_status and tx_fctrl:
[code] /* Write frame data to DW1000 and prepare transmission. See NOTE 4 below./
dwt_writetxdata(sizeof(tx_msg), tx_msg, 0); / Zero offset in TX buffer. /
dwt_writetxfctrl(sizeof(tx_msg), 0, 0); / Zero offset in TX buffer, no ranging. */
/* Start transmission. */
dwt_starttx(DWT_START_TX_IMMEDIATE);
TXFCTRLreg = dwt_read32bitoffsetreg(TX_FCTRL_ID, 0);
sysSTUSreg = dwt_read32bitoffsetreg(SYS_STATUS_ID, SYS_STATUS_OFFSET);[/code]
Check the TX_FCTLR and the SYS_STATUS. In the TX_FCTLR is indicated that 14 chars has been transmitted. In the SYS_STATUS, the IRQS bit is high, and all the TX flags are high as well (The last byte is 0xF3), but the IRQn line is not set to high. I’ve tried to use pull down, pull up, and no pull, and the result is the same.
By software I forced the GPIO associated to IRQn to be high and all the software is correctly done. The interrupt handler calls to dw_isr, and finally to tx_conf_cb().
I’ve changed the DWM1000 in order to discard this particular IC malfunction.
So, everything should be ok (it is basically ex_03d_tx_wait_resp_interrupts ported to HAL and Cubemx) but the IRQn line do not go high.
¿Does anybody have a hint about what is happening?
Thanks in advance, regards.