I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods
Amazon Honor System Click Here to Pay Learn More
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / MISC Areas / Mattel JuiceBox
New Juice box application software to execute programs from SD/MMC Cartridge Hack
New Juice box application software to execute programs from SD/MMC Cartridge Hack

New MessageNew Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
Profile
Hi All,
I have just finished some application software that may (or may not) be of some interest to you.
I have written a crude but usable user interface(UI) for prpplague's clever SD/MMC Cartridge Hack.
( prpplague's documentation is very good. The only thing he forgot was to document that the write-protect
pad on the XD card must be tied high to allow you to write to the nand.)
The software is mostly just a combination of the test code on the wiki with a few extra routines
to fill in the gaps(like: nandwrite,FAT16 read,scroll,buttons init and controls,mmc GPIO inits...)
The software displays(on the juice box screen) the filenames and directories of a FAT16 SDcard and
allows the user to navigate around the files and directories by using the FF and REW buttons on the juice box.
It highlights the current file or directory. If you press the PLAY button while on a directory it will
descend into the directory(displaying the filenames, Its like using the cd command in unix).
If you navigate to file(ie its highlighted) and its extension is .BIN the you can execute the file by
pressing the PLAY button(given that you have set the routine to run at 0x0c001000).
The UI boots from the XD card nand. So it is now possible to write and execute files without a
JTAG(once you have SD/MMC Cartridge Hack programmed of course).

Here is a brief description of how I did this:

1)Wrote the the nandwrite routines (this routine is quirky but works well but you unfortunately need a jtag for this step).
(nandwrite will only work from a clean juicebox reboot, I don't know why????)
2)Wrote the init routine for the for the mmc GPIO and modified the bitbang SPI routines.
3)Ported ZWS DOSFS (READONLY) to the juice box.(this was the easy part)
4)wrote the UI and scroll routines

I have tested it by executing a small juice box comm program that I wrote which turns the (juice box into a
serial display) and the LCD_2 demo test code. It seems to work fine.
I'm not sure where (if at all) it should go on the wiki.
I pretty short on time so maybe someone else that knows more about the wiki will be
willing to post it(all I want is the credit for the original bits of software that I added to the test code).
DOSFS is pickey about how the sd card is partitioned (I partitoned as FAT16 in linux) but I have written to
it from Windoze 2000 and linux and it works fine.
The software does very little error checking and the source code is a messy looking, but willing to release source
code as is.

I don't know how many of you have constructed prpplague's clever SD/MMC Cartridge Hack.
Anyone interested in this software ?

11-19-2006 18:50:20

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
Profile
Sounds cool!

I will be interested, once I hack the cartridge and get my JTAG setup working!

-David

11-19-2006 20:51:35

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) prpplague
Profile
sounds pretty darn cool!

please create a page on the elinux wiki!!!

11-20-2006 10:48:35

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
Profile
prpplague,
Any preference to the location this application should go on the wiki?
There doesn't seem to be any other application software.
11-20-2006 20:22:30

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) newell
Profile

I don't know how many of you have constructed prpplague's clever SD/MMC Cartridge Hack.
Anyone interested in this software ?

Impressive. Sounds like a nice piece of work. I may have to get my JB rig back out and play with this stuff again!

11-21-2006 09:26:03

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
Profile
I posted the software on the ewiki under JuiceBoxSoftware
I hope it works for you guys.
11-22-2006 20:34:03

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) ForkBoy
Profile
In the source code, is the bitbang.c file corrupt?
I have extracted the archive on both Windows and Linux and bitbang.c appears to be a binary file: 159978 Nov 22 17:43 bitbang.c

Thanks!

12-04-2006 11:19:59

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
Profile
I'm not sure how that happened(poor quality control on my part). I have just uploaded a "good" tar.gz to the wiki. Please try downloading it again.
12-04-2006 18:17:54

New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) ForkBoy
Profile
Thanks to the brilliant work of prpplague and unix_guy I have a working JuiceBoxUMDCart with fatjbox running.

Here are a few things that I learned in the process that might be useful to others (I can post these on the Wiki)


JuiceBoxUMDCart:

A drop of super glue works well for holding the xD card in place.

Use solid wire-wrap (30AWG) wire. Using a thin solid core wire makes it easier to no short out the connections.

Take note that the pins on the SD card socket are 9 1 2 3 4 5 6 7 8, not 1 - 9.


