5 years, 7 months ago.

I2C Pins on DISCO-L072CZ-LRWAN1

Hi! I am new to MBED and trying to use I2C peripheral of the STM32L072CZY. I checked the microcontroller reference manual for pin functions and connected I2C sensor as follows:

PB9 --> I2C1_SDA

PB8 --> I2C1_SCL

The I initialized I2C with following code:

I2C My_i2c(PB_8 , PB_9 );

I put serial terminal to the PA2/PA3 pins and got following message:

++ MbedOS Error Info ++

Error Status: 0x80010130 Code: 304 Module: 1

Error Message: pinmap not found for peripheral

Location: 0x8014DE1

Error Value: 0xFFFFFFFF

Current Thread: Id: 0x20002618 Entry: 0x8014E69 StackSize: 0x400 StackMem: 0x20002218 SP: 0x20002500

MbedOS Error Info

Is there a limited subset of the possible pin remapping compared to actual microcontroller reference manual?

Thanks for any help.

Question relating to:

The B-L072Z-LRWAN1 LoRa®Discovery kit is a development tool to learn and develop solutions based on LoRa®and FSK/OOK technologies.

1 Answer

5 years, 7 months ago.

The I2C pins should be declared as below:

I2C i2c(PB_9, PB_8); // SDA, SCL

Accepted Answer