cancel
Showing results for 
Search instead for 
Did you mean: 

I2C problem with STM32L476RGT6(NUCLEO-L476RG)

spark
Associate II

Hi,

I am using NUCLEO-L476RG. I have wrote below code using HAL library to toggle an LED via I2C. But I cant find my board address.

Kindly let me know how to find it.

MX_I2C1_Init();

 /* USER CODE BEGIN 2 */

 if (HAL_I2C_IsDeviceReady(&hi2c1,????????,2,10) == HAL_OK)

 {

 HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);

 }

 /* USER CODE END 2 */

2 REPLIES 2
Jack Peacock_2
Senior III

On an 'L476 or 'L496 Disco the MFX address is 0x84 (0x42 plus r/w bit). Try that, likely the same part. ST usually marks the schematic with the MFX bus address.

Jack Peacock

spark
Associate II

Thank you for answering. Unfortunately, It doesn't work.