Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2
« previous next »
  • Print
Pages: 1 ... 93 94 [95] 96 97 ... 129

Author Topic: SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2  (Read 1337450 times)

Offline ranma

  • Developer
  • Member
  • *
  • Posts: 31
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1410 on: February 11, 2010, 11:38:57 AM »
Quote from: funman on February 11, 2010, 09:37:29 AM
So the problem is the USB check gives a false positive ?

What happens if you power it with the USB cable ?

Some c200v2 might need something more to enable the backlight, just like what happened on the Clipv1

As said on irc, if I shine a bright flashlight on the display I can see that it's just the backlight that is not powered.
New info:
If I put an infinite loop into the as3525 reboot function, it stops at the 'usb inserted' logo, so that seems to be the point where it reboots. (USB is not attached at this point)
If I change usb_detect to always return USB_EXTRACTED it does not reboot and I can navigate the menu!
And it mp3 playback works on a first quick test. It even changed over to the next mp3 (now on the third one).
Now if only the backlight would work...
Maybe the GPIOs are different on this one? Since both USB_DETECT and BACKLIGHT don't work?

[edit]
Ok, I've got it.  On my c200v2 backlight is controlled by A7 instead of A5.
I now have working backlight.
Also interesting:
Even though I've disabled the USB detection it reacts to USB plug/unplug as if a button was pressed.
i.e. the buttonlight goes on and display is switched on if it was off.
[/edit]
[edit3]
Ok, I've now found out that the reaction to USB plug/unplug is due to the SYS_CHARGER_CONNECTED and SYS_CHARGER_DISCONNECTED events.
[/edit3]

[edit2]
Here are modified binaries if someone wants to try (on his own risk!):
http://uguu.de/~ranma/rockbox-c200v2/
Index: firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
===================================================================
--- firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c   (revision 24590)
+++ firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c   (working copy)
@@ -30,7 +30,7 @@
 
 bool _backlight_init(void)
 {
-    GPIOA_DIR |= 1<<5;
+    GPIOA_DIR |= 1<<7;
     return true;
 }
 
@@ -47,12 +47,12 @@
 #ifdef HAVE_LCD_ENABLE
     lcd_enable(true); /* power on lcd + visible display */
 #endif
