cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set starting address for FATFS in sdram?

EKari.1
Associate II

Hi

I made a custom board with "stm32f746". This board has a 32MB sdram (MT48LC16M16) and a "800×480" lcd. I use from STM32CubeIDE and touchgfx. I want to allocate 2MB of sdram (from 0xC0000000 to 0xC0232800) to frame buffer of lcd and I need to use remnant of sdram space (from 0xC0232801 to end) with file system manner. I should say I have multi drive (SD card , USB flash and sdram) that use FATFS. How can I set starting address for FATFS for sdram? Does every one has sample code for this?

Thanks.​

1 REPLY 1

Usually it would be a define that you use within your DISKIO implementation

Perhaps say 0xC1E00000, change your Linker Script to reflect you have 30MB so it doesn't get used/allocated, and can stay in a consistent spot.

Alternatively add all the memory to the HEAP and allocate the screen buffer, and SDRAMDISK buffer that way?

Pretty sure the CubeF4 or F7 will have SDRAMDISK examples under various Board/Applications/FatFs type directories. The F429I-DISCO for sure, likely some for F7 boards in the CubeF7 trees if you look.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..