Problem? with released QLSD source....

Anything QL Software or Programming Related.
Post Reply
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Problem? with released QLSD source....

Post 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.


prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

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

Post 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.


User avatar
tofro
Font of All Knowledge
Posts: 3091
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

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

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
Font of All Knowledge
Posts: 3091
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

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

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

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

Post 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.


User avatar
Peter
Font of All Knowledge
Posts: 2421
Joined: Sat Jan 22, 2011 8:47 am

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

Post 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?


Post Reply