STMicroelectronics / STM32CubeL0

STM32Cube MCU Full Package for the STM32L0 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
103 stars 57 forks source link

fix adafruit 1.8 tft shield sd card driver #13

Closed firmwareguru closed 1 year ago

firmwareguru commented 3 years ago

Fixes the Adafruit 1.8" TFT Shield's (V1 or V2) SD card driver used in all STM32CubeL0 demos.

The BSP_SD_ReadBlocks and BSP_SD_WriteBlocks API had fallen out of sync in the current demonstration projects rendering the SD card inaccessible for the display images.

This has been fixed, along with a necessary change to how they are called from sd_diskio.c. Sector numbers are passed into the BSP drivers, allowing for use with cards having capacity less than 2 GB as well as greater than 4 GB.

This fix is required to support the Adafruit 1.8" TFT Shield V2 featuring the seesaw I2C expander that I have implemented in my branch https://github.com/firmwaremodules/STM32CubeL0/tree/adafruit-lcd-seesaw and documented in https://github.com/firmwaremodules/STM32CubeL0/issues/1.

RKOUSTM commented 3 years ago

Hi @firmwareguru,

Thank you for this suggestion. This has been forwarded to our quality team. We will come back to you as soon as we get their feedback.

With regards,

RKOUSTM commented 3 years ago

Hi @firmwareguru,

First thank you for your contribution.

Your request concerns stm32_adafruit_sd.c file has been submitted to our technical team who said it is more appropriate to update the BSP_SD_ReadBlocks() function as follows for use with cards having capacity greater than 4 GB. This fix will not break the compatibility with almost all BSP driver from the quality point of view.

- uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
+ uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t BlockSize )

Instead, a bug tracker will be opened internally and the suggested fix for the sd_diskio.c file will be implemented and made available in future release.

Thank you once again for your contribution.

With regards,

RKOUSTM commented 3 years ago

ST Internal Reference: 99718

RJMSTM commented 1 year ago

Hi @firmwareguru

I hope you are fine.

The issue you reported has been fixed in the frame of version v1.12.2 of the STM32CubeL0 published recently on GitHub.

Thank you again for having reported.

With regards, Rania