Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#9512 - Sansa fuze in the rockbox tree

Attached to Project: Rockbox
Opened by Thomas Martitz (kugel.) - Wednesday, 29 October 2008, 23:06 GMT+2
Last edited by Frank Gevaerts (fg) - Saturday, 08 November 2008, 00:26 GMT+2
Task Type Patches
Category Applications
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch adds the sansa fuze target.

It includes a building bootloader (untested!!), a keymap and a simulator build (half-baked, using the h300 background).

Some stuff is just copied from arm/as3525/e200v2 (e.g. backlight-e200v2.c). So, they're not meant to be usable. Of course this files could be removed or replaced by a file only dummy'ing functions.

Comments are welcome.
   fuze-in-tree.diff (54.5 KiB)
 tools/configure                                          |   19 
 tools/scramble.c                                         |    2 
 apps/SOURCES                                             |    2 
 apps/keymaps/keymap-fuze.c                               |  323 +++++++++++
 firmware/export/config-fuze.h                            |  212 +++++++
 firmware/export/config.h                                 |    3 
 firmware/SOURCES                                         |   15 
 firmware/target/arm/as3525/system-as3525.c               |    2 
 firmware/target/arm/as3525/sansa-fuze/backlight-fuze.c   |   78 ++
 firmware/target/arm/as3525/sansa-fuze/adc-target.h       |   24 
 firmware/target/arm/as3525/sansa-fuze/backlight-target.h |   35 +
 firmware/target/arm/as3525/sansa-fuze/button-fuze.c      |  101 +++
 firmware/target/arm/as3525/sansa-fuze/button-target.h    |   63 ++
 firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c         |  427 +++++++++++++++
 firmware/target/arm/as3525/sansa-fuze/timer-target.h     |   41 +
 firmware/target/arm/as3525/sansa-fuze/system-target.h    |   31 +
 uisimulator/sdl/button.c                                 |   36 +
 uisimulator/sdl/uisdl.h                                  |    9 
 18 files changed, 1419 insertions(+), 4 deletions(-)

This task depends upon

Closed by  Frank Gevaerts (fg)
Saturday, 08 November 2008, 00:26 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Sim work will go to a new task
Comment by Thomas Martitz (kugel.) - Wednesday, 29 October 2008, 23:07 GMT+2
This is the scan I made of my fuze for the simulator. Quite bad quality, so I decided to not use it for now.
Comment by Rafaël Carré (funman) - Wednesday, 29 October 2008, 23:17 GMT+2
You'll need to modify also mkamsboot (add a dummy case for the Fuze since A3 is the only button we know and it is checked anyway)

I think lcd file can be empty for now since according to disassembly the controller isn't the same than the e200v2.
Also you have put code for a button wheel (maybe from e200v1?) : it should be left empty since the fuze, like its little brother the clip, has no wheel ;)

For the picture, I mentioned it on irc: a good picture for the Clip would serve also for the Fuze (and the reverse is true).
Comment by Thomas Martitz (kugel.) - Thursday, 30 October 2008, 00:21 GMT+2
How come you think the Fuze doesn't have a wheel? It has a wheel, and it's turning around nicely. I haven't modified mkamsboot since I'm not as up to the progress as you, so it'd probably better if you just insert something before committing.

If you do so, implement something which I can use to find out the button light gpio pin :)
Comment by Rafaël Carré (funman) - Thursday, 30 October 2008, 16:42 GMT+2
Sorry, I only know the fuze by pictures, and I supposed the similarity with the clip would extend to the buttons (aka no wheel).
Here is a patch to mkamsboot.

To find the button light pin (if it really is on a gpio), you can do something like that in the bootloader's main():

GPIOA_DIR = 0xff; /* all pins output */
GPIOA_PIN(0) = (1<<0);
GPIOA_PIN(1) = (1<<1);

etc .. and try pins one by one
   mkamsboot-fuze.diff (3.6 KiB)
 b/rbutil/mkamsboot/Makefile    |   26 +++++++++++++++++++++++---
 b/rbutil/mkamsboot/dualboot.S  |    2 ++
 b/rbutil/mkamsboot/mkamsboot.c |    9 +++++----
 3 files changed, 30 insertions(+), 7 deletions(-)

Comment by Thomas Martitz (kugel.) - Thursday, 30 October 2008, 17:31 GMT+2
Well, trying pins one by one isn't hard. I've could done that myself :) I wasn't clear but I searched for a loop that tries every pin on A(B,C,D) every second or so :)
Comment by Rafaël Carré (funman) - Thursday, 30 October 2008, 19:29 GMT+2
int delay;

GPIOA_DIR = 0xff;

GPIOA_PIN(0) = (1<<0);
delay = 0x100000;
while(delay--);

GPIOA_PIN(1) = (1<<1);
delay = 0x100000;
while(delay--);

..

I can't think of something else, especially if you have no output at all, I think each pin one by one is the best solution (there is "only" 32 of them)
Comment by Thomas Martitz (kugel.) - Saturday, 01 November 2008, 16:59 GMT+2
This patch fixes some of linuxstb's work. Correcting firmware/sources and button-target.h.

It still adds a preliminary version of a simulator.
   fuze-fixes-sim.diff (22.4 KiB)
 tools/configure                                          |    2 
 apps/SOURCES                                             |    2 
 apps/keymaps/keymap-fuze.c                               |  324 +++++++++++++++
 firmware/export/config-fuze.h                            |    2 
 firmware/SOURCES                                         |    2 
 firmware/target/arm/as3525/sansa-fuze/backlight-fuze.c   |    2 
 firmware/target/arm/as3525/sansa-fuze/backlight-target.h |    3 
 firmware/target/arm/as3525/sansa-fuze/button-target.h    |    4 
 uisimulator/sdl/button.c                                 |   37 +
 uisimulator/sdl/uisdl.h                                  |   13 
 10 files changed, 386 insertions(+), 5 deletions(-)

Comment by Thomas Martitz (kugel.) - Saturday, 01 November 2008, 21:36 GMT+2
Working buttonlight, backlight and lcd.

The meaning of the GPIO D7 (supposedly buttonlight pin) needs to be investigated though. Backlight didn't work without that pin. Possibly lcd didn't too, but I can't tell if the lcd is working without backlight.
   fuze-fixes-sim-lcd.diff (27.2 KiB)
 bootloader/sansa_as3525.c                                  |    1 
 tools/configure                                            |    2 
 apps/SOURCES                                               |    2 
 apps/keymaps/keymap-fuze.c                                 |  324 +++++++++++++
 firmware/SOURCES                                           |    4 
 firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c |   73 --
 firmware/target/arm/as3525/sansa-fuze/backlight-fuze.c     |   73 --
 firmware/target/arm/as3525/sansa-fuze/backlight-target.h   |    3 
 firmware/target/arm/as3525/sansa-fuze/button-target.h      |    4 
 uisimulator/sdl/button.c                                   |   37 +
 uisimulator/sdl/uisdl.h                                    |   13 
 11 files changed, 384 insertions(+), 152 deletions(-)

Comment by Thomas Martitz (kugel.) - Saturday, 01 November 2008, 22:59 GMT+2
update: _buttonlight_on() isn't actually needed.

Now with correct colors and a loop which shows brightness level and buttonlight change is working. Also commented storage_init() out, since it's broken.
   fuze-fixes-sim-lcd.diff (28.9 KiB)
 bootloader/sansa_as3525.c                                  |   28 +
 tools/configure                                            |    2 
 apps/SOURCES                                               |    2 
 apps/keymaps/keymap-fuze.c                                 |  324 +++++++++++++
 firmware/SOURCES                                           |    4 
 firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c |   73 --
 firmware/target/arm/as3525/sansa-fuze/backlight-fuze.c     |   73 --
 firmware/target/arm/as3525/sansa-fuze/backlight-target.h   |    3 
 firmware/target/arm/as3525/sansa-fuze/button-target.h      |    4 
 firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c           |    5 
 uisimulator/sdl/button.c                                   |   37 +
 uisimulator/sdl/uisdl.h                                    |   13 
 12 files changed, 411 insertions(+), 157 deletions(-)

Comment by Thomas Martitz (kugel.) - Saturday, 01 November 2008, 23:06 GMT+2
Ok, scratch that patch. svn diff doesn't recognize if I "svn mv'd" a file...

Loading...