Problem with SPI1 read on STM32F4
Posted: Sun Apr 13, 2014 8:51 pm
I am using ChibiOS 2.6.3 on an STM32F4-Discovery board.
When I use SPI1 wired to the following pins, it works correctly for read and write;
PA4 - SPI1_NSS (CS)
PA5 - SPI1_SCK
PA6 - SPI1_MISO
PA7 - SPI1_MOSI
The SPI1 functionality is allow available on these pins according to the AF table:
PA15 - SPI1_NSS (CS)
PB3 - SPI1_SCK
PB4 - SPI1_MISO
PB5 - SPI1_MOSI
When using those pins and adjusting the SPI1 configuration and wiring appropriately it doesn't appear to work.
When I investigate with a logic analyzer I saw that the SPI write was working correctly and the attached device was responding correctly but the SPI read was not returning the correct value.
I tested this using a simple bare metal program that worked fine under the same conditions. That program does its reading and writing via the SPI->DR directly.
Is this a known issue or limitation of the OS?
Not sure where to look next.
If necessary I can work out a simple demonstration program to upload.
Thanks in advance.
Dale.
When I use SPI1 wired to the following pins, it works correctly for read and write;
PA4 - SPI1_NSS (CS)
PA5 - SPI1_SCK
PA6 - SPI1_MISO
PA7 - SPI1_MOSI
The SPI1 functionality is allow available on these pins according to the AF table:
PA15 - SPI1_NSS (CS)
PB3 - SPI1_SCK
PB4 - SPI1_MISO
PB5 - SPI1_MOSI
When using those pins and adjusting the SPI1 configuration and wiring appropriately it doesn't appear to work.
When I investigate with a logic analyzer I saw that the SPI write was working correctly and the attached device was responding correctly but the SPI read was not returning the correct value.
I tested this using a simple bare metal program that worked fine under the same conditions. That program does its reading and writing via the SPI->DR directly.
Is this a known issue or limitation of the OS?
Not sure where to look next.
If necessary I can work out a simple demonstration program to upload.
Thanks in advance.
Dale.