6 years ago.

how would i change it to target spi2?

  1. define STM32_D11_SPI_ETHERNET_PIN PA_7 set by target:NUCLEO_F429ZI

1 Answer

6 years ago.

I'm not sure where that #define is coming from. To change SPI ports generally just give the SPI constructor the right PinName parameters.

SPI spi(p5, p6, p7, p8); // mosi, miso, sclk, ssel

The PinNames are defined here:

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PinNames.h

You should check the PeripheralPins.c file as well. This is where the lower mbed levels map the PinName's you give to actual peripheral settings. They usually note if there are any conflicts on the Devboard to pay attention to.

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PeripheralPins.c