Hi all.
I've previously posted this as a question, so my hope is that by posting it here it gets treated as a bug report for the NUCLEO-STM32F103RB board and alike.
I am using the online compiler targeting the "NUCLEO-F103RB" board and importing the mbed-STM32F103C8T6 library.
Here's the test program I am using to test 16-bit SPI transfer on the STM32F103C8T6 board covered here:
include the mbed and mbed-STM32F103C8T6 libraries with this snippet
#include "stm32f103c8t6.h"
#include "mbed.h"
DigitalOut myled(LED1);
SPI mySPI(PB_15, NC, PB_13);
DigitalOut cs(PB_12);
void send_words ()
{
int i;
for (i = 0; i < 5; i++)
mySPI.write(0xffff);
}
int main() {
confSysClock(); /* Configure system clock (72MHz HSE clock, 48MHz USB clock) */
cs = 1;
mySPI.format(16, 3);
mySPI.frequency(1000000);
cs = 0;
while(1) {
send_words();
myled = !myled;
wait(1);
}
}
Here's a capture of the resulting signal:
Zooming in:
What is odd is that after each expected 16-bit transfer of the word 0xffff there's a second unexpected 16-bit transfer of the word 0x0000. So in total 10 words are transferred, instead of 5, every second.
For comparison, here's what happens if I use 8-bit SPI transfer:
The latter is the expected behaviour. Zoltan has confirmed that the bug occurs with the official NUCLEO-STM32F103RB board too when replying to this question.
Thank you.
Cheers,
Luigi
Hi all.
I've previously posted this as a question, so my hope is that by posting it here it gets treated as a bug report for the NUCLEO-STM32F103RB board and alike.
I am using the online compiler targeting the "NUCLEO-F103RB" board and importing the mbed-STM32F103C8T6 library.
Here's the test program I am using to test 16-bit SPI transfer on the STM32F103C8T6 board covered here:
include the mbed and mbed-STM32F103C8T6 libraries with this snippet
#include "stm32f103c8t6.h" #include "mbed.h" DigitalOut myled(LED1); SPI mySPI(PB_15, NC, PB_13); DigitalOut cs(PB_12); void send_words () { int i; for (i = 0; i < 5; i++) mySPI.write(0xffff); } int main() { confSysClock(); /* Configure system clock (72MHz HSE clock, 48MHz USB clock) */ cs = 1; mySPI.format(16, 3); mySPI.frequency(1000000); cs = 0; while(1) { send_words(); myled = !myled; wait(1); } }Here's a capture of the resulting signal:
Zooming in:
What is odd is that after each expected 16-bit transfer of the word 0xffff there's a second unexpected 16-bit transfer of the word 0x0000. So in total 10 words are transferred, instead of 5, every second.
For comparison, here's what happens if I use 8-bit SPI transfer:
The latter is the expected behaviour. Zoltan has confirmed that the bug occurs with the official NUCLEO-STM32F103RB board too when replying to this question.
Thank you.
Cheers,
Luigi