STM32F4 Discovery + Embest BB Demo

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
jafrey
Posts: 33
Joined: Tue Nov 05, 2013 12:15 am

STM32F4 Discovery + Embest BB Demo

Post by jafrey »

I finally got a chance to work on this last night. I took the EMBEST_DMSTF4BB that Tectu provided and the ARMCM4-STM32F407-LWIP-FATFS-USB demo already provided.

I added a few other FatFS commands. Note the Embest board does not have a 'card inserted' switch so the card must be inserted when the board is powered up (or reset).

https://github.com/jedediahfrey/ARMCM4- ... F4BB-FATFS

** TARGET **

The demo runs on a STM32F4-Discovery board + Embest DM-STF4BB
www.embest-tech.com/product/extension-m ... board.html

** The Demo **

The MicroSD port on the Embest board is used for FATfs actions though SDIO
If a card is inserted the lights chase counter-clockwise
If a card is not inserted the lights chase clockwise

The Embest BB board does not have the ability to detect when a card is
inserted so the SD card must be present when the board is reset.

The USB-FS port is used as USB-CDC and a command shell is ready to accepts
commands there.
tree
Display file tree
free
Display amount of free space in B, KB and MB
hello
Creates hello.txt with 'Hello World' on the base level of the MicroSD Card.
mkdir [dir]
Makes directory dir on the base level of the MicroSD Card.
cat [file]
Echos a file from the MicroSD card to the console
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32F4 Discovery + Embest BB Demo

Post by Tectu »

Thank you very much for your contribution. This will surely be helpful for other people in future.
Are you going to play with the LCD as well?


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F4 Discovery + Embest BB Demo

Post by Giovanni »

Hi,

You could verify if the card detection mode used for the Olimex E407 can be used on this board too, it relies on an internal resistor on D3 if I remember well.

Giovanni
jafrey
Posts: 33
Joined: Tue Nov 05, 2013 12:15 am

Re: STM32F4 Discovery + Embest BB Demo

Post by jafrey »

Giovanni wrote:Hi,

You could verify if the card detection mode used for the Olimex E407 can be used on this board too, it relies on an internal resistor on D3 if I remember well.

Giovanni


http://www.cs.hs-rm.de/~kaiser/1313_can ... Manual.pdf

I think someone said that it isn't hooked up on this board. The pinout for CON6 (MicroSD) shows that it does have a card detect but I can't find a pinout for what is wired to what (if it is)
jafrey
Posts: 33
Joined: Tue Nov 05, 2013 12:15 am

Re: STM32F4 Discovery + Embest BB Demo

Post by jafrey »

I made a big update.

This requires FatFS 0.9b which has added get/set label.

The MicroSD port on the Embest board is used for FATfs actions though SDIO.

The Embest BB board does not have the ability to detect when a card is inserted
so the mount and unmount commands need to be called before doing anything.

mount
Mount the SD card, must be called before anything else.
The blue LED will illuminate when a SD card is mounted.
unmount
Unmount the SD card
mkfs [partition]
Format the [partition], starts at 0
getlabel
Get the label of the default partition.
setlabel [label]
Set the label of the default partition.
tree
Print the file structure
free
Print free space on the drive.
mkdir [dir]
Make a directory [dir] on the drive.
hello
Create hello.txt and put "Hello World" in it.
cat [file]
Echo [file] to the terminal.

A shell is attached to both:
USART1: PA9(TX) & PA10(RX)
USART2: PD5(TX) & PD6(RX)

It can now format SD-cards, create directories and the 'tree' command has been expanded to show both modified date and time and empty directories.

Code: Select all

ch> tree
1980-01-01 00:00:00 <DIR> /test/
1980-01-01 00:00:00       /hello.txt
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32F4 Discovery + Embest BB Demo

Post by Tectu »

Thanks for sharing!


~ Tectu
Kot_dnz
Posts: 10
Joined: Tue Jan 28, 2014 9:21 am

Re: STM32F4 Discovery + Embest BB Demo

Post by Kot_dnz »

jafrey wrote:I made a big update.
This requires FatFS 0.9b which has added get/set label.

Are you update require updated files in ChibiOS_2.6.1\os\various\fatfs_bindings ?
Can you share?
Last actual Chan version FatFs is R0.10a, but in os we have 0.8

P.S. SDC & MMC interface look like the same.
Now i write MMC-SPI, but result is unstable :(

How is critical sequence (Connect before Mount)
sdcStart -> f_mount -> sdcConnect?
sdcInit - no need at all?
May be this is reason while mount in my code working success start from second trial.
jarekl
Posts: 17
Joined: Tue Oct 15, 2013 11:32 am

Re: STM32F4 Discovery + Embest BB Demo

Post by jarekl »

I'm trying to compile ff9b.zip with ChibiOS 2.7 (I belive. Cloned it a few days ago). I get this compile error

Code: Select all

Compiling ccsbcs.c
../hsens/ChibiOS-RT/ext/fatfs/src/option/ccsbcs.c:497:2: error: #error This file is not needed in current configuration. Remove from the project.
.


but I don't understand which file to remove.

There are other errors that follow (in ff_convert) but maybe it is just a consequence of this.

I managed to compile fatfs-0.9-patched.zip that is distributed with ChibiOS but it gives me drive not ready so I'm trying to compile the demo from https://github.com/jedediahfrey/ARMCM4- ... F4BB-FATFS
against 9b to see whether to buy new SD-card or look for errors in my use of the fatfs-code.
AdShea
Posts: 6
Joined: Mon Nov 30, 2015 9:03 pm
Has thanked: 1 time
Been thanked: 2 times

Re: STM32F4 Discovery + Embest BB Demo

Post by AdShea »

In the board I've got SD detect is wired through PB15. Pulled high through 47k when empty, pulled low through 22 ohms when card is present.
Post Reply