Rockbox

Tasklist

FS#8686 - Creative Zen Vision:M Rockbox Port

Attached to Project: Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Wednesday, 05 March 2008, 20:02 GMT
Last edited by Maurus Cuelenaere (mcuelenaere) - Wednesday, 30 July 2008, 16:00 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This is the Creative ZVM Port FlySpray task; I opened it on request of NicolasP.

More information is available on http://forums.rockbox.org/index.php?topic=3320.new and http://www.rockbox.org/twiki/bin/view/Main/CreativeZVMPort.

Current attached diff contains code which isn't very clean and certainly not formatted according to Rockbox guidelines, I'll have to look in to this (later).
   zvm.diff (80.7 KiB)
This task depends upon

Closed by  Maurus Cuelenaere (mcuelenaere)
Wednesday, 30 July 2008, 16:00 GMT
Reason for closing:  Accepted
Additional comments about closing:  Already in SVN for a long time
Comment by Maurus Cuelenaere (mcuelenaere) - Thursday, 06 March 2008, 21:58 GMT
Current status (see diff).

I formatted some files according to the guidelines and cleaned some code.

Current problems have to do with IRQ, sometimes the device gives me an not-set interrupt and this seems to be for example when I want to assign a start value to a char array.
Also the load_context() problems aren't solved either, and I think it is related to the above problem (something with IRQ-stack <-> normal stack?)

I tried making a basic Rescue Mode, but as the current button driver can't announce key releases it is hard to use them (there has to be some kind of command to the PIC to get the current pressed buttons, but I haven't found it yet -> do_write() )

Maybe a last remark should be that the player crashes when IRQ and FIQ mode is disabled -> I don't think this should happen?
   zvm.diff (93.7 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 09 March 2008, 22:00 GMT
After days and days of bughunting stupid me just didn't read the datasheet correctly; that's why I reversed the IRQ handler in system-dm320.c to the original one: this one works correctly :)

