ChibiOS / ChibiOS-Contrib

Community contributed code (ports, drivers, etc).
130 stars 226 forks source link

FMC SDRAM driver compatibility for STM32F7 #135

Closed elagil closed 6 years ago

elagil commented 6 years ago

Hello,

I am using the HAL FSMC driver for SDRAM on STM32F746 without any issues. I assume that STM32F4 and STM32F7 share the same FMC hardware. For making it compile, I had to add some switches to the source files.

Normally, there is this statement here to allow compilation only for certain processors:

#if (defined(STM32F427xx) || defined(STM32F437xx) || \
     defined(STM32F429xx) || defined(STM32F439xx))

Please change that to something like this or similar:

#if (defined(STM32F427xx) || defined(STM32F437xx) || \
     defined(STM32F429xx) || defined(STM32F439xx) || \
     defined(STM32F746xx))

for use with STM32F7 family processors. I am not sure which processors of the F7 family can be used, as I can test only the STM32F746.

This affects the following files: /os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h /os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c /os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h /os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c

Thank you, Adrian

barthess commented 6 years ago

Please send pull request. I'll merge it.