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 September 02, 2017 at 00:56

Post disappeared, this is the 2013 source

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

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 02, 2017 at 03:57

My bad. It turns out that I had the source - it is just that I was not aware of it initially - hence I deleted the post. Regardless I am glad that you got back to me as I can now double check it. Thank-you !

dbte
Associate II
Posted on September 07, 2017 at 21:20

Using the latest link (i.e.

/external-link.jspa?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D0B7OY5pub_GfIU0VFWWs2dmxKOFE

) I managed to get things to work all except for the 32 bit ASCII characters that are not properly displaying themselves at the terminal (i.e. gtkterm). All said when I flash the micro using the demo.bin file that you provided I get what is to be expected. (see A). Yet when I flash things using my makefile the terminal displays gibberish (see B) or what appears to be gibberish. As for the rest of the program it is doing what it was meant to do and does indeed write 2 separate files onto the micro sd card (2 G Bytes) - that of length.txt and dir.txt - with an appropriate count of 12 written into the file length.txt. Given that the terminal at my end is not displaying the ASCII characters correctly might you offer some suggestions on how to correct this? I have been speculating that perhaps it is a problem with start and stop bits or clock frequency settings yet to date I have not been able to correct this (not sure exactly where to look and what to change). Any suggestions??

A)

FatFs Testing Opening and outputting MESSAGE.TXT hello world!Total = 12 Writing Length to LENGTH.TXT Writing Directory to DIR.TXT ---- 12 /MESSAGE.TXT ---- 4 /LENGTH.TXT ---- 0 /DIR.TXT D--- 0 /TRASH-~1 Done

Yet when I flash things with

B)

����#�[�j#���#D# \#��������,��e�k�J���թ#`##�4�(���S�#P#������b�C�Ñ�#��

ܽ�

R�]�ջh#H#�h#c��######�(�-�,��bh#[�?�#######(�%�<��#�#�#��########�T�ÙQ$���#########$���#Ē���#�S�b#��� D# \#��������,��e�c�J���թ#h##�<�(���[� X#������j�K�Ù�#��Խ�Z�]�ջh#H#�h#k��######�(�-�$��jh#[�?�#######(�%�<��#�#�#��########�T�ÙQ$���#########$���#Ē�� �#�[�j#��� D# \#��������,��e�k�B���թ#`##�4�(���S�#P#������b�C�ˑ�#��

ܽ�

R�]�ջh#H#�h#c��######�(�-�$��jh#[�?�####### �%�<��#�#�#��########�T�ˑQ$���#########,���#Ē���#�[�j#���#D# \#��������,��e�k�J���թ#h##�<�(���[�

Posted on September 07, 2017 at 21:58

Make sure HSE_VALUE is 8000000

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 September 14, 2017 at 22:27

Clive that fixed it ! I really appreciate your help here and I wanted to thank you personally. Had you not assisted me it would have taken me forever and a day to get it to work. You definitely saved me a lot of time and it is clear to me that there was a lot of work involved and even though there is so much more for me to learn I now have something to work with. Thanks once again !

🙂

dbte
Associate II
Posted on October 13, 2017 at 22:08

I was looking to make another post related to this one, but in the interest of continuity I decided to post it here. For some time now I have been working with STM32F4DIS_BB Software Examples 20130307 from ST. To that end I got a number of the programs to work and I am now struggling to update the STM32F4xx_Camera_Example with the use of the FatFs updates that you provided (i.e. fsfatdemo_401_disco_rev1 ). The camera example has a number of provisions that make use of a FatFs structure from Embest that never worked – and as such I would like to implement what you have provided and make that happen. At best I have a working program that streams video to the display. As a preliminary first step I had thought it would be a simple matter of updating the camera example files with the updates that you provided and reinstate the camera program to stream the video followed by the implementation of the code that you provided for FatFs. Failing that do you have some updated code for the camera example using the Fatfs update? My initial findings are that upon updating the files to the camera example I am getting errors in the vicinity of stm32f4xx_i2c.c and stm32f4xx_spi.c. To get to the root of this matter I have created a spreadsheet comparing the camera example working files with the updated files with the hopes of isolating it. Might you offer some some additional insight on where to look and what to look at insofar as resolving this matter? I am finding that it is more complicated than I had initially anticipated.

Posted on October 14, 2017 at 01:28

Not using the camera or lcd attachments just the base board.

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 October 14, 2017 at 21:07

Clive thanks for getting back to me - after much consternation I pinpointed the source of my grief. Arrgh!

dbte
Associate II
Posted on March 24, 2018 at 00:19

This question is specifically meant for Clive1. With the understanding that you are not using the camera or lcd attachments and just the base board might you offer some suggestions on how you would approach the following? I finally got the STM32F4xx_Camera_Example from ST to work. Unfortunately it is limited to a 2GByte capacity and I would like to increase that capacity up to 64GBytes or more. Thankfully I managed to get your code to work with the base board, and I had hoped that I would be able to transpose it into the examples that ST provided.  Unfortunately this has proven to be extremely difficult. The code that you provided uses a newer library set which is different from the one that I have been using (i.e. older). I have been very frustrated by this and I figured that it would make more sense if I were to build my own and use yours as a reference in my quest to get there. To that end I figured that I need to understand the SD Standards

https://www.sdcard.org/developers/overview/

and go from there. Being that you built your own code and scaled it upwards might you offer some suggestions on how to get there? Shall I go from 2GByte and build to 4GBytes then to 8GBytes and 16 to 32 and 64? As I struggle to wrap my head around this what were the reference materials that you used? Are there any example tutorials that you might suggest that would be helpful? Thanks in advance for your assistance.
Posted on March 24, 2018 at 01:00

I think the code I provided was the ST code refactored so it handled blocks properly without a lot of stupid/unnecessary transforms. Earlier ST code was also limited to SD/MMC cards, mostly 2GB and below. They used to ship EVAL kits with 128MB cards, then later with 2GB cards.

Most of the cards 4GB and greater fall into the SDHC/SDXC category and have different read/write block commands. There are some 4GB card using the older SD/MMC category, these seem to target people using old navigation hardware (car info-tainment system) to hold large map files.

You want FAT32 for media >2GB, you want EXFAT for media >=32GB.

I seem to recall FAT32 having a 2GB FILE SIZE issue, at least in some target systems in prevalent use at the time, I used to span things across multiple files (datasets holding 4.7GB or 8.5GB), NTFS supported much larger files, things might have changed in the decade or so since I was deep into that, but things around 4GB are always going to give people used to 32-bit machines headaches, you really need to be 64-bit portable, you need a different mindset and refactor a lot of code.

The ceiling for the SDHC/XC cards is likely 2TB, I've used 128GB and 200GB cards on most current 0.12c and 0.13 FatFs.

A 400GB MicroSD card runs about $199

http://users.ece.utexas.edu/~valvano/EE345M/SD_Physical_Layer_Spec.pdf

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