So finally the code is running stable on the device (except for the load_context() part, which still isn't resolved).

I optimized the button driver and added a system_reboot(), the I²C driver now interprets addresses as the OF (although it is feed differently to the I²C registers), a basic rescue mode is available by pressing the Menu button (bottom right); I think that's all: for more info, see the code.
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 11 March 2008, 19:53 GMT
These are some isolated diff's to current SVN, normally these should be commit-ready.

i2c.diff: adds support for I²C
spi.diff: adds support for ZVM + ZVM's LCD
system.diff: adds system_reboot(), support for ZVM and resets interrupts to default priorities + some minor changes
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 11 March 2008, 21:52 GMT
This is the correct version of i2c.diff
   i2c.diff (7.6 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 16 March 2008, 22:02 GMT
Update:
* threading now works apart from sleep_thread() -> I haven't figured out yet what's wrong with that
* I reworked scramble so now Creative FW generating is fully done during building (no more need to build a CIFF structure around it)
* ATA seems to work pretty decently, but the FS still hasn't been figured out yet
* some other changes

This patch hasn't been reviewed for unwanted changes, so it could affect other targets.
   zvm.diff (130.9 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 16 March 2008, 22:04 GMT
BTW the problem with threading was that there wasn't another thread created (besides main) before a yield() call was done, so it was trying to switch to the current thread which obviously didn't work. Shouldn't there be some check for this?
Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 17 March 2008, 23:10 GMT
Update:
* added support for Zen V in scramble
* ATA works perfectly until it spins down; it won't spin up anymore currently..
* there's a simple FS info dialog when you press PLAY -> BACK -> CUSTOM -> BACK -> CUSTOM
* the sleep() bug still exists
   zvm.diff (131.4 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 18 March 2008, 19:24 GMT
Update:
* sleep() bug is fixed with workaround
* ATA problem is solved, it will spin up and down when it's needed
* some basic HDD browsing is implemented when PLAY is pressed (see code for more info)
   zvm.diff (131.4 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 18 March 2008, 19:25 GMT
And that of course wasn't the right diff...
   zvm.diff (131.6 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Wednesday, 19 March 2008, 19:09 GMT
Forgot to add some extra files...
   zvm.diff (164.2 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 06 April 2008, 21:02 GMT
Update:
* basic USB driver added
* 'normal' compiling works due to stub code added
* optimizations and (bug)fixes here and there
   zvm.diff (214.4 KiB)
Comment by Michael Sevakis (MikeS) - Monday, 07 April 2008, 02:40 GMT
For compatibility core_sleep should be updated to simply use enable_irq after the WFI command (I guess this could just share that function with imx31 if this is also what would be a final implementation).
Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 07 April 2008, 15:46 GMT
Sorry, I didn't saw that line :)
I also think clearing the interrupt at core level shouldn't be done? That's why I used the imx31 implementation as you suggested.
   zvm.diff (211.7 KiB)
Comment by Michael Sevakis (MikeS) - Monday, 07 April 2008, 20:52 GMT
The imx31 was changed and the asm was also unmasking FIQ at core level but now the scheduler keeps clear of FIQ entirely. Scheduling takes over control of whether core-level interrupts are masked or not for two reasons (up to HIGHEST_IRQ_LEVEL so not the audio interrupt) :

1) Making core_sleep does not actually sleep if an interrupt becomes pending after checking if the run list is NULL and the core_sleep operation has been committed to. Processor that allow wakeup with them still masked make this easy. SH and s3c2440 need some tricks to do it atomically since they won't wake with them masked.
2) Having them masked and forcing a task switch can leave them masked for an unbounded length of time anyway since the nesting doesn't operate as such when turning control to other code.
Comment by Maurus Cuelenaere (mcuelenaere) - Wednesday, 09 April 2008, 20:15 GMT
Update:
* new USB int handler making USB code totally stable
* some code is committed to SVN

The only problem now is that I only get SUSP, VBUS & RESM statuses..
   zvm.diff (31.5 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Thursday, 10 April 2008, 20:45 GMT
Update:
* do endpoints like described in the manual(s)
* do NOT set up endpoint 0 as a non-control endpoint :)
* other changes I forgot to mention
   zvm.diff (31.5 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Thursday, 10 April 2008, 20:46 GMT
Forgot to 'svn add' some files...
   zvm.diff (58.2 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Friday, 11 April 2008, 15:16 GMT
Forgot to add the whole target/arm/tms320dm320/creative-zvm/ dir..
   zvm.diff (105.5 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Saturday, 12 April 2008, 22:04 GMT
Update:
* some (minor) USB changes
* added missing files in the patch
   zvm.diff (127.8 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 13 April 2008, 19:26 GMT
Update:
* fixed bug in button driver where first button wouldn't get detected correctly
* the usual USB changes without any useful results :(
   zvm.diff (129.1 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 15 April 2008, 17:21 GMT
So the problem with the USB chip was that somehow the interrupts don't come through, so I worked around this through a pulling method at every tick.
Now I can receive the EP0SETUP and identify it as a GET_CONFIG, but that's as far as I currently can get.
   zvm.diff (130.1 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Saturday, 19 April 2008, 17:35 GMT
Sync with SVN
   zvm.diff (126 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 20 April 2008, 20:34 GMT
Update:
* added keymappings
* non-bootloader can get to app_main(), but fails when some function uses IRAM-allocated data (something is currently wrong with IRAM) e.g. lcd_init()
   zvm.diff (152.6 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 21 April 2008, 21:14 GMT
Update:
* it boots Rockbox :)
* current requirements for booting Rockbox is that you've deleted the cfs partition and replaced it by a fat partition
* keymap is badly implemented, almost no keys work
   zvm.diff (153.3 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Wednesday, 23 April 2008, 20:15 GMT
Update:
* keys are for some unknown reason repeated indefinitely on main menus, so you can only choose the first and last item
* debug menu works
* code cleanup
   zvm.diff (156.5 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 28 April 2008, 21:11 GMT
Current state at trying to get sound working (using Catalin's DSP patch)
   zvm.diff (29.8 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 28 April 2008, 21:14 GMT
Forgot some files...
   zvm.diff (45.9 KiB)
Comment by Maurus Cuelenaere (mcuelenaere) - Friday, 23 May 2008, 18:43 GMT
This is Toni's emulator with some modifications running the ZVM's flash dump.
It doesn't yield any (very) interesting results though, I'm waiting for the SoC project which I'm planning to help with porting to the DM320.
   ARMemu.rar (653.7 KiB)

Loading...