Page 1 of 2

STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Apr 10, 2017 10:51 am
by stefan.erni
Hi Ben

Now I have a STM32F469i discovery board. This board has a SD card connector for 4bit mode.
I hope this this faster than the spi mode.
Would it be possible to integrate this mode into flowcode7?


STM32F469I_disco_SD_card_hardware.PNG
(48.93 KiB) Downloaded 12068 times
STM32F469I_disco_SD_card_software.PNG
(26.85 KiB) Downloaded 12068 times

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Apr 10, 2017 12:44 pm
by Benj
Hello,

Currently we support the SD cards on the disco boards but only using the SPI interface.

We can certainly explore the API mode as it should be faster but probably a lot more resource intensive. There are likely to be existing libraries we can tap into so maybe not too big a job.

I'll add it to the list to investigate.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Apr 10, 2017 1:13 pm
by stefan.erni
Hi Ben
Thank You for the info.I'll change my own hardware on a 4bit SD card connection. So I can use first the SPi and maybe later the "API" mode. I think later I have just to change the software. And I believe with flowcode 7 it will be easy as always.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Wed Apr 19, 2017 12:47 pm
by stefan.erni
Hi Ben

I tried to connect the sd-card to a "software" Fat

But I can not control the chipselect on C11 from the menu of FC7.

Is it possible to use
C8-C12 and D2 by software?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Wed Apr 19, 2017 3:50 pm
by LeighM
In Component->Properties->Connections click on "$PORTD.2" and you can change it

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Sat May 13, 2017 10:37 am
by trey3499
Hi.
There is a working example?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Wed Jun 21, 2017 2:35 pm
by stefan.erni
Hi Ben

How is it now 2 months later?
It would be nice to use the SD card on the STM32F469 in 4Bit mode. Also a longer filename than 8digit would be nice.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Thu Jun 22, 2017 2:59 pm
by Benj
Hello Stefan,

Have you managed to get the FAT component working at all in it's current state?
It would be nice to use the SD card on the STM32F469 in 4Bit mode. Also a longer filename than 8digit would be nice.
Yes I agree these would be nice to have, unfortunately I am rather busy at the moment, they are on the list but currently low priority.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Thu Jun 22, 2017 3:43 pm
by stefan.erni
Hi Ben

Yes the Fat is comfortable to use and I'm working with it on PIC-Board and the STM32F469 Disco Demoboard.
I use a RTCC to generate the filename. The file was generatet 2017_06_21 at 14:29 and 29 sec.
But the filename looks poore like 21142929.wav
It's bether if the filename is longer like 2017_06_21_14_29_29.wav (19 digit)
And the speed is fast enough for the 2channel Project. But now I'm working on 8Channel version.
So I just hope the 4Bit mode is 4time faster..... :)
At the moment I can work with it and hope to upgrade the FAT soon.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Fri Jun 23, 2017 4:37 pm
by stefan.erni
Hi Ben

I saw in Flowcode7 Fat Propertis "set time and date"

Can I set the creating time from the File with this propertis?

At the moment I dont support it and if I put the Card after recording, in the computer fill in the the time from the computer.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Jun 26, 2017 12:37 pm
by Benj
Hello Stefan,

Yes this function should allow you to change the timestamp when creating a file, maybe also for modifying a file, without calling the function then we default to the compilation time and date.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 2:26 pm
by stefan.erni
Hi Ben

Thank you for the help. It's looks much bether with the create_time and the shortname with 8.3 digit
Do you know if I can use the Authors propertie in a way?

And on the end of a recording, I have to write in the first sector some infos. But flowcode is not showing me which is the first sector.....
FAT_time.PNG
(7.84 KiB) Downloaded 10955 times

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 2:59 pm
by Benj
Hello,

The author might be stored as part of the extended filename, though I can't find specific reference to where and how this would be done. I do know that at the moment we don't support it. :D

Some info on FAT, file entries and extended file names.
https://en.wikipedia.org/wiki/Design_of ... file_names

As for writing some info in the first sector, this could be problematic, the first sector is usually the boot sector and contains some critical information about the disk. Writing to this sector could potentially make the disk corrupt or unstable. What about instead saving the data into a second file?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 3:07 pm
by stefan.erni
Hi Ben

