Apollo3-Explorable SPI pins swap

Hi,

I wondering if is possible to swap the SPI pins (SDI/MISO, SDO/MOSI) of the Thing Plus Eplorable with Apollo3, in the Arduino code.

By default they are routed like this:

SDI/MISO = 25

SDO/MOSI = 28

With the Apollo3 example Example06_SPI is possible to change the pin definitions. Adapted in my code, it compiles and download, but then get error.

here a snip of the code

#include "SPI.h"
#define SPI_MODE SPI_MODE3
//MbedSPI mySPI(mySDI, mySDO, myCLK);
MbedSPI spiPort(28, 25, 27);
..
  spiPort.begin();
  // Do a fake transaction to initialize the SPI pins
 
  spiPort.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE3));
  spiPort.transfer(0);
  spiPort.endTransaction();
..

but then I get this error

++ MbedOS Error Info ++

Error Status: 0x80FF0144 Code: 324 Module: 255

Error Message: Assertion failed: (int)iom != IOM_NUM

Location: 0x33339

File: mbed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/spi_api.c+86

Error Value: 0x0

Current Thread: main Id: 0x10005550 Entry: 0x34349 StackSize: 0x1000 StackMem: 0x100071C0 SP: 0x10007F34

For more info, visit: https://mbed.com/s/error?error=0x80FF01 … expLoRaBLE

– MbedOS Error Info –

any idea where the propblem is?

Tnx

The specific error code 0x80FF0144 corresponds to an assertion failure in the SPI API of the Mbed OS, indicating that the SPI module configuration is invalid.

the Apollo3 processor does not support MISO on GPIO 28, nor MOSi on GPIO 25. The Apollo3 processor has 6 I2C/SPI modules the GPIO for SPI can only be assigned as

  MISO MOSI SCK
M0 6   7   5
M1 9  10   8
M2 25 28  27
M3 43 38  42 
M4 40 44  39 
M5 49 47  48

In the case the Explorable either some of these pins are already in use OR not connected.