I have enabled SPI4 in my `mpconfigboard.h`file:
Code: Select all
#define MICROPY_HW_SPI4_NSS (pin_E4)
#define MICROPY_HW_SPI4_SCK (pin_E2)
#define MICROPY_HW_SPI4_MISO (pin_E5)
#define MICROPY_HW_SPI4_MOSI (pin_E6)
Code: Select all
D34,PE5
D35,PE6
D36,PE4
D37,PE2
SPI4_NSS,PE4
SPI4_SCK,PE2
SPI4_MISO,PE5
SPI4_MOSI,PE6
Code: Select all
from pyb import SPI
s = SPI(4)
s.init(SPI.MASTER, 1000000)
s.send(b'hello')
It turns out that I was looking at the wrong place in the logic analyser - once I had the triggereing setup properly SPI4 comes up clear as day. Woops!
Any clues on where to look? Hopefully it's my python and not the firmware...
Edit: Found my problem; keeping this on the forum for others' benefit.