Configuring RAK3172 with two SPI peripherals

I’m considering using the RAK3172, but need two SPI peripherals. If I’m programming the device using STM32CubeIDE, is there any reason I can’t or shouldn’t change which pins peripherals are connected to according to the RAK3172 datasheet?

According to the online documentation, it looks like SPI1 is configured on pins PA4-PA7.

Would it be possible to instead configure SPI1 on pins PA4 and PB3-PB5, which would then allow for configuring SPI2 on pins PA5, PA8, PA9, and PA10?

A high-level schematic showing how each pin of the STM32WL is broken out would make figuring these things out much easier.

Thank you.

1 Like

Can not you put both SPI peripherals on the same SPI bus and use the SPI function of CS (Chip Select) to enable one peripheral at a time? For example tie one peripheral directly to the RAK3172 CS pin (16) and tie the second peripheral to this pin thru an inverter?

Hi @grillmaster_tom ,

It you are using STM32WL SDK, it is possible to use other pins for SPI as long as it is allowed to be mapped on that pin. This is something to be checked on the datasheet. As far as I know, can be done as well via STM32CubeMX.

BUT, the pin must not used for other purpose like for the RF switch, TCXO (if supported), etc.

Another thing to consider is @jmeck that you can use CS pin to support multiple SPI devices without adding another SPI bus.

got it, thanks. I already checked that the SPI can be mapped to the other pins. I just wanted to confirm since I can’t see how each pin is physically broken out, but it sounds like I should be good. The two devices I’m interfacing use different speeds/configurations for the SPI, so I think I’m forced to interface them separately.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.