carlk3 / no-OS-FatFS-SD-SDIO-SPI-RPi-Pico

A FAT filesystem with SDIO and SPI drivers for SD card on Raspberry Pi Pico
Apache License 2.0
76 stars 15 forks source link

Mutex is not initialized when locking spi0 #4

Closed diegoparrilla closed 9 months ago

diegoparrilla commented 9 months ago

I have found this error when migrating to this new repo from the old one.

023-09-27 18:24:03 --> assertion "mutex_is_initialized(&spi_p->mutex)" failed: file "MY_WORKSPACE/atarist-sidecart-raspberry-pico/fatfs-sdk/src/sd_driver/SPI/spi.c", line 181, function: spi_lock

I think I have updated the spi_ifs and sd_cards configuration objects correctly, and the initialization has not changed.

Reviewing the code, the mutex property of the spi_t is not initialized. Should my code do it, or should the init functions?

So, I don't know if the repository is ready or if I should return to the old one.

Any suggestions to fix the problem?

diegoparrilla commented 9 months ago

Nevermind, it was a configuration error. The sd_cards[*].spi_if_p value still contained the reference to the spi_t object instead of the sd_spi_if_t.

I will delete