I mean not the first sector of FAT, I mean the first sector from the file.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 3:20 pm
by Benj
I mean not the first sector of FAT, I mean the first sector from the file.
Aha Ok that should be possible.

When you are done writing to the file open the file again and this will load the local 512 byte buffer with the first sector of the file.

ReadByteFromBuffer will allow you to read a byte from the local buffer.

WriteByteToBuffer will allow you to override a byte in the local buffer.

WriteFileSector will write the local buffer back to the card overwriting the first sector of the file.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 3:52 pm
by Benj
I've created a file with Author properties and looked at the record in Winhex to see the format.

Unfortunately it doesn't look particularly simple and may only work correctly with Windows operating systems so for now until I can find a better explanation of how it's done we will not be adding this functionality to the component.

Extended file names would be nice and it may be along similar lines?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Jun 27, 2017 4:20 pm
by stefan.erni
Hi Ben

I tried this "file open again" and write to the first sector again.
it's working and it's a big help
So I can write some infos there.Thank you Ben

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Sep 19, 2017 1:25 pm
by stefan.erni
Hi Ben

I already know the FAT by Flowcode is reliable and easy to use.
But I'm not satisfied with the speed. Is there something new to the 4 bit mode?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Sep 19, 2017 6:05 pm
by Benj
Currently working on (amongst other things) a new SD card E-block which has both the SPI and API modes available.

Once I have this it should be simple enough to add a API mode to the component (hopefully). Most if not all of the examples I have seen are for SPI mode so I'm hoping the ST ARM library will help here. Edit - I've had a look through this and it looks fairly horrific.

The API mode should be approx a factor of 4x faster but this is just a guess based on the number of parallel data pins.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Thu Sep 21, 2017 9:35 am
by stefan.erni
Hi Ben
I know it is not easy. But my application sampled data and created wavefile. I can sample instead 4khz with 16khz with the same processorspeed. Also, I can not increase the SPI clock arbitrarily so these 4bit are already a big help.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Tue Oct 03, 2017 4:27 pm
by stefan.erni
Hi Ben

How is the SD card E-block which has both the SPI and API modes available?

I like to create my own hardware with a Pic. Can I have some info from the new Eblock? Can I use the same controler?

It is also not clear to me whether I can use any pin for the API mode or the PIC must have a specific port.

And whether this SD/SDIO/eMMc is something useful.

http://www.microchip.com/wwwproducts/en ... 1025DAA176
50 MHz SD/SDIO/eMMC bus interface

maybe you know more ....

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Thu Oct 05, 2017 5:33 pm
by Benj
Hello,

The EB board is coming on but will take a while to hit the shelves. Should be an easy board for you to replicate yourself, basically just a means of connecting the pins of the SD card to the micro.

Image
It is also not clear to me whether I can use any pin for the API mode or the PIC must have a specific port.
Any pin should be fine.
And whether this SD/SDIO/eMMc is something useful.
It looks like the device you pointed to has a built in bus to talk to the SD card. This will likely be a bit faster then bit banging out the signals but we will not likely support this in Flowcode as it's very chip specific and against the development policies where it should simply just work on pretty much any device. You should be able to use say the Microchip Harmony libraries as is in Flowcode which should allow you to access the functionality.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Fri Oct 06, 2017 2:27 pm
by stefan.erni
Hi Ben

This is a good news and thank you for the infos.
I'm already drawing the hardware.
What has the new EB board for a number?
And is there a component for FC7 for the new EB board already?

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Oct 09, 2017 12:47 pm
by Benj
Hi Stefan,
What has the new EB board for a number?
I'm not at liberty to say much on this at the moment, all will be revealed shortly.
And is there a component for FC7 for the new EB board already?
No currently only the FAT component is available which uses the SPI communications mode. We will likely add the API mode to the FAT component in the future but this is currently fairly low priority.

Re: STM32F469i Disco SD Card FAT 4Bit mode

Posted: Mon Oct 09, 2017 1:13 pm
by Benj
Leigh has just informed me that the 4-bit API mode requires a license fee paid to the SD association.

So it look even less likely that we will be doing anything to support this.

Some info on this here but not enough to know the full score.
https://electronics.stackexchange.com/q ... de-license