Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MMC/SDCard support in U-Boot
PostPosted: Thu Nov 17, 2005 1:33 pm 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
I am trying to setup mmc/sdcard support into the u-boot /AT91RM9200DK configuration.
I used Atmels MCI sample with interrupt and PDC.
I managed the integration and can use fatls mmc and fatload mmc.

But comparing the data on the card (It is a sd card) with the data in memory after fatload ... yields a correct first datablock of 512 bytes, but the second data block is shifted by two bytes, which are inserted in the beginning of the second block.

What may be wrong, any idea ?
Thanks in advance for pointing me in the right direction.

BTW. I doubled the MCI clock divider from 1 to 2, there was no change.

Doerte


Top
 Profile  
 
 Post subject: MMC/SDCard support in U-Boot - solved
PostPosted: Tue Nov 22, 2005 1:01 pm 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
Hello,

the issue was in the connection between u-boot mmc framework and the MCI Device, provided by the sample of ATMEL.

Now it is up and runing :D :D

Doerte


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 7:41 pm 
Offline

Joined: Wed Nov 23, 2005 7:35 pm
Posts: 1
hi,

i'm very interessted in booting from a sd-card with a u-boot bootloader. is it possible to get your modified bootloader, please.
can you discribe you boot up scenario. what kernel are you using? have you tried both, sd and mmc card?

sven


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 5:46 pm 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
Hi grobi,

currently it is only experimental code, I will post a patch to the forum, when I finished the code.

It was only made for sd card, but it can simply changed to MMC, because ATMELs sample also supports MMC card.

Regarding Linux have a look at this thread:

http://www.at91.com/www/phpBB2/viewtopic.php4?t=910.

With the help of these patches you can use the sd card under linux.

Best regards/Herzliche Grüße
Doerte :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 4:42 pm 
Offline

Joined: Sat Nov 26, 2005 4:27 pm
Posts: 6
Hi!

I'm interested on these patches too, because I haven't ethernet on my custom board therefore the only way to upload an image is through kermit (VERY SLOW, I can't get more than 3000 cps using HyperTerminal) protocol =(((
Thank you!
PETN


Top
 Profile  
 
 Post subject: Patch
PostPosted: Tue Nov 29, 2005 11:12 am 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
Hello,

here comes the patch. It enables u-boot to read from a SD-Card

Please download the u-boot-1.1.3 tar ball from sourceforge.net, untar it and apply the attached patch, which was unzipped into the directory in which u-boot-1.1.3 lies.

patch -p0 < u-boot-1.1.3.at91rm9200_mmc.patch

If the u-boot is up and running you have to enter mmcinit. If running successfull - You may use all fat based commands, like

    fatls mmc 0
    fatload mmc 0:1 21000000 uimage

Doerte

PS.: I am using the scratchbox-toolchain-arm-gcc3.4.cs- 0.9.8.5 arm-linux-gcc3.4.cs-glibc2.3-nofpu compiler for Scratchbox.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 03, 2005 12:10 am 
Offline

Joined: Sat Nov 26, 2005 4:27 pm
Posts: 6
Thank you very much doerte!

This patch is very good, and now I can upload large images in few seconds! (instead of hours!)

PETN


Top
 Profile  
 
 Post subject: i am sorry,i have patch ,but it is not runing
PostPosted: Wed Dec 07, 2005 7:07 am 
Offline

Joined: Wed Dec 07, 2005 6:59 am
Posts: 8
the firest question:
u-boot 1.1.3 not runling on the dK board,and i have patch that ,and the u-boot run.

when the u-boot 1.13 run ,the fatls,fatload may be ok,but,

have the error,

U-Boot> mmcinit

Tests MCI SDCard Succe
Card found with 24
U-Boot> fatls mmc 0
mmc_block_read: Error read 5 to dst

** Unable to use mmc 0:1 for fatls **
U-Boot> fatls mmc 0:1
mmc_block_read: Error read 5 to dst

** Unable to use mmc 0:1 for fatls **
U-Boot> fatload
usage: fatload <interface> <dev[:part]> <addr> <filename> [bytes]
U-Boot> fatload mmc 0:1 0x20000000 uImage
mmc_block_read: Error read 5 to dst

would you like give the compile process.
thank you very much!


Top
 Profile  
 
 Post subject: answer to szembed
PostPosted: Mon Dec 12, 2005 10:43 am 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
Hello szembed,

I am afraid, that your software patch destroyed the interrupt activation or handling of the mci device. Have a look on your config file AT91RM9200dk.h - are the interrupts enabled ?

The mci controler is in state 5 (AT91C_MCI_RX_SINGLE_BLOCK) after reading a block, which is adjusted with the interupt handler, if set.

Please start with a clean patch for 1.1.3 u-boot.

The printf function seems not to be correct, the correct string is:
"Tests MCI SDCard Successful !!!"

As far as I remember this u-boot runs also on the dk-Board as it is - please correct me if I am wrong.

Best regards
Dörte


Top
 Profile  
 
 Post subject: about the 2.6.14 kernel SD card support??
PostPosted: Thu Dec 15, 2005 2:59 am 
Offline

Joined: Wed Dec 07, 2005 6:59 am
Posts: 8
fat filesystem and sd card reader??

you have solve that??


Top
 Profile  
 
 Post subject: MMC/SDCard support in U-Boot
PostPosted: Mon Dec 19, 2005 2:10 pm 
Offline

Joined: Mon Dec 19, 2005 1:05 pm
Posts: 1
Hi,

first i'd like to mention that the u-boot-1.1.3 does not seem to work with some compilers out of the box when you use the AT91RM9200DK configuration.
In some cases you have to add the -Uarm option to your Makefile.
For example it is necessary for old-fashioned compilers like gcc 2.95.3
Anyway, after that it seemed O.K.

What i tried next is to insert doerte's patch into u-boot 1.1.2 because i got a working configuration for a custom AT91RM9200 board which isn't supported in 1.1.3 yet.
Everything compiles fine.
This is what i got:

U-Boot 1.1.2 (Dec 16 2005 - 14:24:06)

U-Boot code: 21F00000 -> 21F1CD78 BSS: -> 21F515DC
IRQ Stack: 21edef7c
FIQ Stack: 21eddf7c
RAM Configuration:
Bank #0: 20000000 32 MB
Flash: 16 MB

In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
U-Boot> mmcinit

Tests MCI SDCard Successful !!!
Card found with 119 MB size
U-Boot> fatls mmc 1
mmc_block_read: Error read 5 to dst

** Unable to use mmc 1:1 for fatls **
U-Boot>

This seems to be identical to szembed's error message.
I think because of the stack message the IRQ's are O.K. I also used the pull-up's for MCI-interface mentioned in other postings.

What else could go wrong?
Perhaps wrong clock ratio for block access?

Regards,

scholbert


Top
 Profile  
 
 Post subject: Re: MMC/SDCard support in U-Boot
PostPosted: Sat Dec 24, 2005 1:51 am 
Offline

Joined: Thu Sep 01, 2005 9:29 am
Posts: 7
Location: Berlin, Germany
scholbert wrote:
Hi,

...
U-Boot> mmcinit

Tests MCI SDCard Successful !!!
Card found with 119 MB size
U-Boot> fatls mmc 1
mmc_block_read: Error read 5 to dst

** Unable to use mmc 1:1 for fatls **
U-Boot>

This seems to be identical to szembed's error message.
I think because of the stack message the IRQ's are O.K. I also used the pull-up's for MCI-interface mentioned in other postings.

What else could go wrong?
Perhaps wrong clock ratio for block access?

Regards,

scholbert


This implementation is only tested with a single fat partition on the sd card. You are trying the second hard disk with label 1. May be this is the error ?

To see where the read error occurs, You may add a lot of "printf" in AT91F_MCI_ReadBlock in cpu/arm920t/at91rm9200/mci_device.c
Like this:

Code:
if(pMCI_Device->pMCI_DeviceDesc->state != AT91C_MCI_IDLE){
   printf ("Device busy\n");
       return AT91C_READ_ERROR;
}


Unfortunatly I do not have a DK board to test it. I used the EK board.

Regards
Dörte


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 9:01 pm 
Offline

Joined: Mon Aug 28, 2006 8:42 pm
Posts: 3
I am looking for this patch, but it doesn't seem to be attached anymore. Does anyone know where to find this or can it be re-posted?

Thanks,
Kory


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 6:27 pm 
Offline
User avatar

Joined: Fri Feb 13, 2004 7:53 pm
Posts: 329
Hello Kswain,

AT91RM9200 and SAM92xx patches available from here

Go to http://maxim.org.za/AT91RM9200/ for AT91RM9200 Linux (2.4) patches and
http://maxim.org.za/AT91RM9200/2.6 for AT91RM9200 Linux (2.6) patches.

Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 6:43 pm 
Offline

Joined: Mon Aug 28, 2006 8:42 pm
Posts: 3
I am looking for the U-boot patch that was posted by doerte, not linux patches. It doesn't appear on the U-boot sourcforge site, but it was posted to these forums a while back I think.

Thanks,
Kory


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to: