How do I access the FRDM Multi-B SD Card?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I access the FRDM Multi-B SD Card?

656 Views
vivianchiang
Contributor I

Hello!

I'm a student who is relatively new to programming the FRDM Multi-B board. I would like to access the SD card on the Multi-B. I'm currently connecting it to the FRDM KL25Z.

I am trying to write data into the SD card through mbed's SD Card File System tutorial: SD Card File System - Cookbook | mbed

I'm having trouble writing data into the SD card because I'm a little unsure about where the pins of the SD card to look at. I've looked at the schematic and the board itself and came up with these pins:

MOSI - PTD2

MISO - PTD3

SCK - PTD1

CS - PTB2

I might have the pins completely wrong which may be why nothing is getting written, so I was wondering what were the pins for the SD card slot.

Also, I'm not sure if using mbed's tutorial is the best way to begin. I've tried using Kinetis Design Studio but I get confused through the components needed.

I am open to completely changing gears and trying something new!

Any help is really really appreciated!

0 Kudos
1 Reply

441 Views
mjbcswitzerland
Specialist V

Hi Vivian

Attached is a binary that you can load to your FRDM-KL25Z and it will allow you to work with the SD card on an attached FRDM-FXS-MULTI-B board.

It uses the connections as you have noted:

SPI0_CS   PTB-2 (J10-6)

SPI0_SCK  PTD-1 (J2-12)

SPI0_MOSI PTD-2 (J2-8)

SPI0_MISO PTD-3 (J2-10)

When you connect the Kinetis USB cable, the SD card will appear as an external hard drive to the PC [USB-MSD] so that you can read and write data.

When you connect via the OpenSDA virtual COM port at 115'200 Baud you will see a command line interface (shell) which has a disk interface where you can also work with the SD card using DOS-like commands:

  Disk interface
===================
up           go to main menu
info         utFAT/card info
dir          [path] show directory content
dird         [path] show deleted directory content
dirh         [path] show hidden content
infof        [path] show file info
infod        [path] show deleted info
cd           [path] change dir. (.. for up)
file         [path] new empty file
write        [path] test write to file
mkdir        new empty dir
rename       [from] [to] rename
trunc        truncate to [length] [path]
print        [path] print file content
del          [path] delete file or dir.
undel        undelete [name]
format       [-16/12] [label] format (unformatted) disk
fformat      [-16/12] [label] full format (unformatted) disk
re-format    [-16/12] [label] reformat disk!!!!!
re-fformat   [-16/12] [label] full reformat disk!!!!!
sect         [hex number] display sector
sectw        [hex no.] [patt.] [cnt]
help         Display menu specific help
quit         Leave command mode

This contains file analysis commands, can view deleted and/or hidden system files, supports long and short file names and can also undelete files if needed (LFN uses the "Linux workaround" to avoid Microsoft patent issues so can be used safely in products).

The file system is utFAT2.0 - documented at http://www.utasker.com/docs/uTasker/uTasker_utFAT.PDF

and the complete operation (FRDM-K25Z, SD card etc.) can be simulated in (approx.) real-time using VisualStudio (see screen shot below) [the free Express edition of VS2010 is adequate]. This makes it the simplest framework/tool for learning the operation and writing applications to work with it since all debugging and analysis of the operation/dehavior of the Kinetis and the SD card is performed on the PC with VisualStudio.

The utFAT2.0 API supports various additional capabilities, such as data caching on individual files, file protection and synchronisation when used by multiple users at the same time and so is generally more powerful and faster than the ones used in most open source projects.

The binary can be built with almost any IDE/compiler (although the GCC cross compiler step is also automated in VS for simplicity):

It can also be used with any other Freedom boards without any porting effort since it adapts itself to all K, KE, KV and KL chips/boards.

All software and tools are free for educational use and supported in this forum.

Regards

Mark

Kinetis: µTasker Kinetis support

KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

pastedImage_8.png

0 Kudos