6 years, 1 month ago.

I want to use a different port

hello. i'm using STM32L433RC-P board. /media/uploads/tjmw2l/inf.png

I want to use a different pin than the pins defined in the MBED example code. If I use another pin, it will be compiled but not executed. Can I use a different pin than the default pin when using UART or I2C library?

2 Answers

6 years, 1 month ago.

Hi Park,

Can you please provide me with the Mbed example code you are referring to? Also, for drivers such as UART and I2C you can use your own pin definitions in the object declaration the following way:

  1. Serial UART: Serial device(PIN_01, PIN_02); // tx, rx - replace PIN_01 and PIN_02 with the pin names on your board
  2. I2C: I2C i2c(PIN_01, PIN_02); // SDA, SCL - replace PIN_01 and PIN_02 with the pin names on your board

Please let me know if you have any questions!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

In UART communication CODE: Serial pc(SERIAL_TX, SERIAL_RX); is OK (SERIAL_TX=PA_2,SERIAL_RX=PA_3) but CODE: Serial pc(another UART prot TX, another UART port RX); is ERROR on a usb connection

In I2C communication CODE: I2C i2c(I2C_SDA, I2C_SCL) is available (I2C_SDA=PB_7, I2C_SCL=PB8) but CODE: I2C i2c(PA_10,PA_9) is not available (compile OK, but not work)

what should i do?

posted by Park Junsu 02 Oct 2018
6 years, 1 month ago.

You can't use another port. I tried to do it, but without success. Meanwhile my mobile applications rises to the top every day, because I buy app store ratings for my mobile application. I know the service who provide low cost ratings and I like it.