Need Arm Mbed C++ SPI examples please for the NUCLEO -F429ZI

Hello JohnnyK,
Quickly I need q, some Arm Mbed C++ SPI (Serial Peripheral Interface) examples and a step by step tutorial
for the Nucleo-F429ZI board please?

Any web pages URL with the above information please?

Thanks and best regards,


there is nothing specific for F429ZI I think, so you can use any SPI code probably. That’s the advantage of Mbed.

  • for basic info about SPi in general - Serial Peripheral Interface - Wikipedia
  • Mbed SPI - API documentation with simple example
  • be careful when choosing pins. Pins (MISO, MOSI and SCK) must be from same SPI controller (NUCLEO-F429ZI | Mbed has 6 SPI controllers). CS pin have to be also from same SPI controller, if you want SPI to control it itself. Otherwise you can use any GPIO pin for DigitalOut and control slave’s CS by your self.

BR, Jan

Thank you very much for the information,

May I please have more SPI C++ examples for:
Blocking and non-blocking mode
Multiple Independent slaves
Multiple Daisy chained slaves
Expander configuration
as described in the Wikipedia link you have given.

Is there a URL link that explains SPI in blocking versus non-blocking?

Thanks and best regards,

  • Blocking functions are functions where you must wait for something. For example a blocking Read function in a loop will wait until some data will come. Until that the rest of loop is not executed.
    Nonblocking functions are functions where you will received current state immediately. For example a non-blocking Read function in a loop will return “No data” and rest of in a loop will be executed.
    So with SPI it will be same/similar.
  • For non-blocking/asynchronous SPI communication Mbed SPI has a special method - transfer, but I never tried that so I have no experiences with that.
  • For multiple slaves it is the same as in the basic example, you just add another CS pins for another slaves. One slave = one CS, so 10 slaves = 10 CS pins, the rest remain same.
  • I never used Daisy chained slaves (it is like shift register), but for example I remember it was used in library for this shield - X_NUCLEO_IHM02A1 - Library to handle the X_NUCLEO_IHM02A1 Motor Cont… | Mbed

BR, Jan