cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4DIS-BB FatFs

dbte
Associate II
Posted on July 14, 2017 at 20:24

The original post was too long to process during our migration. Please click on the attachment to read the original post.
21 REPLIES 21
Posted on July 14, 2017 at 20:48

TLDR; Not going to dig through broken code. Published multiple working examples using the STM32F4BB-DIS. Currently have it working with >=256GB cards.

Key to throughput will be large, aligned blocks, as big as possible, 32KB would be good

Here's a build from 2013, I could probably dig up other posts and newer code

https://community.st.com/0D50X00009XkgXqSAJ

 
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on July 14, 2017 at 20:59

This thread is likely to have F407 specific code, FATFS and MSC example, scroll up/down a bit

https://community.st.com/0D50X00009XkiCESAZ

Reading/writing random blocks is likely to ****** up the file system, code specific to FatFs sector read/write resides in diskio.c layer

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dbte
Associate II
Posted on July 14, 2017 at 21:27

Thank-you ! Much appreciated.

Posted on July 14, 2017 at 21:45

Need to do a 2017 refresh, with the exFAT version of FsFat and the smart clocking code that recognizes the F401C, F407G, F411E, etc variety of DISCO boards that plug into the STM32F4DIS-BB

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on July 20, 2017 at 22:02

2017 Refresh

https://drive.google.com/open?id=0B7OY5pub_GfINVZnNXFvTGxaWmM

 
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dbte
Associate II
Posted on July 21, 2017 at 20:19

Clive thanks for the updates for 2017. I was just reading the readme.txt file and I am questioning the feasibility in adapting the code that you provided into a Linux environment as it appears to be Window based. In the past I have imported a number of ST demo programs written for an IAR environment and they worked flawlessly. Am I setting myself up for an act in futility by transposing this code into a Linux environment? I am using a later version of GCC (i.e. 5.4.0) and the summon arm tool chain. I am not sure if you can answer that for me? It would seem to me that I ought to be able to get this program to work in Linux environment as I got the uSD Card program to work, but then again I could be completely wrong. Also might you be able to answer for me as to what file format might I best use for saving video. As I understand it I will need to access the DMA into blocks and save them onto the uSD Card yet I am at a loss on what file format to save them in. I am a novice at best so any insight would be helpful. Thanks in advance for you assistance.

Posted on July 21, 2017 at 21:55

It is basically using GNU tools under Window to make the files. Would imagine if you suitably path the tools it would just make under Linux, nothing inherently Windows in there, just my development platform of choice. Make sure to use the ARM cross compiler.

Review in the context of whether it is just an MPEG2 or similar type stream of data, you'd want to block it to the media in 32KB (or smaller power of 2) blocks so as not to cause a bottle-neck.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dbte
Associate II
Posted on August 22, 2017 at 21:13

Clive thanks in advance for your help. I am attempting to make use of the fsfatdemo_stm32f4dis_bb_2017_rev1 file that you supplied. It would appear that I am down to one error and that I need an update on the stm32f4xx_cryp.h or the stm32f4xx_cryp.c file as I am getting the following error and I am not sure what I need to do to correct it. Lots to learn at this end. I have no update on the stm32f4xx_cryp.c file (mine is 2012). I have enclosed a portion of the source code from 519. (see below).

STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c: In function 'CRYP_SaveContext':

STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c:519:21: error: 'CRYP_Context' has no member named 'CR_bits9to2'

CRYP_ContextSave->CR_bits9to2 = CRYP->CR & (CRYP_CR_KEYSIZE |

^

STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c: In function 'CRYP_RestoreContext':

STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c:564:33: error: 'CRYP_Context' has no member named 'CR_bits9to2'

CRYP->CR = CRYP_ContextRestore->CR_bits9to2;

^

Makefile:57: recipe for target 'stm32f4xx_cryp.o' failed

make[1]: *** [stm32f4xx_cryp.o] Error 1

*** here is a portion of the source at 519 ***

/* Save the current configuration (bits [9:2] in the CRYP_CR register) */

CRYP_ContextSave->CR_bits9to2 = CRYP->CR & (CRYP_CR_KEYSIZE |

CRYP_CR_DATATYPE |

CRYP_CR_ALGOMODE |

CRYP_CR_ALGODIR);

/* and, if not in ECB mode, the initialization vectors. */

CRYP_ContextSave->CRYP_IV0LR = CRYP->IV0LR;

CRYP_ContextSave->CRYP_IV0RR = CRYP->IV0RR;

CRYP_ContextSave->CRYP_IV1LR = CRYP->IV1LR;

CRYP_ContextSave->CRYP_IV1RR = CRYP->IV1RR;

/* save The key value */

Posted on August 22, 2017 at 21:35

I used the DSP/SPL 1.8.0 release from 2016

http://www.st.com/en/embedded-software/stsw-stm32065.html

 

You should insure you are using a coherent set of source files, and that your include paths don't favour pulling in older/different versions of the library files.

The STM32F407 does not include the CRYPT peripheral.

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