"pinmap not found for peripheral" trying to use SD over SPI on a L432KC Nucleo board

Hi I’m trying to port a project from an L053R8 to a L432KC board, which makes use of an SD card over SPI. While trying to select the proper pins on L432KC I decided for the SP1 on PA_6, PA_5, PA_4, PB_5, for mosi, miso, sclk, cs respectively, after opening the SB16 and SB18 bridges. Apparently, either I disable the built-in LED (which overlaps with SPI3 CLK), or I open those bridges to use SPI1. Am I right?
Compilation is fine, both on MBed2 (the original project version) and on Mbed 5.
But, in both cases at run time, right during system init, I get this message “pinmap not found for peripheral”. Below the serial out from the MBed5 build:

++ MbedOS Error Info ++
Error Status: 0x80010130 Code: 304 Module: 1
Error Message: pinmap not found for peripheral
Location: 0x8009203
Error Value: 0x6

This is the SD definition I use with MBed 2:

SDFileSystem sd(PA_6, PA_5, PA_4, PB_5, "sd"); // mosi, miso, sclk, cs

this is the one on MBed 5.19.2:

SDBlockDevice sd(PA_6, PA_5, PA_4, PB_5); // mosi, miso, sclk, cs

What’s wrong, with it?

Note, hardware wise it should be ok, as the ‘mbes-os-example-blinky’ starts just fine.

These are some old posts I’ve reviewed already (no help, unfortunately):

https://os.mbed.com/questions/79508/Conflict-between-serial-port-and-spi-on-/
https://os.mbed.com/questions/83057/SPI-master-and-slave-at-the-same-time-NU/
https://os.mbed.com/questions/84498/Getting-error-Pinmap-not-found-for-SPI-u/

Thanks

Hello,

In general, this error(exception) prevents usage of pins what are not connected to a specific peripheral or not have that functionality. For example when you want use SPI and using different pins from different SPI modules (SPI1, SPI2 and so on) or when you are trying to use a PWM / ADC on a pin where this is not possible.

Also you place wrong pins anyway.

Nucleo-L432KC SPI1:

  • Mosi - PA_7
  • Miso - PA_6
  • Sclk - PA_5
  • CS - PB_0

BR, Jan

Indeed, my trivial mistake, which I also realized after I post this question. Thanks!