2020-03-14 4:46 PM
Overview
While the I2C module is enabled by CubeIDE Device Configuration Tool,
Reproduce the problem
Follow :
This excessive I2C generation define a HAL_I2C_MODULE_ENABLED incorrectly, and it interferes the program which have IFDEF block with HAL_I2C_MODULE_ENABLED.
Demonstration of the problem
This problem can be demonstrated by the d009-nucleo-h743rb-i2c project inside attached d009.zip. This program doesn't have I2C as configured module. And this has following code in the main() function.
HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_RESET);
#ifdef HAL_I2C_MODULE_ENABLED
// In this project, we don enable I2C by CubeIDE configuration.
// So, if the following code is executed, project is incorrectly configured.
HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_SET);
#endifThus, if LED is turned on, that is sign of the excessive I2C module. And you can see the LED is on if you run it on Nucleo.
Note that the d009-nucleo-g431rb-control has same logic as above, but LED is not turned on, if you run it on Nucleo G431RB. So there is no excessive I2C module issue for STM32G431
Others
I saw same problem for Nucleo L152 and Nucleo F091.
2020-03-25 3:02 AM
Hello @Takemasa ,
This will be internally checked.
Best Regards,
Khouloud