-    GPIOA_PIN(5) = 1<<5;
+    GPIOA_PIN(7) = 1<<7;
 }
 
 void _backlight_off(void)
 {
-    GPIOA_PIN(5) = 0;
+    GPIOA_PIN(7) = 0;
 #ifdef HAVE_LCD_ENABLE
     lcd_enable(false); /* power off visible display */
 #endif

Index: firmware/target/arm/as3525/usb-as3525.c
===================================================================
--- firmware/target/arm/as3525/usb-as3525.c   (revision 24590)
+++ firmware/target/arm/as3525/usb-as3525.c   (working copy)
@@ -61,9 +61,11 @@
 int usb_detect(void)
 {
 #ifdef USB_DETECT_PIN
+   /*
     if (GPIOA_PIN( USB_DETECT_PIN ))
         return USB_INSERTED;
     else
+    */
 #endif
         return USB_EXTRACTED;
 }
[/edit2]
« Last Edit: February 12, 2010, 05:57:51 AM by ranma »
Logged

Offline bertrik

  • Developer
  • Member
  • *
  • Posts: 171
    • Homepage Bertrik Sikken
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1411 on: February 11, 2010, 03:43:42 PM »
Regarding the power consumption issue: I asked jobec to check the contents of the SYSTEM and CVDD registers on his power-hungry clip v1. They were exactly the same as on my clip (SYSTEM=0x29 -> PVDD trimmed to 17/18 and CVDD=0x04 -> completely normal). So that doesn't explain anything, although it is slightly peculiar that PVDD is trimmed down a bit by default. We didn't check the USB_UTIL register yet though, it could still be that we're accidentally wasting power somehow on USB.
Logged
Meizu M6SP, Samsung YP-S3, iPod nano 1g, Sansa c200, Sansa e200, Sansa Clip, Sansa Clip+, Sansa Clip Zip
 

Offline mtee

  • Developer
  • Member
  • *
  • Posts: 9
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1412 on: February 11, 2010, 04:07:45 PM »
Hi FlynDice,

I've been trying a little bit with the clip+ port, and I think I bricked mine. :(
I built a bootloader -> scrambled -> mkamsboot -> copied the binary image to the device's storage, then after a successful firmware upgrade, it went dead. Since it worked for you, then I'm sure I've missed something in the middle.
Anyway, I'll probably buy another one later, but until then, I'll try to help with other stuff.
Logged

Offline FlynDice

  • Developer
  • Member
  • *
  • Posts: 166
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1413 on: February 11, 2010, 06:12:45 PM »
@ mtee:

Before you call it bricked try holding the pwr button for 10 sec straight to try to reset.  Did you get a branch to the of with left or home pressed?  As of now if you let it boot to the rockbox code the clip+ shows absolutely no response and appears bricked, but will reset with an extra long pwr press.
Logged
e280v2    fuzev1 2gb   clip+4gb   8GB Transcend cl6 uSD    access to fuzev2 4GB       clip+2gb R.I.P.

Offline mtee

  • Developer
  • Member
  • *
  • Posts: 9
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1414 on: February 11, 2010, 06:42:37 PM »
Quote from: FlynDice on February 11, 2010, 06:12:45 PM
@ mtee:

Before you call it bricked try holding the pwr button for 10 sec straight to try to reset. 

Tried that once I did the firmware replacement, but the device still didn't work.
Logged

Offline ranma

  • Developer
  • Member
  • *
  • Posts: 31
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1415 on: February 12, 2010, 04:43:22 AM »
Battery bench on my c240v2:

Quote
Battery bench run for Sandisk Sansa c200v2 series version

Battery type: -352317087 mAh      Buffer Entries: 1000
  Time:,  Seconds:,  Level:,  Time Left:,  Voltage[mV]:, C:, S:, U:
00:02:15,  00135,     000%,     00:01,         4960,     A,  -,  -
00:03:15,  00195,     000%,     00:01,         5024,     A,  -,  -
00:04:15,  00255,     000%,     00:01,         5024,     A,  -,  -
00:05:15,  00315,     000%,     00:01,         5024,     A,  -,  -
00:06:15,  00375,     000%,     00:01,         4960,     A,  -,  -
00:07:15,  00435,     000%,     00:01,         4960,     A,  -,  -
00:08:15,  00495,     000%,     00:01,         4960,     A,  -,  -
00:09:15,  00555,     000%,     00:01,         4960,     A,  -,  -
00:10:15,  00615,     000%,     00:01,         4897,     A,  -,  -
00:11:15,  00675,     000%,     00:01,         4897,     A,  -,  -
00:12:15,  00735,     000%,     00:01,         4897,     A,  -,  -
00:13:15,  00795,     000%,     00:01,         4833,     A,  -,  -
00:14:15,  00855,     000%,     00:01,         4833,     A,  -,  -
00:15:15,  00915,     000%,     00:01,         4833,     A,  -,  -
00:16:16,  00976,     000%,     00:01,         4833,     A,  -,  -
00:17:16,  01036,     000%,     00:01,         4770,     A,  -,  -
00:18:16,  01096,     000%,     00:01,         4770,     A,  -,  -
00:19:16,  01156,     000%,     00:01,         4770,     A,  -,  -
00:20:16,  01216,     000%,     00:01,         4770,     A,  -,  -
00:21:16,  01276,     000%,     00:01,         4738,     A,  -,  -
00:22:16,  01336,     000%,     00:01,         4706,     A,  -,  -
00:23:16,  01396,     000%,     00:01,         4706,     A,  -,  -
00:24:16,  01456,     000%,     00:01,         4706,     A,  -,  -
00:25:16,  01516,     000%,     00:01,         4706,     A,  -,  -
00:26:16,  01576,     000%,     00:01,         4642,     A,  -,  -
00:27:16,  01636,     000%,     00:01,         4642,     A,  -,  -
00:28:16,  01696,     000%,     00:01,         4642,     A,  -,  -
00:29:16,  01756,     000%,     00:01,         4642,     A,  -,  -
00:30:16,  01816,     000%,     00:01,         4642,     A,  -,  -
00:31:16,  01876,     000%,     00:01,         4579,     A,  -,  -
00:32:16,  01936,     000%,     00:01,         4579,     A,  -,  -
00:33:16,  01996,     000%,     00:01,         4579,     A,  -,  -
00:34:16,  02056,     000%,     00:01,         4579,     A,  -,  -
00:35:16,  02116,     000%,     00:01,         4579,     A,  -,  -
00:36:16,  02176,     000%,     00:01,         4579,     A,  -,  -
00:37:16,  02236,     000%,     00:01,         4579,     A,  -,  -
00:38:16,  02296,     000%,     00:01,         4515,     A,  -,  -
00:39:16,  02356,     000%,     00:01,         4515,     A,  -,  -
00:40:16,  02416,     000%,     00:01,         4515,     A,  -,  -
00:41:16,  02476,     000%,     00:01,         4515,     A,  -,  -
00:42:16,  02536,     000%,     00:01,         4515,     A,  -,  -
00:43:17,  02597,     000%,     00:01,         4515,     A,  -,  -
00:44:17,  02657,     000%,     00:01,         4515,     A,  -,  -
00:45:17,  02717,     000%,     00:01,         4452,     A,  -,  -
00:46:17,  02777,     000%,     00:01,         4388,     A,  -,  -
00:47:17,  02837,     000%,     00:01,         4452,     A,  -,  -
00:48:17,  02897,     000%,     00:01,         4452,     A,  -,  -
00:49:17,  02957,     000%,     00:01,         4452,     A,  -,  -
00:50:17,  03017,     000%,     00:01,         4452,     A,  -,  -
00:51:17,  03077,     000%,     00:01,         4452,     A,  -,  -
00:52:17,  03137,     000%,     00:01,         4452,     A,  -,  -
00:53:17,  03197,     000%,     00:01,         4388,     A,  -,  -
00:54:17,  03257,     000%,     00:01,         4388,     A,  -,  -
00:55:17,  03317,     000%,     00:01,         4388,     A,  -,  -
00:56:17,  03377,     000%,     00:01,         4388,     A,  -,  -
00:57:17,  03437,     000%,     00:01,         4388,     A,  -,  -
00:58:17,  03497,     000%,     00:01,         4324,     A,  -,  -
00:59:17,  03557,     000%,     00:01,         4324,     A,  -,  -
01:00:17,  03617,     000%,     00:01,         4324,     A,  -,  -
01:01:17,  03677,     000%,     00:01,         4324,     A,  -,  -
01:02:17,  03737,     000%,     00:01,         4324,     A,  -,  -
01:03:17,  03797,     000%,     00:01,         4324,     A,  -,  -
01:04:17,  03857,     000%,     00:01,         4324,     A,  -,  -
01:05:17,  03917,     000%,     00:01,         4261,     A,  -,  -
01:06:17,  03977,     000%,     00:01,         4261,     A,  -,  -
01:07:17,  04037,     000%,     00:01,         4261,     A,  -,  -
01:08:17,  04097,     000%,     00:01,         4261,     A,  -,  -
01:09:17,  04157,     000%,     00:01,         4261,     A,  -,  -
01:10:18,  04218,     000%,     00:01,         4261,     A,  -,  -
01:11:18,  04278,     000%,     00:01,         4261,     A,  -,  -
01:12:18,  04338,     000%,     00:01,         4261,     A,  -,  -
01:13:18,  04398,     000%,     00:01,         4261,     A,  -,  -
01:14:18,  04458,     000%,     00:01,         4197,     A,  -,  -
01:15:18,  04518,     000%,     00:01,         4197,     A,  -,  -
01:16:18,  04578,     000%,     00:01,         4197,     A,  -,  -
01:17:18,  04638,     000%,     00:01,         4197,     A,  -,  -
01:18:18,  04698,     000%,     00:01,         4197,     A,  -,  -
01:19:18,  04758,     000%,     00:01,         4134,     A,  -,  -
01:20:18,  04818,     000%,     00:01,         4134,     A,  -,  -
01:21:18,  04878,     000%,     00:01,         4134,     A,  -,  -
01:22:18,  04938,     000%,     00:01,         4070,     A,  -,  -
01:23:18,  04998,     000%,     00:01,         4134,     A,  -,  -
01:24:18,  05058,     000%,     00:01,         4134,     A,  -,  -
01:25:18,  05118,     000%,     00:01,         4070,     A,  -,  -
01:26:18,  05178,     000%,     00:01,         4070,     A,  -,  -
01:27:18,  05238,     000%,     00:01,         4070,     A,  -,  -
01:28:18,  05298,     000%,     00:01,         4006,     A,  -,  -
01:29:18,  05358,     000%,     00:01,         4006,     A,  -,  -
01:30:18,  05418,     000%,     00:01,         4006,     A,  -,  -
01:31:18,  05478,     000%,     00:01,         4006,     A,  -,  -
01:32:18,  05538,     000%,     00:01,         3943,     A,  -,  -
01:33:18,  05598,     000%,     00:01,         3943,     A,  -,  -
01:34:18,  05658,     000%,     00:01,         3752,     A,  -,  -
01:35:18,  05718,     000%,     00:01,         3879,     A,  -,  -
01:36:18,  05778,     000%,     00:01,         3879,     A,  -,  -
01:37:18,  05838,     000%,     00:01,         3879,     A,  -,  -
01:38:19,  05899,     000%,     00:01,         3816,     A,  -,  -
01:39:19,  05959,     000%,     00:01,         3816,     A,  -,  -
01:40:19,  06019,     000%,     00:01,         3816,     A,  -,  -
01:41:19,  06079,     000%,     00:01,         3816,     A,  -,  -
01:42:19,  06139,     000%,     00:01,         3752,     A,  -,  -
01:43:19,  06199,     000%,     00:01,         3752,     A,  -,  -
01:44:19,  06259,     000%,     00:01,         3752,     A,  -,  -
01:45:19,  06319,     000%,     00:01,         3688,     A,  -,  -
01:46:19,  06379,     000%,     00:01,         3688,     A,  -,  -
01:47:19,  06439,     000%,     00:01,         3688,     A,  -,  -
01:48:19,  06499,     000%,     00:01,         3688,     A,  -,  -
01:49:19,  06559,     000%,     00:01,         3625,     A,  -,  -
01:50:19,  06619,     000%,     00:01,         3625,     A,  -,  -
01:51:19,  06679,     000%,     00:01,         3625,     A,  -,  -
01:52:19,  06739,     000%,     00:01,         3625,     A,  -,  -
01:53:19,  06799,     000%,     00:01,         3561,     A,  -,  -
01:54:19,  06859,     000%,     00:01,         3561,     A,  -,  -
01:55:19,  06919,     000%,     00:01,         3561,     A,  -,  -
01:56:19,  06979,     000%,     00:01,         3561,     A,  -,  -
01:57:19,  07039,     000%,     00:01,         3561,     A,  -,  -
01:58:19,  07099,     000%,     00:01,         3561,     A,  -,  -
01:59:19,  07159,     000%,     00:01,         3561,     A,  -,  -
02:00:19,  07219,     000%,     00:01,         3498,     A,  -,  -
02:01:19,  07279,     000%,     00:01,         3498,     A,  -,  -
02:02:19,  07339,     000%,     00:01,         3561,     A,  -,  -
02:03:19,  07399,     000%,     00:01,         3498,     A,  -,  -
02:04:19,  07459,     000%,     00:01,         3498,     A,  -,  -
02:05:20,  07520,     000%,     00:01,         3498,     A,  -,  -
02:06:20,  07580,     000%,     00:01,         3498,     A,  -,  -
02:07:20,  07640,     000%,     00:01,         3434,     A,  -,  -
02:08:20,  07700,     000%,     00:01,         3434,     A,  -,  -
02:09:20,  07760,     000%,     00:01,         3434,     A,  -,  -
02:10:20,  07820,     000%,     00:01,         3498,     A,  -,  -
02:11:20,  07880,     000%,     00:01,         3498,     A,  -,  -
02:12:20,  07940,     000%,     00:01,         3434,     A,  -,  -
02:13:20,  08000,     000%,     00:01,         3434,     A,  -,  -
02:14:20,  08060,     000%,     00:01,         3434,     A,  -,  -
02:15:20,  08120,     000%,     00:01,         3434,     A,  -,  -
02:16:20,  08180,     000%,     00:01,         3434,     A,  -,  -
02:17:20,  08240,     000%,     00:01,         3434,     A,  -,  -
02:18:20,  08300,     000%,     00:01,         3434,     A,  -,  -
02:19:20,  08360,     000%,     00:01,         3434,     A,  -,  -
02:20:20,  08420,     000%,     00:01,         3434,     A,  -,  -
02:21:20,  08480,     000%,     00:01,         3434,     A,  -,  -
02:22:20,  08540,     000%,     00:01,         3434,     A,  -,  -
02:23:20,  08600,     000%,     00:01,         3434,     A,  -,  -
02:24:20,  08660,     000%,     00:01,         3434,     A,  -,  -
02:25:20,  08720,     000%,     00:01,         3370,     A,  -,  -
02:26:20,  08780,     000%,     00:01,         3307,     A,  -,  -
02:27:20,  08840,     000%,     00:01,         3370,     A,  -,  -
02:28:20,  08900,     000%,     00:01,         3370,     A,  -,  -
02:29:20,  08960,     000%,     00:01,         3307,     A,  -,  -
02:30:20,  09020,     000%,     00:01,         3307,     A,  -,  -
02:31:20,  09080,     000%,     00:01,         3307,     A,  -,  -
02:32:20,  09140,     000%,     00:01,         3307,     A,  -,  -
02:33:21,  09201,     000%,     00:01,         3243,     A,  -,  -
02:34:21,  09261,     000%,     00:01,         3243,     A,  -,  -
02:35:21,  09321,     000%,     00:01,         3243,     A,  -,  -
02:36:21,  09381,     000%,     00:01,         3243,     A,  -,  -
02:36:48,  09408,     000%,     00:01,         3211,     A,  -,  -
02:37:48,  09468,     000%,     00:01,         3243,     A,  -,  -
02:38:48,  09528,     000%,     00:01,         3243,     A,  -,  -
02:39:48,  09588,     000%,     00:01,         3180,     A,  -,  -
02:40:48,  09648,     000%,     00:01,         3180,     A,  -,  -
02:41:48,  09708,     000%,     00:01,         3180,     A,  -,  -
02:42:49,  09769,     000%,     00:01,         3180,     A,  -,  -
02:43:49,  09829,     000%,     00:01,         3180,     A,  -,  -
02:44:49,  09889,     000%,     00:01,         3180,     A,  -,  -
02:45:49,  09949,     000%,     00:01,         3180,     A,  -,  -
02:46:49,  10009,     000%,     00:01,         3180,     A,  -,  -
02:47:49,  10069,     000%,     00:01,         3148,     A,  -,  -
02:48:49,  10129,     000%,     00:01,         3180,     A,  -,  -
02:49:49,  10189,     000%,     00:01,         3180,     A,  -,  -
02:50:49,  10249,     000%,     00:01,         3116,     A,  -,  -
02:51:49,  10309,     000%,     00:01,         3180,     A,  -,  -
02:52:49,  10369,     000%,     00:01,         3116,     A,  -,  -
02:53:49,  10429,     000%,     00:01,         3116,     A,  -,  -
02:54:49,  10489,     000%,     00:01,         3180,     A,  -,  -
02:55:49,  10549,     000%,     00:01,         3180,     A,  -,  -
02:56:49,  10609,     000%,     00:01,         3116,     A,  -,  -
02:57:49,  10669,     000%,     00:01,         3116,     A,  -,  -
02:58:49,  10729,     000%,     00:01,         3116,     A,  -,  -
02:59:49,  10789,     000%,     00:01,         3084,     A,  -,  -
03:00:49,  10849,     000%,     00:01,         3116,     A,  -,  -
03:01:49,  10909,     000%,     00:01,         3052,     A,  -,  -
03:02:49,  10969,     000%,     00:01,         3052,     A,  -,  -
03:03:49,  11029,     000%,     00:01,         3052,     A,  -,  -
03:04:49,  11089,     000%,     00:01,         2989,     A,  -,  -
03:05:49,  11149,     000%,     00:01,         2989,     A,  -,  -
03:06:49,  11209,     000%,     00:01,         2925,     A,  -,  -
03:07:49,  11269,     000%,     00:01,         2925,     A,  -,  -
03:08:50,  11330,     000%,     00:01,         2862,     A,  -,  -
03:09:50,  11390,     000%,     00:01,         2830,     A,  -,  -
03:10:50,  11450,     000%,     00:01,         2798,     A,  -,  -
03:11:50,  11510,     000%,     00:01,         2798,     A,  -,  -
03:12:50,  11570,     000%,     00:01,         2798,     A,  -,  -
03:13:50,  11630,     000%,     00:01,         2766,     A,  -,  -
03:14:50,  11690,     000%,     00:01,         2734,     A,  -,  -
03:15:50,  11750,     000%,     00:01,         2734,     A,  -,  -
03:16:50,  11810,     000%,     00:01,         2734,     A,  -,  -
03:17:50,  11870,     000%,     00:01,         2734,     A,  -,  -
03:18:50,  11930,     000%,     00:01,         2734,     A,  -,  -
03:19:50,  11990,     000%,     00:01,         2734,     A,  -,  -
03:20:50,  12050,     000%,     00:01,         2671,     A,  -,  -
03:21:43,  12103,     000%,     00:01,         2385,     A,  -,  -
03:21:43,  12103,     000%,     00:01,         2353,     A,  -,  -
03:22:19,  12139,     000%,     00:01,         2226,     A,  -,  -
03:22:20,  12140,     000%,     00:01,         2226,     A,  -,  -
03:23:20,  12200,     000%,     00:01,         2289,     A,  -,  -
03:24:20,  12260,     000%,     00:01,         2544,     A,  -,  -
03:25:20,  12320,     000%,     00:01,         2544,     A,  -,  -
03:26:20,  12380,     000%,     00:01,         2544,     A,  -,  -
03:27:20,  12440,     000%,     00:01,         2544,     A,  -,  -
03:28:20,  12500,     000%,     00:01,         2544,     A,  -,  -
03:29:20,  12560,     000%,     00:01,         2544,     A,  -,  -
03:30:20,  12620,     000%,     00:01,         2544,     A,  -,  -
03:31:20,  12680,     000%,     00:01,         2544,     A,  -,  -
03:32:20,  12740,     000%,     00:01,         2480,     A,  -,  -
03:33:20,  12800,     000%,     00:01,         2544,     A,  -,  -
03:34:20,  12860,     000%,     00:01,         2544,     A,  -,  -
03:35:20,  12920,     000%,     00:01,         2480,     A,  -,  -
03:36:20,  12980,     000%,     00:01,         2480,     A,  -,  -
03:37:20,  13040,     000%,     00:01,         2480,     A,  -,  -
03:38:20,  13100,     000%,     00:01,         2480,     A,  -,  -
03:39:20,  13160,     000%,     00:01,         2353,     A,  -,  -
03:40:20,  13220,     000%,     00:01,         2416,     A,  -,  -
03:41:20,  13280,     000%,     00:01,         2353,     A,  -,  -
03:42:20,  13340,     000%,     00:01,         2353,     A,  -,  -
03:43:20,  13400,     000%,     00:01,         2289,     A,  -,  -
03:44:20,  13460,     000%,     00:01,         2289,     A,  -,  -
03:45:20,  13520,     000%,     00:01,         2289,     A,  -,  -
03:46:20,  13580,     000%,     00:01,         2226,     A,  -,  -
03:47:20,  13640,     000%,     00:01,         2226,     A,  -,  -
03:48:20,  13700,     000%,     00:01,         2162,     A,  -,  -
03:49:20,  13760,     000%,     00:01,         2162,     A,  -,  -
03:50:20,  13820,     000%,     00:01,         2035,     A,  -,  -
03:50:24,  13824,     000%,     00:01,         1939,     A,  -,  -
03:51:24,  13884,     000%,     00:01,         2035,     A,  -,  -
03:52:24,  13944,     000%,     00:01,         2098,     A,  -,  -
03:53:24,  14004,     000%,     00:01,         2098,     A,  -,  -
03:54:24,  14064,     000%,     00:01,         2098,     A,  -,  -
03:55:24,  14124,     000%,     00:01,         2098,     A,  -,  -
03:56:24,  14184,     000%,     00:01,         2067,     A,  -,  -
03:57:24,  14244,     000%,     00:01,         2035,     A,  -,  -
03:58:24,  14304,     000%,     00:01,         2035,     A,  -,  -
03:59:24,  14364,     000%,     00:01,         2035,     A,  -,  -
04:00:24,  14424,     000%,     00:01,         2035,     A,  -,  -
04:01:24,  14484,     000%,     00:01,         2035,     A,  -,  -
04:02:24,  14544,     000%,     00:01,         2035,     A,  -,  -
04:03:24,  14604,     000%,     00:01,         1971,     A,  -,  -
04:04:24,  14664,     000%,     00:01,         1971,     A,  -,  -
04:05:24,  14724,     000%,     00:01,         1971,     A,  -,  -
04:06:24,  14784,     000%,     00:01,         1908,     A,  -,  -
04:07:24,  14844,     000%,     00:01,         1908,     A,  -,  -
04:08:24,  14904,     000%,     00:01,         1908,     A,  -,  -
04:09:24,  14964,     000%,     00:01,         1908,     A,  -,  -
04:10:24,  15024,     000%,     00:01,         1908,     A,  -,  -
04:11:25,  15085,     000%,     00:01,         1908,     A,  -,  -
04:12:25,  15145,     000%,     00:01,         1908,     A,  -,  -
04:13:25,  15205,     000%,     00:01,         1908,     A,  -,  -
04:14:25,  15265,     000%,     00:01,         1908,     A,  -,  -
04:15:25,  15325,     000%,     00:01,         1908,     A,  -,  -
04:16:25,  15385,     000%,     00:01,         1908,     A,  -,  -
04:17:25,  15445,     000%,     00:01,         1844,     A,  -,  -
Logged

Offline funman

  • Developer
  • Member
  • *
  • Posts: 645
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1416 on: February 12, 2010, 07:38:23 AM »
Quote from: ranma on February 11, 2010, 11:38:57 AM
Ok, I've got it.  On my c200v2 backlight is controlled by A7 instead of A5.
I now have working backlight.
Also interesting:
Even though I've disabled the USB detection it reacts to USB plug/unplug as if a button was pressed.
i.e. the buttonlight goes on and display is switched on if it was off.

bertrik can you test if setting both A5 & A7 has any incidence ?

Quote from: ranma on February 11, 2010, 11:38:57 AM
Ok, I've now found out that the reaction to USB plug/unplug is due to the SYS_CHARGER_CONNECTED and SYS_CHARGER_DISCONNECTED events.

Can you see if a GPIO pin is changed when inserting USB (in debug menu > view ports) ?
Logged
a wise man said: "a wise man said"

Offline ranma

  • Developer
  • Member
  • *
  • Posts: 31
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1417 on: February 12, 2010, 09:09:24 AM »
Quote from: funman on February 12, 2010, 07:38:23 AM
Quote from: ranma on February 11, 2010, 11:38:57 AM
Ok, I've now found out that the reaction to USB plug/unplug is due to the SYS_CHARGER_CONNECTED and SYS_CHARGER_DISCONNECTED events.

Can you see if a GPIO pin is changed when inserting USB (in debug menu > view ports) ?

I checked that, unfortunately I don't see any change on the ports if I plug in USB.
Neither on GPIO nor on DBOP_DIN.

[edit]
I had a look at the AS3525 datasheet. There is the AS3514 IRQ_ENRD_0 register, which is already used to check for the charger status (bit 5) and it provides usb status (bit 3).

I added IRQ_ENRD_0 readout to the GPIO debug function and indeed it changes from 0x00 to 0x28
when i plug in USB (charger connected, usb connected). Maybe that could be used instead of GPIO?
[/edit]

[edit2]
BTW I checked DCDC15, it doesn't affect brightness.
The way the OF behaves it looks like it's doing PWM in software for the brightness controls.
If I wave my Sansa, on the brightest settings I see a continuous light,
on the lowest settings it looks like 50% duty cycle, on medium setting more like 75%.
I've pimped the GPIO debug screen to include more stuff I was interested in:
ADC values (BVDD, VRTC, UVDD, CHGI, VBE1, VBE2, BTMP, CVDD), DCDC15 (to doublecheck that was really set by my modified brightness setting function), IENRD0 and CHARGER registers of AS3514.
[/edit2]

[edit3]
With this usb detection within booted rockbox works for me (using as3514 to read usb state and a seperate thread since usb_detect is called from the timer tick). Possibly the thread should sleep less long since usb.c also debounces the usb_detect value AFAICS.
[edit4]
Well, the as3525 is debouncing this one in hardware so it should be okay
[/edit4]
Code: [Select]
Index: usb-as3525.c
===================================================================
--- usb-as3525.c (revision 24590)
+++ usb-as3525.c (working copy)
@@ -28,6 +28,8 @@
 #include "usb-target.h"
 #include "power.h"
 #include "as3525.h"
+#include "ascodec.h"
+#include "thread.h"
 
 #if defined(SANSA_CLIP)
 #define USB_DETECT_PIN 6
@@ -39,6 +41,11 @@
 #define USB_DETECT_PIN 1
 #endif
 
+static long detect_stack[DEFAULT_STACK_SIZE/sizeof(long)];
+static const char detect_thread_name[] = "usbdetect";
+static unsigned int detect_thread_entry = 0;
+static int detect_state = USB_EXTRACTED;
+
 void usb_enable(bool on)
 {
 #ifdef HAVE_USBSTACK
@@ -51,19 +58,26 @@
 #endif
 }
 
+static void detect_thread(void)
+{
+    while(1)
+    {
+        if (ascodec_read(AS3514_IRQ_ENRD0) & (1<<3))
+            detect_state = USB_INSERTED;
+        else
+            detect_state = USB_EXTRACTED;
+        sleep(HZ/10);
+    }
+}
+
 void usb_init_device(void)
 {
-#ifdef USB_DETECT_PIN
-    GPIOA_DIR &= ~(1 << USB_DETECT_PIN); /* set as input */
-#endif
+    detect_thread_entry = create_thread(detect_thread, detect_stack,
+                          sizeof(detect_stack), 0, detect_thread_name
+                          IF_PRIO(, PRIORITY_SYSTEM) IF_COP(, CPU));
 }
 
 int usb_detect(void)
 {
-#ifdef USB_DETECT_PIN
-    if (GPIOA_PIN( USB_DETECT_PIN ))
-        return USB_INSERTED;
-    else
-#endif
-        return USB_EXTRACTED;
+    return detect_state;
 }
[/edit3]
« Last Edit: February 13, 2010, 10:38:13 AM by ranma »
Logged

Offline FlynDice

  • Developer
  • Member
  • *
  • Posts: 166
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1418 on: February 12, 2010, 02:18:16 PM »
Well I hope it's not just because I'm lucky that myclip+ is still breathing but let me at least document here what I did with it.

I've got a 2Gb clip+.
When I got it I plugged in USB and let it charge until the battery was full.
Then I turned it on and checked out the OF for a bit then turned it off.
Then I upgraded the OF with clppa.bin dated 16 December 2009, 20:37 from clipplus01.02.09.zip
Then I turned it on and checked out the new OF for a bit then turned it off again.
I modified mkamsboot.c so that clip+ would work and patched the firmware.
I did have a bit of a problem here that you can read from posts a few pages back including pastie diffs  http://forums.rockbox.org/index.php?topic=14064.msg161589#msg161589.
Once I figured things out I made a correctly patched firmware with svn dualboot.S(~.5 sec delay) and loaded it successfully.
Hard to see a .5 sec delay so I made it a 6 second delay, patched & loaded succesfully.
I then started testing buttons with this code: http://pastie.org/822205     with results shown in the .pdf attached to this post:   http://forums.rockbox.org/index.php?topic=14064.msg161676#msg161676
At this point I attempted to see I f I could make dualboot work by simply reading C3(left button), if high immediate branch to OF, if not 6 sec delay and it worked.
I then used this as my "escape hatch" for testing more code that involves setting B0 etc.

I have successfully dualbooted with the current code over 50 times while checking for delays trying to read registers one bit at a time....

My hope is someone can spot something different here that may be significant.
Logged
e280v2    fuzev1 2gb   clip+4gb   8GB Transcend cl6 uSD    access to fuzev2 4GB       clip+2gb R.I.P.

Offline funman

  • Developer
  • Member
  • *
  • Posts: 645
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1419 on: February 12, 2010, 03:28:20 PM »
mt do you still have the clppa.bin you copied on your clip+ ?

btw the delay to power off is longer on Clipv2/+ than Clipv1 and closer to 15/20 seconds.

If you're sure it is dead, could you open it and try the e200v2 recovery trick ?
Logged
a wise man said: "a wise man said"

Offline FlynDice

  • Developer
  • Member
  • *
  • Posts: 166
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1420 on: February 13, 2010, 05:05:16 AM »
@funman:

I think the GPIOB(0) only needs to be set in order to read D6 (power).  Here's my commented disassembly: http://pastie.org/823431.

The OF appears to set B0, read D6, unset B0, read the rest of the pins & set flags in r0 if pin is set,  and finally reads pin D6 again only if it was set from the first read.  I guess this is the way to detect the long press.  I've not quite finished but the rest appears to be simply shifting the flags around to frame the return.  And of course there could be another gotcha in another section of code....

Comments welcomed as usual!

EDIT:  Updated disassembly pastie
EDIT2:  Updated disassembly pastie

EDIT3:  It appears the OF returns from the button reads without resetting GPIOB_DIR(0) or GPIOB_DIR(6)to input.

I also just noticed at 7a54 sets pin B6 to output (but doesn't set the pin) before the second D6 button read.
« Last Edit: February 13, 2010, 12:26:19 PM by FlynDice »
Logged
e280v2    fuzev1 2gb   clip+4gb   8GB Transcend cl6 uSD    access to fuzev2 4GB       clip+2gb R.I.P.

Offline ranma

  • Developer
  • Member
  • *
  • Posts: 31
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1421 on: February 13, 2010, 07:37:41 AM »
Damn, I bricked my C240v2 while playing with dualboot.S...
dualboot.S is not at fault, but rather I forgot to copy dualboot.h in addition to dualboot.c and so mkamsboot copied only part of dualboot into the new firmware. :P
I tried shorting the flash so it'll boot the 'USB boot promer', which makes it show up on usb.
However it reports lun 0 as a single 512 byte sector (Sense Key : Medium Error, Add. Sense: Recorded entity not found) and lun 1 as 'not present', so doesn't help.

[edit3]
FWIW, this is my dualboot.S modification, trying to use the audio master i2c to read irq_enrd0 for usb status... Doesn't work, but should have let me recover because it's after the normal button check.

Code: [Select]
Index: rbutil/mkamsboot/dualboot/dualboot.S
===================================================================
--- rbutil/mkamsboot/dualboot/dualboot.S (revision 24590)
+++ rbutil/mkamsboot/dualboot/dualboot.S (working copy)
@@ -28,11 +28,12 @@
 #endif
 
 /* AS3525 hardware registers */
-.set GPIOA,     0xC80B0000
-.set GPIOB,     0xC80C0000
-.set GPIOC,     0xC80D0000
-.set GPIOD,     0xC80E0000
-.set CGU_PERI,  0xC80F0014
+.set GPIOA,          0xC80B0000
+.set GPIOB,          0xC80C0000
+.set GPIOC,          0xC80D0000
+.set GPIOD,          0xC80E0000
+.set CGU_PERI,       0xC80F0014
+.set I2C_AUDIO_BASE, 0xC8070000
 
 
 /* Vectors */
@@ -93,12 +94,14 @@
 #endif
 
 #ifdef USB_PIN  /* TODO : remove this check when we'll have an USB driver */
+/*
         ldr     r0, =GPIOA
         mov     r1, #0
         str     r1, [r0, #0x400]
         ldr     r1, [r0, #(4*(1<<USB_PIN))]
         cmp     r1, #0
         bne     boot_of
+*/
 #endif
 
         /* Here are model specific tests, for dual boot without a computer */
@@ -186,15 +189,18 @@
         cmp     r2, #0              @ test input from pins
         bne     boot_of             @ branch directly to OF if either pin high
 #elif defined(SANSA_C200V2)
-        /* check for RIGHT on C6, should changed to LEFT as soon as it
-         * known in which pin that is in order for consistency  */
+        /* check for LEFT or RIGHT on C6 */
         ldr     r0, =GPIOC
         mov     r1, #0
-        str     r1, [r0, #0x400]      /* set pin to output */
+        str     r1, [r0, #0x400]      /* set all GPIOC to input */
 
         ldr     r1, [r0, #256]        /* 1<<(6+2) */
-        cmp     r1, #0                /* C6 low means button pressed */
+        cmp     r1, #0                /* C6 low means r-button pressed */
         beq     boot_of
+
+//        ldr     r1, [r0, #16]         /* 1<<(2+2) */
+//        cmp     r1, #0                /* C2 low means l-button pressed */
+//        beq     boot_of
 #elif defined(SANSA_M200V4)
 .set row, (1<<5) /* enable output on A5 */
 .set col, (1<<0) /* read keyscan column A0 */
@@ -213,7 +219,59 @@
         #error No target-specific key check defined!
 #endif
 
+        /* enable i2c audio master clock */
+        ldr     r0, =CGU_PERI
+        ldr     r1, [r0]
+        orr     r1, r1, #(1<<17)
+        str     r1, [r0]
 
+.set pclk, 62000000
+.set i2c_clk, 400000
+.set i2c_prescaler, ((pclk + i2c_clk -1) / i2c_clk)
+.set I2C2_DATA,  0x00
+.set I2C2_SLAD0, 0x04
+.set I2C2_CNTRL, 0x0c
+.set I2C2_DACNT, 0x10
+.set I2C2_CPSR0, 0x1c
+.set I2C2_CPSR1, 0x20
+.set I2C2_SR,    0x30
+.set I2C2_SADDR, 0x44
+.set AS3514_I2C_ADDR, 0x46
+.set AS3514_IRQ_ENRD0, 0x25
+        ldr     r0, =I2C_AUDIO_BASE
+        /* setup prescaler */
+        ldr     r1, =i2c_prescaler
+        str     r1, [r0, #I2C2_CPSR0]
+        mov     r1, r1, lsr #8
+        str     r1, [r0, #I2C2_CPSR1]
+        /* setup i2c slave address */
+        mov     r1, #(AS3514_I2C_ADDR << 1)
+        str     r1, [r0, #I2C2_SLAD0]
+        mov     r2, #0x51
+        str     r2, [r0, #I2C2_CNTRL]
+
+        /* wait for not busy */
+i2c_busywait:
+        ldr     r1, [r0, #I2C2_SR]
+        tst     r1, #1
+        bne i2c_busywait
+
+        /* read irq_enrd0 */
+        mov     r1, #AS3514_IRQ_ENRD0
+        str     r1, [r0, #I2C2_SADDR]
+        orr     r2, r2, #(1 << 1)
+        str     r2, [r0, #I2C2_CNTRL]
+        mov     r1, #1
+        str     r1, [r0, #I2C2_DACNT]
+i2c_wait:
+        ldr     r1, [r0, #I2C2_DACNT]
+        cmp     r1, #0
+        bne     i2c_wait
+
+        ldr     r1, [r0, #I2C2_DATA]
+        tst     r1, #(1 << 3)
+        bne     boot_of
+
         /* The dualboot button was not held, so we boot rockbox */
         ldr     r0, ucl_rb_end      /* Address of compressed image */
         ldr     r1, ucl_rb_size     /* Compressed size */
[/edit3]

[edit]
I hereby request this small change that would have protected me from this mistake by making
gcc bail if dualboot.h and dualboot.c are mismatched:

CC dualboot.c
dualboot.c:63: error: conflicting types for ‘dualboot_c200v2’
dualboot.h:6: error: previous declaration of ‘dualboot_c200v2’ was here
make: *** [build/dualboot.o] Error 1

Code: [Select]
Index: mkamsboot/dualboot/bin2c.c
===================================================================
--- mkamsboot/dualboot/bin2c.c (revision 24590)
+++ mkamsboot/dualboot/bin2c.c (working copy)
@@ -90,6 +90,7 @@
     }
 
     fprintf(cfile,"/* Generated by bin2c */\n\n");
+    fprintf(cfile,"#include \"%s\"\n\n", hfilename);
     fprintf(hfile,"/* Generated by bin2c */\n\n");
 
     for(i=0; i < argc - 2; i++) {
[/edit]

[edit2]
Opened tracker item: http://www.rockbox.org/tracker/task/11009
[/edit2]
« Last Edit: February 13, 2010, 10:37:41 AM by ranma »
Logged

Offline mtee

  • Developer
  • Member
  • *
  • Posts: 9
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1422 on: February 13, 2010, 02:53:15 PM »
Quote from: funman on February 12, 2010, 03:28:20 PM
mt do you still have the clppa.bin you copied on your clip+ ?

btw the delay to power off is longer on Clipv2/+ than Clipv1 and closer to 15/20 seconds.

If you're sure it is dead, could you open it and try the e200v2 recovery trick ?

The image I used is here : mtarek.com/rockbox/output.rar

I have tried that recovery method but it still didn't work. There's the solution of attaching an external card reader to the NAND flash and writing the OF image back onto it, but I'm not sure if it would work, plus I don't think it would save me much compared to just buying another clip+.
Logged

Offline FlynDice

  • Developer
  • Member
  • *
  • Posts: 166
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1423 on: February 15, 2010, 02:59:52 AM »
I checked to see if the second D6 read would somehow catch the USB presence for clip+ but I'm not able to find a difference. :(
Logged
e280v2    fuzev1 2gb   clip+4gb   8GB Transcend cl6 uSD    access to fuzev2 4GB       clip+2gb R.I.P.

Offline ranma

  • Developer
  • Member
  • *
  • Posts: 31
Re: SanDisk Sansa e200 v2, c200 v2, m200 v4, clip v1, v2 & +, and Fuze v1 & v2
« Reply #1424 on: February 16, 2010, 10:27:34 AM »
I'm going to try to find out the JTAG pinout on my C240v2.
Here is what I've got so far (measured voltages and on the supply pads also the resistance to make sure they are supply pads. At about 0.5 Ohms I'm pretty sure they are :)):

Code: [Select]
USB

    1 GND
 F  2 2.4V
 L  3 2.4V
 A  4 2.4V
 S  5 2.4V
 H  6 0V (TRST?)
    7 VCC

RAM

And I soldered wires to the pads:
http://uguu.de/~ranma/S6000731.JPG

Now I have to figure out how to best proceed in testing the pins...
Logged

  • Print
Pages: 1 ... 93 94 [95] 96 97 ... 129
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.104 seconds with 14 queries.