TOP
SSV SOFTWARE SYSTEMS REGISTER  REGISTER
Log in to check your private messages  Log in to check your private messages
START FAQ SEARCH MITGLIEDER PROFILE  Log in 
SSV-Forum
using an sd card

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/9265
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
cphiggins



Joined: 02 Jun 2011
Posts: 8

PostPosted: 03.06.2011, 10:49    Post subject: using an sd card Reply with quote

Hello all,

I have a micro SD card socket wired up to the 6925. However when I insert a card and
reboot it is not recognised.

What do I need to do? Are there drivers, kernel modules or other configuration I need to use?

Has anyone else succeeded in using an SD card?

thanks,
chris
Back to top
View user's profile Send private message
ene



Joined: 25 Jun 2007
Posts: 14

PostPosted: 08.06.2011, 14:33    Post subject: Reply with quote

Atention! Don't insert or remove a SD-Card if board is powered on, you can destroy SD-Card or DNP/9265.

To use SD-Card on DNP/9265 you need enable mmc support in SSV kernel hardware configuration. Steps to follow:

1) Take and edit the hardware config file
Quote:
ssvhwcnf-dnp9265.bin
from DNP/9265 CD under
Quote:
\Linux\product_recovery\buildup-3791\linux\kernel\
Set mmc1=0 to mmc1=1 in this file (don't edit line ends!):
Code:
SsVhW1 hwtype=0 com1=1 com1rtscts=1 com2=1 com3=0 com3rtscts=0 nor=1 usbhost1=1 mmc1=1 i2c=0

### SSVHWCONFIG FOR LINUX KERNEL 9263/1 - DNP/9265 Version 1.0 ###


2) Transfer the file to DNP and write them to flash:
    - Start on a PC a tftp server and provide the hardware config file
    - Set RCM Jumper, connect LAN (for tftp transfer), connect COM1 with a terminal (115200 8N1).
    - Switch power on and stop u-boot on console with any key.
    - Set u-boot environment for tftp server and own target ip
    Code:
    setenv serverip 192.168.0.X
    setenv ipaddr 192.168.0.Y

    - Load and save hardware configuration:
    Code:
    tftp 0x21000000 ssvhwcnf-dnp9265.bin
    protect off 1:2-2; erase 1:2-2
    cp.b 0x21000000 ${addr_kernelconfig} ${filesize}


3) After reboot, kernel will start with SD/MMC support. To use SD-Card:
    -If you use FAT filesystem on SD-Card you need to load additional modules fat.ko, nls_cp437.ko, nls_iso8859-1.ko and vfat.ko (on DNP/9265 CD \Linux\modules\linux-2.6.24.7-modules-dnp9265-3783.tar.gz). Transfer them to DNP and load with:
    Code:
    insmod fat.ko
    insmod nls_cp437.ko
    insmod nls_iso8859-1.ko
    insmod vfat.ko


    - Mount first FAT partition of SD-Card:
    Code:
    mount -t vfat /dev/mmcblk0p1/media/mmcp1


ENE
Back to top
View user's profile Send private message ICQ Number
cphiggins



Joined: 02 Jun 2011
Posts: 8

PostPosted: 08.06.2011, 18:00    Post subject: Reply with quote

Thank you for the extremely clear and helpful instructions. I believe I have followed them correctly. Unfortunately I still cannot mount the card.

At the U-boot prompt, I confirm the config change:

Code:
U-Boot> md ${addr_kernelconfig}
10010000: 68567353 68203157 70797477 20303d65    SsVhW1 hwtype=0
10010010: 316d6f63 6320313d 72316d6f 74637374    com1=1 com1rtsct
10010020: 20313d73 326d6f63 6320313d 3d336d6f    s=1 com2=1 com3=
10010030: 6f632030 7472336d 73746373 6e20303d    0 com3rtscts=0 n
10010040: 313d726f 62737520 74736f68 20313d31    or=1 usbhost1=1
10010050: 31636d6d 6920313d 303d6332 230a0a00    mmc1=1 i2c=0...#
10010060: 53202323 57485653 464e4f43 46204749    ## SSVHWCONFIG F
10010070: 4c20524f 58554e49 52454b20 204c454e    OR LINUX KERNEL
10010080: 33363239 2d20312f 504e4420 3632392f    9263/1 - DNP/926
10010090: 65562035 6f697372 2e31206e 23232030    5 Version 1.0 ##
100100a0: ffff0a23 ffffffff ffffffff ffffffff    #...............
100100b0: ffffffff ffffffff ffffffff ffffffff    ................
100100c0: ffffffff ffffffff ffffffff ffffffff    ................
100100d0: ffffffff ffffffff ffffffff ffffffff    ................
100100e0: ffffffff ffffffff ffffffff ffffffff    ................
100100f0: ffffffff ffffffff ffffffff ffffffff    ................


I see no sign in the linux boot messages that the device has been detected. Would you expect to see some text in dmesg indicating a working card?

After insmod of the modules I get:

Code:
root@emblinux:~$ mount -t fat /dev/mmcblk0p1 /media/mmcp1
mount: Mounting /dev/mmcblk0p1 on /media/mmcp1 failed: No such device
root@emblinux:~$ mount -t vfat /dev/mmcblk0p1 /media/mmcp1
mount: Mounting /dev/mmcblk0p1 on /media/mmcp1 failed: No such device or address