Building a Test Image:

The 0x220 bytes can be easily extracted by booting with a JuiceWare cartridge and using OpenOCD:

dump_binary /home/somebody/header.bin 0x0C180000 0x220

____________________________________________________________________________

  • This brings me to a couple of questions:

    unix_guy -- Would it be possible to post your serial terminal application?

    prpplague -- Do you have any information available about your custom bootloader, uclinux kernel, and ramdisk?
    Did you rebuild the kernel?, if so which version of the Arm compiler are you using?

    I am very interested running uclinux on the the xD card, but I'm not sure where to locate the various components
    on the xD flash and which modifications to make for SD card and / or LCD support.

    I am open to contributing anything I learn and create to the Wiki.

  • 12-06-2006 16:15:51

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    ok,
    I'll post my serial comm program on the wiki sometime this week. It's a tiny routine. As usual(for me), it is just a combination of the test code already posted on the wiki. It uses software polling for everything so it may drop bytes if the input throughput is too high. It should be rewritten to use interrupts. At least it scrolls efficiently. Maybe people will use it to turn their juice box into serial display for a linksys router or something.
    12-07-2006 19:13:08

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
    Profile
    Thanks again unix_guy for all of your work on this project!

    I do have a question about your nandwrite routine. I get the following output when executed (to save space, I only include the start and end of input):


    ----------------------------------------------
    File: nandwrite.c, (Jan 7 2007, 20:12:21)

    Manufacturer code: 0x00000098
    Size code: 0x00000076
    Extra code: 0x000000A5
    error at sector 0x00000000at word #00000000
    org is 0x02000002 nand byte is 0x00000000
    error at sector 0x00000000at word #00000001
    org is 0x00004000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000002
    org is 0x08000000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000003
    org is 0x02000000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000006
    org is 0x00050000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000007
    org is 0x00005000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000008
    org is 0x20000000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000009
    org is 0x22001002 nand byte is 0x00000000
    error at sector 0x00000000at word #0000000E
    org is 0x20001000 nand byte is 0x00000000
    error at sector 0x00000000at word #0000000F
    org is 0x08010400 nand byte is 0x00000000
    error at sector 0x00000000at word #00000010
    org is 0xA0001000 nand byte is 0x00000000
    .
    .
    .
    org is 0x40000000 nand byte is 0x00000000
    error at sector 0x00000000at word #00000078
    org is 0x44000000 nand byte is 0x00000000
    error at sector 0x00000000at word #0000007B
    org is 0x00200000 nand byte is 0x00000000
    error at sector 0x00000000at word #0000007F
    org is 0x04000000 nand byte is 0x00000000
    length is 0xFFFFFF85
    over and out.

    test complete..
    ----------------------------------------------

    The NAND (Olympus 64 MB xD card, #200842) seems to ID OK, but looks like it is not being written to correctly. The JuiceBox cartridge test reads the card OK as well. I know you mentioned "You may have to send out an additional address byte for larger xd cards", but from the Flash 101 tutorial, I believe my 64MB card should be similar to a 16MB card ("...NAND offers a monolithic 2-Gbit die or can support up to four stacked die, allowing an 8-Gbit device in the same TSOP-1 package...). From this, I would think the 16 and 64 would have similar address scheme, but I'm not sure. Do I need to send and extra address byte, and if so, how (sorry, I couldn't really tell from the tutorial)?

    Thanks!

    -David

    01-07-2007 22:00:46

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    Are you running it from a clean boot?
    The nand write routine is quirky and only works from a clean boot(it must be the first program that is run after the clean boot)
    If you run it a second time without rebooting it will fail(or if any program is run before it, nand write will fail). I nearly
    pulled out my hair until I realized that this how it works. I also run ocd native (not through eclipse).
    01-07-2007 22:24:02

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    David,one more thought. Do you have the write protect pad(nWP) on the xd card tied high ? (see my first post on this thread).
    01-08-2007 17:58:23

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
    Profile
    Thanks for the reply!

    I think you are right - I didn't connect pin 11 of the xD card (nWP). Please excuse my electronics ignorance, but when you say the pad should be "tied high", does this mean I need to connect this pad to ground or VCC (or neither!)?

    Thanks!

    -David

    01-08-2007 20:23:09

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    connect it to vcc.(You should probably use a resistor but mine worked fine with just a direct connection to vcc).
    The n in nWP means active low(ground).
    01-08-2007 20:55:46

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
    Profile
    I tied pad 11 of the xD card to pad 1, which is tied to Vcc, but I'm getting the same result. I'm using OpenOCD directly and powering on the JB for each try (clean boot). Is there a caertain amount of time I should let the JB run its demo before halting? I have also tried just doing a soft_reset instead of powering the JB off/on, but no difference. Not sure what to try next.

    -David

    01-08-2007 22:02:08

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    David,
    I am assuming that you followed the readme.txt for nandwrite.
    Since your SD/MMC Cartridge Hack passes the initial diagnostics, I will assume that all of the xd pads associated with the read operations are ok. So maybe you need to check nWE line to make sure that it is not connected to any other lines(solder blob) and
    that it is connected to Cardedge 10. If that checks out ok them maybe it's a software data alignment problem. You can check that by
    using my binary for nand write instead of your own. If those two ideas don't pan out then I'm not quite sure what to do next either.
    01-09-2007 19:35:27

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
    Profile
    Thanks for the help!

    I could very well have a bum cartridge with my lack of soldering skill. The only way I know to check for shorts is to use my ohm meter to check adjacent pads on the card edge and the xd pads. With the meter set to a few ohms full scale, everything looks cool - no shorts. But if I change to something like 200K full scale, I do get readings of some continuity, but for all I know, this is normal. It would be nice to have readings from other people's hacked carts to see if mine is anywhere close.

    In running nandwrite a few dozen times, I do see some interesting things. For example, every so often, I will get a sector where most word compares were fine and only a bit or two was different:

    .
    .
    .
    length is 0x0000E860
    error at sector 0x00000004at word #00000000
    org is 0xFBFFFFFF nand byte is 0xFBFFFFEF
    error at sector 0x00000004at word #00000005
    org is 0xFFF77DEB nand byte is 0xFFF75DEB
    error at sector 0x00000004at word #00000024
    org is 0xFFFFF7FF nand byte is 0xFEFFF7FF
    error at sector 0x00000004at word #00000028
    org is 0xBBFFFFFF nand byte is 0xBBDFFFFF
    error at sector 0x00000004at word #0000002B
    org is 0xAFFF7FFF nand byte is 0xAEFF7FFF
    error at sector 0x00000004at word #00000069
    org is 0xDFBEEF7F nand byte is 0xDFAEEF7F
    error at sector 0x00000004at word #0000007D
    org is 0xFFFBBF5F nand byte is 0xFFFBBF5D
    error at sector 0x00000004at word #0000007E
    org is 0xF7FBBBF7 nand byte is 0xF7EBBBF7
    length is 0x0000E7E0
    .
    .
    .

    Maybe I just have an xD card with some bad sectors (probably from my hacked-up solder job)? I may just need to write a test routine to check the entire card for bad areas and record these (64 MB may take a while!). In the flash tutorial there was something about marking sectors or blocks as bad - I will re-read it.

    Anyway, I will post what I find out.

    Thanks!

    -David

    01-10-2007 00:41:38

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) unix_guy
    Profile
    Did you try using my binary to write to the nand ?
    01-10-2007 16:45:44

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 0 times) DavidM348
    Profile
    Yes - the output above was from your binary.

    I'm not sure what I do if I do find the first few sectors bad. Even if I just write to the "good" sectors, I doubt the NAND will boot the JB :(

    -David

    01-10-2007 20:20:57

    New MessageRE:New Juice box application software to execute programs from SD/MMC Cartridge Hack (modified 1 times) DavidM348
    Profile
    UPDATE

    It appears the first 0x1D5 sectors of my xD card are "bad". I've only checked through sector 0x1000, but from 0x1D5 to 0x1000 there were none bad, so I expect they will be good the rest of the way up. I don't know if the card was damaged during soldering or if I purchased it that way (but I suspect it was the soldering). Now I need to find out if I can "trick" the JB into thinking that sector 0x1d5 is sector 0 of the nand so that it will boot.

    -David

    Edit: I forgot to mention, I seem to be able to write to the good sectors without having to reboot the JB each time. After a nandwrite, I halt, then resume 0x0c001000 and it works again.

    01-10-2007 21:43:48

    Reply to Thread | Printer |
    All times are PSTPowered by UltraBoard v1.62



    Copyright © 2000, Netmake Inc. All Rights Reserved.
    See Terms and Conditions for more information.




    i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3