Rockbox Development > New Ports
SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2
fragilematter:
Okay atomikpunk, I hope this will clarify as to why I'm saying it works when you plug the usb in: http://video.google.com/videoplay?docid=-402239299533763874 (it might take a few minutes before google video processes it).
In a nutshell: by starting the sansa using power button (either with hold on or off) you get the delay. But if you start the sansa by plugging it into a powered usb port (the one in the video is a Motorola phone charger with the wire clipped and a usb port attached at the end) you don't get any delay.
funman:
Hi all, I have some good news :)
atomicpunk found the hold button on the Clip, it is GPIOA_PIN3 like suspected.
I ran the following code on my device:
--- Code: ---OrigEntry:
.word 0
/* Enable the GPIO module clock */
LDR R1, =CGU_PERI
LDR R2, [R1]
MOV R0, #0x10000
ORR R2, R2, R0
STR R2, [R1]
/* Be sure GPIOA port is set to all inputs*/
LDR R1, =GPIOA_REG
MOV R2, #0
STR R2, [R1, #0x400]
/* A little delay - not sure it is needed but it doesn't hurt */
loop:
NOP
ADDS R2, R2, #1
CMP R2, #100
BLT loop
/* Read GPIOA pin 3 */
LDRB R2, [R1, #0x20]
/* Check its state */
MOV R0, #0x1
CMP R2, #0
/* Delay only if bit is set (arbitrary) */
MOVNE R0, #0x500000
loop2:
SUBS R0, R0, #1
BNE loop2
/* Jump back and resume! */
LDR PC, OrigEntry
.set CGU_PERI, 0xC80F0014
.set GPIOA_REG, 0xC80B0000
--- End code ---
Since on the Clip you can not press the power button, and set hold at the same time I used a trick:
I power it by plugging it over usb.
If hold is on: you'll notice a 5s delay (PIN A3 is set)
If hold is off: boot immediately
Now hunting the other buttons, and still hunting hold on the other models
fragilematter:
Basically you reversed the behaviour (atomikpunks was delaying when the bit was cleared and yours delays when it's set), but that doesn't explain why it behaves like that on e200v2's (or at least on mine).
Still, it's nice to see things are moving! :) Way to go!
funman:
the buttons may be wired differently on each model, I'm trying to see in the e200 firmware if I find a routine similar, maybe it's another pin you need to test.
Note: you can try testing other pins yourself by changing the code:
--- Code: --- /* Read GPIOA pin 3 */
LDRB R2, [R1, #0x20]
--- End code ---
0x10 is pin2, 0x08 pin1, 0x04 pin0, 0x40 pin4 etc..
EDIT: it could be C1 on the e200, can you try these modificatons fragilematter ?
--- Code: --- LDRB R2, [R1, #0x8]
...
.set GPIOA_REG, 0xC80D0000 /* not GPIOA but GPIOC */
--- End code ---
fragilematter:
Thanks for looking :)
It's pretty late to do a "testing spree" today :D , but I'll try different offsets tomorrow and see if I get something :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version