All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Rossak <embed3d@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] STM32F7 SD/MMC Card Driver - Testing/Review
Date: Wed, 22 Mar 2017 18:53:58 +0100	[thread overview]
Message-ID: <42fcb451-e925-e224-b734-ca4e1cc7190d@gmail.com> (raw)
In-Reply-To: <b06c307f-ce60-1fdf-c68e-aa88bd8b5fcd@gmail.com>

Hi Jaehoon,

I had a look in the include/mmc.h file and there are different types of 
cmd 6 command defined:

ACMD6: Sets Bus width --> no data
CMD6: Switch Function --> data

But it was the right place to look for the error. I forgot to disable 
the DMA! Shame on me!!! I updated the code on github. The new log [5] 
looks now much better!

The log shows the following: reset  -> mmc rescan -> mmc info

@ reset I couldn't see any error happen (CMD 17 looks also good!). But 
it has some error the dos partition table.

@ mmc rescan only CMD 17 at the end fails

@ mmc info looks everything ok


Best Regards,

Philipp Rossak


[5] http://pastebin.com/H8mWTP4C


On 22.03.2017 12:18, Philipp Rossak wrote:
> Hi Jaehoon,
>
> Yes that what you mentioned is a timeout error. That error occurs if I 
> don't get a response from several Hardware/error flags (a counter 
> reaches  a limit).
>
> As you mentioned the cmd 6 shoudn't read any data. This is what I'm 
> doing if I'm transfering data:
>
> This is the function called from the upper layers:
>
> stm32_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct 
> mmc_data *data)
>
> If it is necessary to transfer data all the related code for that is 
> placed in if conditions like below.
>
> if(data) { ... }
>
> Something interesting:
>
> Here is are two new logs I just recoreded a few minutes ago after some 
> sleep. The sourcecode is the same i just recompiled it and flashed it 
> again. You can see it on the timestamp in line 4. I used the same card 
> as in Log [1].
>
> Log [3]  behaves now different than before, there is no data read from 
> the cmd6
>
> Log [4] behaves similar to log [1].
>
> I made a diff between log [3] and Log [4] and till line 265 is 
> everything the same. @ line 266 & 267 the answer to cmd 51 is different!?
>
> Best Regards,
>
> Philipp Rossak
>
> [3] http://pastebin.com/AK3RB1bH
>
> [4] http://pastebin.com/xk2TkGpd
>
>
> On 22.03.2017 02:54, Jaehoon Chung wrote:
>> Hi Philipp,
>>
>> On 03/22/2017 10:38 AM, Philipp Rossak wrote:
>>> Hi Jaehoon,
>>>
>>> Thanks for that hint!
>>>
>>> I uploaded two logs to pastebin.
>>>
>>> Log [1] is a sandisk ultra 32gb sd card. This time I didn't got it 
>>> work properly.
>>>
>>> Log [2] is from an other 2gb sd card where I pressed the reset 
>>> button until I received data from CMD 17 command.
>>>
>>> Right now there are a lot of debug outputs, to make it for me easy 
>>> for me to find the errors. The most of them will be removed later.
>>>
>>> Best Regards,
>>>
>>> Philipp Rossak
>>>
>>>
>>> [1] http://pastebin.com/LcSSmBfp
>> In Log [1],
>>
>> mmc 0, cmd 6(0x00000446), arg 0x00fffff1
>> START DATA TRANSFER
>> CMD: 6
>> Timeout STA2: 00202040------------------
>> END DATA TRANSFER
>> Ret: -110  -  STA  00202540
>>
>> It seems timeout error, right? As i know, CMD6 doesn't have any data..
>> Even if didn't check your source code..i guess that you need to check 
>> whether it's waiting for completing data or not.
>> (or check the register about interrupt e.g, end of data interrupt..?)
>>
>>
>> In Log [2],
>>
>> It seems to fail the getting sd status...also timeout..
>> I need to check your source code..after that, i will review more..
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>> [2] http://pastebin.com/zRbRMXtE
>>>
>>>
>>>
>>> On 22.03.2017 01:51, Jaehoon Chung wrote:
>>>> Hi Philipp,
>>>>
>>>> On 03/22/2017 09:27 AM, Philipp Rossak wrote:
>>>>> Hey everyone,
>>>>>
>>>>> I'm currently working on a SD / MMC Card driver for the 
>>>>> stm32f746g-disco Board. You can find my actual very early work 
>>>>> right here on my github repository: [0]
>>>>>
>>>>> Currently I'm getting errors that are not reproducible:
>>>>>
>>>>> - Errors on sending different commands (happens somtimes but 
>>>>> randomly)
>>>>>
>>>>> - Errors at CMD 17 & 18 reading procedures
>>>> If you can also share the log, it's helpful to check your problem.
>>>> I don't have board to test yours, but i can check your driver as 
>>>> code level.
>>>>
>>>> Best Regards,
>>>> Jaehoon Chung
>>>>
>>>>> And sometimes works everything without any problems....
>>>>>
>>>>> Right now I think that my hardware got broken (but I'm not sure). 
>>>>> It would be nice if someone could test the driver and send me the 
>>>>> log. A small code review would help me also.
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Philipp Rossak
>>>>>
>>>>> [0] 
>>>>> https://github.com/embed-3d/stm32_mmc_driver/tree/stm32f7_mmc_hw_testing 
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> https://lists.denx.de/listinfo/u-boot
>>>
>>>
>

      reply	other threads:[~2017-03-22 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170322002728epcas5p1bb172ea8b3355944464df93a384cd082@epcas5p1.samsung.com>
2017-03-22  0:27 ` [U-Boot] STM32F7 SD/MMC Card Driver - Testing/Review Philipp Rossak
2017-03-22  0:51   ` Jaehoon Chung
2017-03-22  1:38     ` Philipp Rossak
2017-03-22  1:54       ` Jaehoon Chung
2017-03-22 11:18         ` Philipp Rossak
2017-03-22 17:53           ` Philipp Rossak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42fcb451-e925-e224-b734-ca4e1cc7190d@gmail.com \
    --to=embed3d@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.