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:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2
« previous next »
  • Print
Pages: 1 ... 36 37 [38] 39 40 ... 129

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

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #555 on: December 21, 2008, 12:33:06 AM »
Quote from: kugel. on December 20, 2008, 10:38:50 PM
Uhm, before you build the bootloader (but after patching) edit firmware/target/arm/as3525/system-as3525.c and tools/configure to reflect the correct memory (I guessed 8MB when I made the patch).

And sorry that I need to say it again: Double-check rbutil/mkamsboot/dualboot.S. This file is critical! Wrong code will brick your player. So please check if I added the correct GPIO states for USB present and Right button.

Sorry, we can't be safe enough about that file :)

I did have to change the code which checks for the "right" button - it should be looking at logic level 0 not 1.

I changed:
        cmp   r1, #1                /* C6 high means button pressed */
        beq   boot_of
to:
        cmp   r1, #0                /* C6 high means button pressed */
        beq   boot_of

If i mistakenly stated the wrong level in a previous post i apologise.
The other thing I found is very minor, and that is the new option 59/ for the c200 during the build actually shows e200V2 on the display rather than c200v2, so there are now two options for the e200v2. I did not change this because as far as I can see this is only cosmetic and shown on the display - the code builds for the correct target anyhow.

Anyhow following your excellent instructions I was able to quickly do all that was required and have now built a new BIN file, with no apparent problems. The only thing I had to do to get the main tree patch to work was to enter a -P0 option otherwise it could not find the files. Remember all this stuff is new to me, but I am getting the hang of it.

I have not as yet edited the sansa_as3525.c file, I have just got the patch/build process to work and complete, to see that I could do it. Now I will go on to the next stage and edit the file, rebuild and actually load onto the player.

Is the only thing I have to change in regards to the dram config from this:

#if defined(SANSA_CLIP) || defined(SANSA_M200V4)
/* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */
#define MEMORY_MODEL 0x21

#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2)
/* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */
#define MEMORY_MODEL 0x5

to this:

#if defined(SANSA_CLIP) || defined(SANSA_M200V4) || defined(SANSA_C200V2)
/* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */
#define MEMORY_MODEL 0x21

#elif defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */
#define MEMORY_MODEL 0x5
??
« Last Edit: December 21, 2008, 06:15:08 AM by RockRabbit »
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #556 on: December 21, 2008, 09:48:47 AM »
Thanks a lot for the testing and editing.

So, have you actually updated your player with a patched OF (created by mkamsboot)? If yes, and if dualboot works, I think my patch can be committed (with the changes you mentioned of course).
Logged
 

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #557 on: December 21, 2008, 04:18:48 PM »
Quote from: kugel. on December 21, 2008, 09:48:47 AM
Thanks a lot for the testing and editing.

So, have you actually updated your player with a patched OF (created by mkamsboot)? If yes, and if dualboot works, I think my patch can be committed (with the changes you mentioned of course).

Not yet. I need an answer to the question above (in my previous post), re the change to the dram setting. Once I know thats ok, I will go ahead.
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #558 on: December 21, 2008, 05:54:04 PM »
Quote from: RockRabbit on December 21, 2008, 04:18:48 PM
Quote from: kugel. on December 21, 2008, 09:48:47 AM
Thanks a lot for the testing and editing.

So, have you actually updated your player with a patched OF (created by mkamsboot)? If yes, and if dualboot works, I think my patch can be committed (with the changes you mentioned of course).

Not yet. I need an answer to the question above (in my previous post), re the change to the dram setting. Once I know thats ok, I will go ahead.
Yes, your change is correct.

Edit: You'll also want to change tools/configure to reflect the correct memory (search for "59)" and you'll get to the c200v2 part).
« Last Edit: December 21, 2008, 06:01:21 PM by kugel. »
Logged
 

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #559 on: December 21, 2008, 06:32:28 PM »
thanks.

Ill get on to it right away.

Kugel - Made another change - the code to detect the boot up condition was set to pin A3 - this is the power button. However you refer to this code as detecting the USB cable, which it does normally for all other players. Not sure whether you want this to be the power button or the usb cable. I changed it to be the USB cable, pin A1.

Applied the new bootloader with no problems. At present it does nothing, but it responds properly to the usb cable and holding down the right button - so its a safe bootloader.

How will we handle the changes - will you do them manually or should I email you the changed files?
« Last Edit: December 22, 2008, 04:18:41 AM by RockRabbit »
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #560 on: December 22, 2008, 06:17:27 PM »
Uhm, no, I had it set to A1 ("ldr   r1, [r0, #0x8]    /* it's A1 on C200 */"). What did you exactly change to make it work?

I suggest you do "svn diff rbutil/mkamsboot/ > patch.diff" and upload the file to the task (http://www.rockbox.org/tracker/task/9679). You can of course sent it to me by email or any other way of your choice (my email is: thomas47@arcor.de).
Logged
 

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #561 on: December 22, 2008, 07:25:08 PM »
Quote from: kugel. on December 22, 2008, 06:17:27 PM
Uhm, no, I had it set to A1 ("ldr   r1, [r0, #0x8]    /* it's A1 on C200 */"). What did you exactly change to make it work?

I suggest you do "svn diff rbutil/mkamsboot/ > patch.diff" and upload the file to the task (http://www.rockbox.org/tracker/task/9679). You can of course sent it to me by email or any other way of your choice (my email is: thomas47@arcor.de).

Apologies. Your code was fine. I did not pay enough attention to the code - i mistook the ifndef for an ifdef (not being familiar with the coprocessor and doing it in a rush). Forget I ever mentioned it - ignore the ramblings of an old man.
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #562 on: December 22, 2008, 07:30:54 PM »
Ah ok, fine. I think you're right. Using #ifdef is better, as it's more clear. I also always expect #ifdef and don't pay much attention on whether there's an n between or not. Also #ifdef SANSA_C200V2 makes it just clearer what code is used for that target and what not.

Can you please give me a short sum up on what you changed? The memory stuff and...?
Logged
 

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #563 on: December 23, 2008, 10:25:57 PM »
I think this is all I changed in total..

system-as3525.c
line 186+
moved the SANSA_C200V@ from the 8 mybtes group (next to the FUZE) to the 2 mbytes group (next to M200V4)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#if defined(SANSA_CLIP) || defined(SANSA_M200V4) || defined(SANSA_C200V2)
/* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */
#define MEMORY_MODEL 0x21

#elif defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */
#define MEMORY_MODEL 0x5
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/tools.configure
line 1761+
changed the memory= from 8 to 2
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   59|c200v2)
    target_id=55
    modelname="c200v2"
    target="-DSANSA_C200V2"
    memory=2 # wild guess
    arm9tdmicc
    bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
    bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
    tool="$rootdir/tools/scramble -add=c2v2"
    output="rockbox.sansa"
    bootoutput="bootloader-c200v2.sansa"
    appextra="recorder:gui"
    plugins="yes"
    swcodec="yes"
    # toolset is the tools within the tools directory that we build for
    # this particular target.
    toolset=$scramblebitmaptools
    # architecture, manufacturer and model for the target-tree build
    t_cpu="arm"
    t_manufacturer="as3525"
    t_model="sansa-c200v2"
    ;;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

/rbutil/mkamsboot/dualboot.s
line 124+
changed the cmp r1, #1 to cmp r1, #0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#elif defined(SANSA_C200V2)
        /* check for RIGHT on C6, should maybe changed to LEFT as soon as it
         * known in which pin that is in order for consistency  */
        ldr   r0, =GPIOC
        mov   r1, #0
        str   r1, [r0, #0x400]      /* set pin to output */

        ldr   r1, [r0, #0x100]      /* 1<<(6+2) */
        cmp   r1, #0                /* C6 high means button pressed */
        beq   boot_of
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #564 on: December 23, 2008, 10:35:53 PM »
Thanks! That means I remembered correctly. I already put a new (supposedly final) patch on the task.

Good to know my patch didn't break other people's mp3 player ;)
Logged
 

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8986
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #565 on: December 23, 2008, 10:37:13 PM »
Also, learn to use patches.  Its really annoying having to figure out what you changed otherwise.
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #566 on: December 23, 2008, 11:56:42 PM »
The c200v2 patch has just been committed to SVN.

RockRabbit, I'd welcome if you play a bit around with the Rockbox bootloader (remember: You can do anything with it, since dual boot isn't dependent on a working bootloader). In particular I'm curious if backlight_on() and/or buttonlight_on() are working (just add those before the #ifdef SANSA_C200V2 line in bootloader/sansa_as3525.c).

And if you have any questions regarding the build system rockbox uses, don't hesitate to ask :) It may take some time, but you'll find your way through the target tree(forest rather).
Logged
 

Offline RockRabbit

  • Member
  • *
  • Posts: 30
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #567 on: December 24, 2008, 11:57:10 PM »
I have re-installed the rockbox tree from the latest version on svn. I have tried the calls you suggested to the functions backlight_on(),    buttonlight_on() and lcd_init().

The backlight_on and buttonlight_on calls appear to do nothing. The lcd_init() call turns the screen backlight on, giving a blank white screen, before turning off again after about a quarter of a second. It appears then that the player has turned off, since pressing the power button again will trigger the same sequence. Since a perpetual while loop follows the call to lcd_init, I am inclined to think that the code crashes during the lcd_init routine, and the while loop is never reached.

With the backlight_call, the player stays active, presumably within the while loop.

What confuses me is that I can find no definition for the buttonlight_on function anywhere within the rockbox tree. I have used the Gnome search tool to look for buttonlight_on() and several files are listed, but they all call the function, not define it. Yet the code compiles, which indicates (i presume) that the compiler has a definition for the function somewhere, although there is some kind of "implicit definition" warning.

I can't determine from your post whether you intend for me to create this function, but I am assuming not. Can you explain what is happening here?
« Last Edit: December 25, 2008, 12:00:27 AM by RockRabbit »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8986
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #568 on: December 25, 2008, 02:02:18 AM »
Quote from: RockRabbit on December 24, 2008, 11:57:10 PM
What confuses me is that I can find no definition for the buttonlight_on function anywhere within the rockbox tree.

The one you want is in backlight-c200v2.c.  Theres actually a dozen or so of them in the target tree, so if your search tool isn't finding them, its probably not working right.  I suggest using grep.
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: SanDisk Sansa e200 v2, c200 v2, m200 (v2), clip and Fuze
« Reply #569 on: December 25, 2008, 08:15:46 AM »
Well, in backlight-c200v2.c there's _buttonlight_on() (with the leading underscore), but that's the actual function that turns it on (you can try calling directly that instead of buttonlight_on()), buttonlight_on calls that in a roundabout way. The functions with the underscore are generally those who touch the hardware, while the ones without are the ones which are supposed to be used by "the user" (i.e. not low-level stuff such as apps/ code).

Interesting that lcd_init did someting.

€dit: IIRC it's possible that you need to call backlight_on (or _backlight_on) before buttonlight_on (or _buttonlight_on).
« Last Edit: December 25, 2008, 03:52:52 PM by kugel. »
Logged
 

  • Print
Pages: 1 ... 36 37 [38] 39 40 ... 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.128 seconds with 20 queries.