Target: NUCLEO_F767ZI
Toolchain: GCC_ARM
Tools: mbed-cli 1.8.3
mbed-os: 73f096399b
I'm bringing up a new board and a simple testcase seems to find an issue with the SPI master. I'm not seeing the SSEL line be asserted/deasserted. I've found other STM32F HAL bugs around SPI but this seems like something basic that would have been caught. Am I doing something wrong?
Shareef.
include "mbed.h"
DigitalOut led(LED1);
Ticker tick;
SPI spi(PA_7, PA_6, PA_5, PA_4); // MOSI, MISO, SCK, SSEL
Serial uart(USBTX, USBRX);void toggle(void) {
led = !led;
}int main() {
led = 0;
tick.attach(&toggle, 2.0);spi.format(8,3);
spi.frequency(1000000);//spi.select();
while(1) {
//spin
spi.select();
spi.write(0xAA);
spi.deselect();
}
}
[ ] Question
[ ] Enhancement
[X] Bug
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-1229
@sjalloq is SSEL continuously high or low ?
Also may you add a wait in the spin loop to make sure you're not missing the assert/deassert ?
@sjalloq if you have logic analyzer , also useful to paste screenshot with signals - what is happening on the bus.
I've just captured two views on my scope that show MOSI on the first shot toggling and then SSEL stuck low. According to your pin list on the F767 page, SSEL is on pin PA_4 which is one up from the bottom left of CN7.
The code is slightly different now and I'm using the spi.transfer() function to send a buffer.
Cheers, Shareef.


Hi,
I have submitted a new PR to fix this issue : #10708.
A setting was missing in our implementation.
Then, as I mentioned in the PR, be careful, this feature is not compatible with all SPI modes. It will work only in modes 0 and 2. See "NSS pulse mode" chapter in our reference manual. (link for L4 as example)
What I have now :

@sjalloq it means you have to change your code to
spi.format(8,0);
or
spi.format(8,2);
Thanks. I'll give it a go when I get a chance.
PR submitted.
@linlingao
Why did you close the issue?
Issue is used to be closed when the patch is merged, which is not the case for #10708
@0xc0170