Any further help would be much appreciated.

thanks, chris[/quote]
Back to top
View user's profile Send private message
ene



Joined: 25 Jun 2007
Posts: 14

PostPosted: 09.06.2011, 08:24    Post subject: Reply with quote

After booting, kernel must show following informations (example SD-Card 2GB with 3 partitions):
Code:
root@emblinux:~# dmesg | grep mmc
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address aaaa
mmcblk0: mmc0:aaaa SD02G 1931264KiB
 mmcblk0: p1 p2 p3


To get filesystem of partitions (example SD-Card 2GB with 3 EXT2 filesystem partitions):
Code:
root@emblinux:~# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 1977 MB, 1977614336 bytes
4 heads, 16 sectors/track, 60352 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1               1        6400      204799+ 83 Linux
/dev/mmcblk0p2            6401       19200      409600  83 Linux
/dev/mmcblk0p3           19201       60352     1316864  83 Linux


ENE
Back to top
View user's profile Send private message ICQ Number
cphiggins



Joined: 02 Jun 2011
Posts: 8

PostPosted: 09.06.2011, 18:06    Post subject: Reply with quote

Thanks again for the helpful answer, and I can confirm that I see none of these messages.

We've been checking the hardware wiring of the sd card slot to the dnp pins. Everything seems in order, however there is no voltage getting into the card.

Pin 8 on the 9265 is for SDPOWER. Since this is on the module it suggests an enable/disable facility.

So is there some configuration/command I have missed to ensure power is fed to the sd unit?

many thanks, chris
Back to top
View user's profile Send private message
ene



Joined: 25 Jun 2007
Posts: 14

PostPosted: 14.06.2011, 09:31    Post subject: Reply with quote

Atention! PIN 8 is not intended to supply the card with voltage, the PIN output does not provide enough power. Use board power or use transistor if you want to switch power.

Furthermore, PIN 8 is not handled by the driver. You need to switch them self by using ssvpio driver (see CD:\Linux\applications\demos). Example: sd_pwr.c
Code:
#include <stdio.h>
#include "ssvpio.h"

int main(void) {
    int fd;
   
    fd = ssvpio_open();                         //open driver

    ssvpio_write_dir(fd, PORT_A, 0x08, 0x00);   //set PIN8 to output
    ssvpio_write_data(fd, PORT_A, 0x08, 0x00);  //set PIN8 high
    ssvpio_write_data(fd, PORT_A, 0x00, 0x08);  //set PIN8 low
   
    ssvpio_close(fd);
    return 0;
}

Compile with
Code:
arm-angstrom-linux-gnueabi-gcc -O2 -Wl,-s -o sd_pwr sd_pwr.c

ENE
Back to top
View user's profile Send private message ICQ Number
cphiggins



Joined: 02 Jun 2011
Posts: 8

PostPosted: 22.06.2011, 10:20    Post subject: Reply with quote

Thanks again for the help, I am however no further forward. I can toggle the various pins but nothing much seems to help. Shouldn't this all be done by the driver anyway?

We have also tried hooking up a sd reader to a DNP/EVA6 evaluation board, with even less success. So it seems we are missing some information to help us achieve this goal.

Short of reading the driver source code and trying to figure out what it expects to happen can anyone help with a few of these questions:

- can anyone show a schematic of an sd card pinned out to the 9265 module, that has been used successfully?

- might I need an updated mmc driver? How do I find out which version is being used?

- I can get as far as mmc detecting the card at boot (by powering from elsewhere) but any attempt from then on to use it (such as fdisk) will put fdisk, mmcqd and kmmcd into uninterruptible sleep (state D). If this suggests anything, please let me know

thanks, chris
Back to top
View user's profile Send private message
ssc



Joined: 05 May 2006
Posts: 36

PostPosted: 19.07.2011, 15:00    Post subject: Reply with quote

Hi Chris!

cphiggins wrote:

- can anyone show a schematic of an sd card pinned out to the 9265 module, that has been used successfully?

Pull-Up resistors should be implemented on SD-Card interface as described in AT91 Evalution Board Schematics (page 33):
http://www.atmel.com/dyn/resources/prod_documents/doc6341.pdf

For the pin assigment of the DNP/9265 socket, please refer to the HWR.

cphiggins wrote:

- might I need an updated mmc driver? How do I find out which version is being used?

No need for a driver update. Everything is ready to go Very Happy

cphiggins wrote:

- I can get as far as mmc detecting the card at boot (by powering from elsewhere) but any attempt from then on to use it (such as fdisk) will put fdisk, mmcqd and kmmcd into uninterruptible sleep (state D). If this suggests anything, please let me know

With the resistors in place, these problems will be gone.

Best regards,

scholbert
Back to top
View user's profile Send private message
cphiggins



Joined: 02 Jun 2011
Posts: 8

PostPosted: 19.07.2011, 15:23    Post subject: Reply with quote

Thanks for everyone's help, the pull-up resistors were what we were missing. Works fine for us now!

many thanks, chris
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/9265 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV SOFTWARE SYSTEMS

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2024 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015