SPI problem with Chibios 21.11
Posted: Wed Jan 12, 2022 5:27 pm
Hello,
I'm migrating some projects from old Chibios versions to Chibios 21.11.
And i'm facing a problem with SPI2 on a STM32F373. (on a custom board)
This SPI bus is used to connect an SD card.
It is working fine under Chibios 20.3 and below, but with Chibios 21.11, when i mount the card, i obtain an error from fatsfs: "FR_NOT_READY".
Connecting a logic analyzer, i see some activity on the SPI2 bus. Mainly on the outputs of the uC.
I think its the sd reset (128 clocks without the Chip Select) followed by the first command (0x40 00 00 00) then something i have to identify.
But the Sd card only put its line low longer after the command... (it doesn't understand the uC ?)
I see one visible difference: with version 21.11, the SPI Serial Clock is idle at high. (3.3V)
While with version 20.3, the Clock idle state is low.
Checking my SPIConfig: ok: it is not activating CPOL.
Using breakpoint i checked the CPOL bit on CR1 of SPI2, and it seems good at 0.
I also see that from this version, the driver for the STM32F373 moved from SPIv2 to SPIv2_v2.
And unfortunately i did not found an example using this new driver on the testhal folder.
Any ideas or common problems ?
Thanks in advance,
Stephane
I'm migrating some projects from old Chibios versions to Chibios 21.11.
And i'm facing a problem with SPI2 on a STM32F373. (on a custom board)
This SPI bus is used to connect an SD card.
It is working fine under Chibios 20.3 and below, but with Chibios 21.11, when i mount the card, i obtain an error from fatsfs: "FR_NOT_READY".
Connecting a logic analyzer, i see some activity on the SPI2 bus. Mainly on the outputs of the uC.
I think its the sd reset (128 clocks without the Chip Select) followed by the first command (0x40 00 00 00) then something i have to identify.
But the Sd card only put its line low longer after the command... (it doesn't understand the uC ?)
I see one visible difference: with version 21.11, the SPI Serial Clock is idle at high. (3.3V)
While with version 20.3, the Clock idle state is low.
Checking my SPIConfig: ok: it is not activating CPOL.
Using breakpoint i checked the CPOL bit on CR1 of SPI2, and it seems good at 0.
I also see that from this version, the driver for the STM32F373 moved from SPIv2 to SPIv2_v2.
And unfortunately i did not found an example using this new driver on the testhal folder.
Any ideas or common problems ?
Thanks in advance,
Stephane