Page 1 of 1

Problem? with released QLSD source....

Posted: Tue Oct 21, 2014 9:55 am
by prime
Hi all,

Putting this in software as it's the driver source.....

Anyway i have built a ROM from the released QLSD source, there seems to be a problem with it, in that it never asserts the SS on the SD card, tracing with mess and a copy of the ROM that came with the interface it accesses the drive select registers thus :

read of FEF0 : deselect drives
read of FEF1 : select drive 1, and presumably read it
read of FEF0 : deselect.

On the compiled ROM, I get :

read of FEF0 : deselect drives
read of FEF0 : deselect drives
read of FEF0 : deselect drives

in building this I have only changed a couple of lines in sdcard_ver_in :

Code: Select all

IS_ROM          equ     1               ; Set to 1 to build the ROM version
CHK_LOAD        equ     1               ; Set to 1 (for ROM version) to allow the user
So somehow it's not selecting the SD device....

Cheers.

Phill.

Re: Problem? with released QLSD source....

Posted: Tue Oct 21, 2014 10:39 am
by prime
Ok I think I've found the problem....

In sdcard_sdc_asm, function sdc_init there is a line that says......

Code: Select all

	bsr	spi_deselect		; Start with the card deselected (this doesn't touch d0)
	move.b	d0,d4			; Save the SPI device number
the problem is spi_deselect does change d0...always resets it to zero which is why it was being clobbered !

moving the move.b d0,d4, to the line before the call to spi_select fixes this.

Cheers.

Phill.

Re: Problem? with released QLSD source....

Posted: Tue Oct 21, 2014 10:52 am
by tofro
Phill,

I guess you must have changed more than this.....

reading $fef0 should de-select any drive
reading $fef1 should select drive 1 (does not read anything)

Can you use an exact copy of "ver_qrx082_ROM_in" as "ver in"? This is the one that has been used to build your "original" ROM.

Tobias

Re: Problem? with released QLSD source....

Posted: Tue Oct 21, 2014 12:03 pm
by tofro
Phill,
I have checked again and it's all my fault. Somehow an intermediate version of qlromext_asm must have slipped in when I collected the source files for release.
Your fix is OK, but I will still re-post a new version of the drivers to Dilwyn.

Sorry for the hassle,
Tobias

Re: Problem? with released QLSD source....

Posted: Tue Oct 21, 2014 12:21 pm
by prime
tofro wrote:Phill,
I have checked again and it's all my fault. Somehow an intermediate version of qlromext_asm must have slipped in when I collected the source files for release.
Your fix is OK, but I will still re-post a new version of the drivers to Dilwyn.
No worries, it wouldn't be the first time that the code says one thing and the comments something else :)

I only discovered it because I'm porting QLSD to slightly different hardware, it wasn't working so I tried poking around with a scope, and found that /SS wasn't being asserted so looked deeper and found the problem.

Cheers.

Phill.

Re: Problem? with released QLSD source....

Posted: Wed Oct 22, 2014 9:49 am
by Peter
Sorry, I wanted to rebuild, check and release the sources myself, but never found the time.

Did you check for identical binaries after rebuild from source?