5 years, 9 months ago.

Nucleo-L432KC communicate with Serial and I2C

Hi,

I'm using the Nucleo-L432KC I'm trying to add the following devices to the board:

1. A GSM device that uses for serial communication. 2. A LCD screen that uses I2C. 3. Serial communication to the USB port so that I can debug with a terminal.

My understanding is that I can use the following pins:

Serial gsm(D1, D0); tx, rx Serial pc(SERIAL_TX, SERIAL_RX); I2C i2c_lcd(A4,A5); SDA, SCL

Please can someone explain how the solder bridges are configured as standard and how they must be changed to facilitate the above setup?

Or

Alternatively can you propose an ideal setup for this project?

Kind regards

Koos van der Wat

2 Answers

5 years, 9 months ago.

Hi Koos,

I have looked at the datasheet here: https://www.st.com/resource/en/datasheet/stm32l432kc.pdf

It looked like the debug serial communication already hooked up to PA2 and PA15. You can still used USART1: TX = PA_9 or PB_6, RX = PA_10 or PB_7 for the other serial communication. For more references, you can take a look at this post here: https://os.mbed.com/questions/81868/UART2-and-3-on-the-L432KC/

As for for the LCD screen, you can use this example for reference: https://os.mbed.com/teams/ST/code/Nucleo32_gravitech_7seg/?platform=ST-Nucleo-L432KC

Please let me know if you have any questions!

- Peter, team Mbed

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

Accepted Answer

Dear Peter,

Thank you very much.

Kind regards

Koos

posted by Koos van der Wat 03 Aug 2018
5 years, 9 months ago.

Koos -

STM documents their development boards in a series of User Manuals. The User Manual that includes the Nucleo L432KC is UM1956 (just Google "stm um1956"). Table 6.10 of UM1956 describes the solder bridges and the default configurations. The electrical schematics are at the back of the document.

In UM 1956 Table 6.10 and the board schematic you will see that the default solder bridge configuration connects D4 = PB_7 to A4 = PA_5 and D5 = PB_6 to A5 = PA_5.

The configuration you suggest will probably give an mbed compiler error, which can be understood by examining the PeripheralPins.c file for this board target. From this file you can see that you can do the following:

- Use UART_1 for your GSM serial device, with UART_1 TX pin = D1 = PA_9 and UART_1 RX pin = D0 = PA_10.

- Use I2C_1 for your LCD screen, with I2C_1 SDA pin = D4 = PB_7 and I2C_1 SCL pin = D5 = PB_6.

- Your USB communications can use the default STDIO_UART, which is UART_1. The UART_1 TX pin = SERIAL_TX = PA_2 = A7 and the UART_1 RX pin = SERIAL_RX = PA_15. Note that the MCU pin PA_15 is not brought out to the board connectors.

You cannot use A4 = PA_5 or A5 = PA_6 for any function if you are using I2C_1 unless you remove solder bridges SB16 and SB18 as described in UM1956 Table 6.10.

JR

Dear JR,

I implemented as you proposed. It works now. Thank you very much.

Kind regards

Koos

posted by Koos van der Wat 03 Aug 2018