Skip to main content
spark
Associate II
Apr 10, 2019 12:01 PM UTC
Question

I2C problem with STM32L476RGT6(NUCLEO-L476RG)

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 */

This topic has been closed for replies.

2 replies

Jack Peacock_2
Associate II
Apr 10, 2019 12:56 PM UTC

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
sparkAuthor
Associate II
Apr 10, 2019 1:44 PM UTC

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