08:20
Stromeko has quit [Quit: Going… gone.]
08:21
Stromeko has joined ##raspberrypi-internals
17:46
inara has quit [Quit: Leaving]
17:50
inara has joined ##raspberrypi-internals
18:05
vriska has joined ##raspberrypi-internals
18:05
vriska has quit [Remote host closed the connection]
18:06
vriska has joined ##raspberrypi-internals
18:13
vriska has joined ##raspberrypi-internals
20:00
Stromeko has quit [Quit: Going… gone.]
20:05
Stromeko has joined ##raspberrypi-internals
21:36
<
f_ridge >
<x2x6_/D> You'd probably laugh, but I can't get CMD9 working)
21:38
<
f_ridge >
<x2x6_/D> You'd probably laugh, but I can't get CMD9 working), according to spec it should always work(edited)
21:45
<
f_ridge >
<clever___/D> are you setting the reply type correctly?
21:47
sys64738 has quit [Quit: WeeChat 4.2.1]
21:47
<
f_ridge >
<x2x6_/D> In CMDTM register I have to set bits as [17:16] as 0b01
21:47
<
f_ridge >
<x2x6_/D> for R2
21:47
<
f_ridge >
<x2x6_/D> for R2 (136bits)(edited)
21:47
<
f_ridge >
<clever___/D> my memory says its R1
21:48
<
f_ridge >
<clever___/D> ah but the pdf says R2
21:48
<
f_ridge >
<clever___/D> > Addressed card sends its card-specific data (CSD) on the CMD line.
21:48
<
f_ridge >
<clever___/D> are you including the card address in the args?
21:49
<
f_ridge >
<x2x6_/D> I include RCA, but RCA is a bit stange - its 0x5048
21:49
<
f_ridge >
<clever___/D> thats normal
21:49
<
f_ridge >
<clever___/D> its basically a 16bit random number
21:49
<
f_ridge >
<clever___/D> and i assume youve `<<16`'d it?
21:50
<
f_ridge >
<x2x6_/D> Yes,
21:50
<
f_ridge >
<x2x6_/D> But its strange , 5 minutes ago I saw different section with different response type
21:50
<
f_ridge >
<clever___/D> same
21:50
<
f_ridge >
<clever___/D> compare pages 297 and 102
21:51
<
f_ridge >
<clever___/D> i suspect the R1 vs R2 differs, depending on the version of the card?
21:51
<
f_ridge >
<clever___/D> try setting it up as an R1 reply?
21:52
<
f_ridge >
<clever___/D> this also says "selected" not "addressed", so you need to select the card by rca with another cmd first
21:52
<
f_ridge >
<x2x6_/D> Either way controller does not get a response
21:53
<
f_ridge >
<clever___/D> CMD7 to select a card
21:54
sys64738 has joined ##raspberrypi-internals
21:54
<
f_ridge >
<x2x6_/D> Yep
21:55
<
f_ridge >
<x2x6_/D> I run it right after select card function
21:55
<
f_ridge >
<x2x6_/D> it does not work
21:55
<
f_ridge >
<clever___/D> > The following table provides a detailed description of the SPI bus commands.
21:55
<
f_ridge >
<clever___/D> oh, thats why one of them differs
21:56
<
f_ridge >
<x2x6_/D> Yes, the one on page 104 I think is the more appropriate
21:56
<
f_ridge >
<clever___/D> yeah
21:57
<
f_ridge >
<clever___/D> line 346, your printing a %d and not passing it an arg
22:01
<
f_ridge >
<x2x6_/D> Yes, I've added that, but in the logs i see error logged inside of the cmd9 function. I fixed that but it's still error by timeout, this happens when command takes too long
22:01
<
f_ridge >
<x2x6_/D> but even without timeout it just hangs
22:01
<
f_ridge >
<x2x6_/D> I mean while waiting forever response never comes
22:02
<
f_ridge >
<clever___/D> thats strange
22:07
<
f_ridge >
<x2x6_/D> Yes, it's kind of depressing
22:07
<
f_ridge >
<x2x6_/D> I will install linux on this card and see how raspberry reads it from kernel
22:07
<
f_ridge >
<clever___/D> where does that occur in the code? i'm having trouble finding it
22:08
<
f_ridge >
<clever___/D> installing linux to the card isnt entirely needed
22:08
<
f_ridge >
<clever___/D> you can boot from usb, and then read the card
22:08
<
f_ridge >
<x2x6_/D> Running it from usb is not quick if you don't have usb)
22:08
<
f_ridge >
<clever___/D> ah, sure
22:09
<
f_ridge >
<x2x6_/D> wait a sec, I'll make a branch with trials
22:09
<
f_ridge >
<x2x6_/D> wait a sec, I'll make a branch with cmd9 trials(edited)
22:10
<
f_ridge >
<x2x6_/D> can you go to cmd9_test_0 branch?
22:10
<
f_ridge >
<clever___/D> there
22:11
<
f_ridge >
<x2x6_/D> And the other more "RAW version" is the cmd9_test_1 branch. In there I use the custom_cmd9 function, there is less nesting there
22:11
<
f_ridge >
<clever___/D> so, you have this big `sd_commands` array, that contains every command index, and its size
22:12
<
f_ridge >
<clever___/D> ah, and 623 reads that
22:20
<
f_ridge >
<x2x6_/D> I see that in interrupt after setting cmdtm is receive 0x00018000 as an interrupt value.
22:20
<
f_ridge >
<x2x6_/D> its bits 15 and 16,
22:20
<
f_ridge >
<x2x6_/D> 15 is OR for all errors, while 16 is the actual error CTO_ERR - timeout on CMD line
22:20
<
f_ridge >
<x2x6_/D> Probably the card did not respond with any kind of ACK
22:21
<
f_ridge >
<GitHub Lines/D> ```c
22:21
<
f_ridge >
<GitHub Lines/D> CMDTM_GEN(9, R1, 1, NA, 0, 0),
22:21
<
f_ridge >
<GitHub Lines/D> ```
22:21
<
f_ridge >
<clever___/D> should this still be R1?
22:22
<
f_ridge >
<x2x6_/D> No. I think its changed when we tried it 5 minutes ago and got into branch
22:22
<
f_ridge >
<x2x6_/D> So R2 also will not work, tested
22:23
<
f_ridge >
<clever___/D> do other R2's work?
22:23
<
f_ridge >
<clever___/D> try doing cmd9 much late in the init process?
22:25
<
f_ridge >
<clever___/D> this also says that CMD9 can only be ran while in standby
22:25
<
f_ridge >
<clever___/D> and CMD7 moves you to transfer state
22:26
<
f_ridge >
<x2x6_/D> Good point
22:27
<
f_ridge >
<x2x6_/D> Looks like it is possible to run cmd7 again to go into standby again
22:27
<
f_ridge >
<clever___/D> or just do it before 7
22:31
<
f_ridge >
<x2x6_/D> Before CMD7 it worked somehow
22:31
<
f_ridge >
<x2x6_/D> Before cmdtm: rsp:50480500,00000000,00000000,00000000,sta:01ff0000,int:00000000
22:31
<
f_ridge >
<x2x6_/D> After cmdtm: rsp:50480500,00000000,00000000,00000000,sta:00ff0001,int:00000000
22:31
<
f_ridge >
<x2x6_/D> After cmdtm: rsp:800a4000,03a0e77f,325b5900,00400e00,sta:01ff0000,int:00088001
22:31
<
f_ridge >
<x2x6_/D> After cmdtm: rsp:800a4000,03a0e77f,325b5900,00400e00,sta:01ff0000,int:00000000
22:31
<
f_ridge >
<x2x6_/D> After cmdtm: rsp:800a4000,03a0e77f,325b5900,00400e00,sta:01ff0000,int:00000000
22:31
<
f_ridge >
<x2x6_/D> rsp: is all 4 RESP registers printed
22:32
<
f_ridge >
<clever___/D> `CSD: 0x400e0032db790003ae077f800a400027`
22:32
<
f_ridge >
<clever___/D> `printf("CSD: 0x%08x%08x%08x%08x\n", csd[3], csd[2], csd[1], csd[0]);`
22:34
<
f_ridge >
<clever___/D> if i punch `50480500000000000000000000000000` into the decoder, i get something semi valid
22:36
<
f_ridge >
<x2x6_/D> rpi doc gives idea of how 136 bits are layed out in the resp registers
22:37
<
f_ridge >
<clever___/D> that matches the order i needed with sdhost, resp0 is the lower 32bits
22:43
<
f_ridge >
<x2x6_/D> Thanks for help.
22:43
<
f_ridge >
<x2x6_/D> Now I need to parse it
22:44
<
f_ridge >
<x2x6_/D> It's much easier, the harder part is to know where to put cmd9
22:44
<
f_ridge >
<x2x6_/D> I also have the same problem sending one more register, with help of cmd58, I will check the diagrams for it later
22:44
<
f_ridge >
<GitHub Lines/D> ```cpp
22:44
<
f_ridge >
<GitHub Lines/D> if (SD_CSD_CSDVER(csd) == SD_CSD_CSDVER_2_0) {
22:44
<
f_ridge >
<GitHub Lines/D> printf(" CSD : Ver 2.0\n");
22:45
<
f_ridge >
<GitHub Lines/D> printf(" Capacity: %d\n", SD_CSD_V2_CAPACITY(csd));
22:45
<
f_ridge >
<GitHub Lines/D> printf(" Size : %d\n", SD_CSD_V2_C_SIZE(csd));
22:45
<
f_ridge >
<GitHub Lines/D> ```
22:45
<
f_ridge >
<clever___/D> some examples of parsing CSD
23:31
t0mm13b has quit [Ping timeout: 268 seconds]
23:32
t0mm13b has joined ##raspberrypi-internals