Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 6 months ago.
Nucleo STM32-F401RE as SPISlave
Hi.
I'm using Nucleo STM32-F401RE board with mbed SDK. I tried to connect this board with LPC1768 based board via SPI protocol without success. When I try to configure Nucleo board as SPI slave (with SPISlave mbed class), i constantly get error "Pinmap not found for peripheral" on serial output.
All of the following codes compiles successfully but after start i get already mentioned "Pinmap not found for peripheral" error.
First tryout
#include "mbed.h" SPISlave device(SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS); int main() { while(1) { wait_us(50); } }
Second tryout
#include "mbed.h" SPISlave device(PB_5, PB_4, PB_3, PB_6); int main() { while(1) { wait_us(50); } }
Third tryout
#include "mbed.h" SPISlave device(PA_7, PA_6, PA_5, PB_6); int main() { while(1) { wait_us(50); } }
I will appreciate any kind of help, hint...
Thanks in advance.
1 Answer
9 years, 6 months ago.
Check the platform page for the F401 here. The SPI slave requires an SPI port that has an NSS pin. So the only options are SPI1 or SPI2. In case of SPI1 you must select NSS1 (PA_15).
#include "mbed.h" SPISlave device(PA_7, PA_6, PA_5, PA_15); int main() { while(1) { wait_us(50); } }