2023-01-01 07:06 AM
Setup in use:
The issue is that I cannot read the ST25DV ID via I2C DMA read. I simply do not get an answer. While the I2C blocking read works fine.
Simple test code I made:
// main.c
MX_NFC_Init();
/* USER CODE BEGIN 2 */
uint8_t pData = 0u;
// WORKS!
if ( HAL_OK != HAL_I2C_Mem_Read(&hi2c1, 0x00AE, 0x0017, 0x0002, &pData, 0x0001, 0x1000) )
{
__NOP();
assert_param(false);
return 0u;
}
pData = 0u;
// DOES NOT WORK.
if ( HAL_OK != HAL_I2C_Mem_Read_DMA(&hi2c1, 0x00AE, 0x0017, 0x0002, &pData, 0x0001) )
{
assert_param(false);
return 0u;
}
//STUCK HERE!
while(!pData)
{
}
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_NFC_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
Anything wrong that I am doing?
Solved! Go to Solution.
2023-01-04 07:21 AM
Thanks,
I replaced all the code for the I2C DMA with the code from example: I2C_TwoBoards_CommDMA.
Now it works. Did not have the time to investigate it for a better conclusion.
What I am pretty sure is that CubeMx gives a bad code when:
Adding I2C DMA support for P-NUCLEO-STM32WB development board with X-NUCLEO-NFC04A1 expansion board with software pack ( NFC 4.2.0.5). I guess you guys can test it yourself to check.
2023-01-01 09:37 PM
Find a bit bamg sw I2C for board bringup. Make sure you have open drain mode gpio and external pull up resistor. Usually with an oscilloscope, I2C messages are easy decoded by just looking....
2023-01-03 08:58 AM
Hello,
Can you put a scope probe on SDA and SCL signals to check that the STM32 is correctly sending the I2C request to the ST25DV when using the DMA I2C read ?
Best regards.
2023-01-04 07:21 AM
Thanks,
I replaced all the code for the I2C DMA with the code from example: I2C_TwoBoards_CommDMA.
Now it works. Did not have the time to investigate it for a better conclusion.
What I am pretty sure is that CubeMx gives a bad code when:
Adding I2C DMA support for P-NUCLEO-STM32WB development board with X-NUCLEO-NFC04A1 expansion board with software pack ( NFC 4.2.0.5). I guess you guys can test it yourself to check.