Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: sansa sd card detection (some hints)

sansa sd card detection (some hints)

From: Antonius Hellmann <antonius.hellmann_at_gmx.de>
Date: Tue, 8 May 2007 10:38:37 +0200

I did a first attempt in finding the magics of the sd card detection in the sansa software by using the emulator.
Here are the results:

From the debug screen: GPIOA bit7 (0x80) goes low on sd card insertion.

The sansa software executes gpio in interrupt context. I think I have identified following cpu interrupts:
Bits 0-63
 0: timer1
 1: timer2
 2: RTC
 4: MBOX4
 9: forced interrupt
18: LCD_REG_4
26: DMA
32: GPIOs

At sd card insertion the software seems to execute following register manipulations:

counter address register register data
========================================================
705df60 000b7318 DEV_RESET 60006004 R4-00000000
705df62 000b7320 DEV_RESET 60006004 W4-00004000
705df65 000b732c DEV_RESET 60006004 R4-00004000
705df67 000b7334 DEV_RESET 60006004 W4-00000000
705dfed 0003d018 REG_12 70008244 R4-0000a000
705dfef 0003d020 REG_12 70008244 W4-0000a000
705dff2 0003d02c REG_11 70008240 R4-0000a000
705dff4 0003d034 REG_11 70008240 W4-0000a000
705dff7 0003d040 REG_12 70008244 R4-0000a000
705dff9 0003d048 REG_12 70008244 W4-00008000
705dffc 0003d054 REG_12 70008244 R4-00008000
705dffe 0003d05c REG_12 70008244 W4-0000a000
705e001 0003d068 REG_11 70008240 R4-0000a000
705e003 0003d070 REG_11 70008240 W4-00008000
705e006 0003d07c REG_11 70008240 R4-00008000
705e008 0003d084 REG_11 70008240 W4-0000a000
705e00b 0003d090 SD_STATE_REG 70008238 W4-00000004
705e05a 0003de2c REG_1 70008208 W4-00000006
705e0d8 0003daac REG_5 70008224 W4-0000000f
705e106 0003d8a8 CMD_REG0 70008228 W4-00000000
705e109 0003d8b4 CMD_REG1 7000822c W4-00000000
705e10c 0003d8c0 CMD_REG2 70008230 W4-00000000
705e121 0003d9d4 UNKNOWN 70008210 W4-00000100
705e189 0003dc80 STATUS_REG 70008204 R4-00003080
705e191 0003dcb0 STATUS_REG 70008204 R4-00003080
705e193 0003dcb8 STATUS_REG 70008204 R4-00003080
705e249 0003daac REG_5 70008224 W4-0000000f
705e277 0003d8a8 CMD_REG0 70008228 W4-00000037
705e27a 0003d8b4 CMD_REG1 7000822c W4-00000000
705e27d 0003d8c0 CMD_REG2 70008230 W4-00000000
705e29c 0003d9c4 UNKNOWN 70008210 W4-00000001
705e304 0003dc80 STATUS_REG 70008204 R4-00003080
705e30c 0003dcb0 STATUS_REG 70008204 R4-00003080
705e30e 0003dcb8 STATUS_REG 70008204 R4-00003080
705e320 0003d834 RESPONSE_REG 70008234 R4-00000001
705e327 0003d834 RESPONSE_REG 70008234 R4-00000001
705e32e 0003d834 RESPONSE_REG 70008234 R4-00000001
705e3d3 0003daac REG_5 70008224 W4-0000000f
705e401 0003d8a8 CMD_REG0 70008228 W4-00000029
705e404 0003d8b4 CMD_REG1 7000822c W4-00000010
705e407 0003d8c0 CMD_REG2 70008230 W4-00000000
705e421 0003d9b0 UNKNOWN 70008210 W4-00000003
705e489 0003dc80 STATUS_REG 70008204 R4-00003080
705e491 0003dcb0 STATUS_REG 70008204 R4-00003080
705e493 0003dcb8 STATUS_REG 70008204 R4-00003080
705e4a5 0003d834 RESPONSE_REG 70008234 R4-00003f80
705e4ac 0003d834 RESPONSE_REG 70008234 R4-0000ffff
705e4b3 0003d834 RESPONSE_REG 70008234 R4-0000ffff

Because the emulator does not yet give the correct register content after sd card insertion, the above sequence is not complete and the returned values (R4-values) must not be regarded as the real ones.
These results may give some hints, how to do the sd card detection in our software.
Received on 2007-05-08


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa