Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Blogs & guides and tales of woo by forum members.
User avatar
stephen_usher
Site sponsor
Site sponsor
Posts: 7388
Joined: 13 Nov 2017 19:19
Location: Oxford, UK.

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by stephen_usher »

exxos wrote: 17 May 2023 23:19 Wouldn't that be almost the same as dumping known bit patterns to the drive and reading them back like jookie's test program does anyway ?
If his program just does a contiguous read then it possibly doesn't. Reading random words from the file requires rapid, multi cylinder seeks between reads. This is both testing for lost seeks and miscalculation of the location when doing seeks.

I know from experience with my Apricot HD simulator using a Pico that with an off-by-one error in my cache code meant that in certain situations one byte would not be written and that was a head scratcher as to why the files were being corrupted.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by dad664npc »

The ACSI commands are the same for TOS and the HD test programme - they are both using 6 byte commands
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by dad664npc »

stephen_usher wrote: 18 May 2023 09:15
exxos wrote: 17 May 2023 23:19 Wouldn't that be almost the same as dumping known bit patten's to the drive and reading them back like jookies test program does anyway ?
If his program just does a contiguous read then it possibly doesn't. Reading random words from the file requires rapid, multi cylinder seeks between reads. This is both testing for lost seeks and miscalculation of the location when doing seeks.

I know from experience with my Apricot HD simulator using a Pico that with an off-by-one error in my cache code meant that in certain situations one byte would not be written and that was a head scratcher as to why the files were being corrupted.
There aren't any seeks in the generic sense. sd-cards are addressed by sector number (LBA). So just read/write commands with a LBA
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3044
Joined: 19 Nov 2019 12:09

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by Badwolf »

I got my own board (@dad664npc's version from December) assembled and flashed yesterday. It doesn't work, but I was expecting this as it uses the TXB0108 chips spec'd at the time which are now not believed to work.

However I do now want to debug it, so will be trying to learn a bit about ACSI and how the design hangs together. If I learn, find or write anything possibly useful I'll chip in.

My board does spit out debug spam onto the USB serial port successfully, so I've a foot in the door. I think it's failing to read the SD card, so the chat two and from the ST is immaterial at present.

In terms of a test program, the first thing that springs to mind is to write something that replicates the ACSI commands that are seen to fail and do so repeatedly, checking for a discrepancy. The fact you (@exxos) have a log of commands sent during a failure is extremely useful for this.

I wouldn't bother with anything that tries to write to files or drives (reliant on GEMDOS and the driver), but go down into the weeds early doors.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
User avatar
exxos
Site Admin
Site Admin
Posts: 28391
Joined: 16 Aug 2017 23:19
Location: UK

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by exxos »

I tried syncing DRQ to CLK8 but was unsuccessful in changing anything :(

There is still a mystery of why DRQ is extremely sensitive. I thought running it through a DFF may help or make it worse but it changed nothing. Theoretically you should not do anyway, but I really had no other avenues to explore.

I have basically hit a wall because there is simply nothing else for me to try.

IMG_0618.JPG
IMG_0619.JPG

I could see a potential hiccup, where keeping the CPU in 8MHz based on RW low would potentially help, and it does. But this unfortunately does not explain the issues with 8MHz mode. Which seems to be ironically working fine again now. :roll:

Capture.PNG

I thought I figured it out back in this post viewtopic.php?p=100387#p100387 but guess its difficult with the faults being so random :(

I tried adding 33pF back to the 8 MHz clock again. It failed repeatedly to even get to desktop. Signal does not look any much different other than the over and under shoots are slightly less.

EDIT:

Now the display has gone into a funky disc even though it looks like the ST is still trying to boot.

IMG_0620.JPG

I wonder if the 33pF Is adding a slight delay where it then misses its "time slot" for RAM accesses.
You do not have the required permissions to view the files attached to this post.
User avatar
stephen_usher
Site sponsor
Site sponsor
Posts: 7388
Joined: 13 Nov 2017 19:19
Location: Oxford, UK.

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by stephen_usher »

dad664npc wrote: 18 May 2023 09:27 There aren't any seeks in the generic sense. sd-cards are addressed by sector number (LBA). So just read/write commands with a LBA
The ACSI interface will be using CHS addressing however.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by dad664npc »

Nope

Screenshot 2023-05-18 at 10.58.46.png
You do not have the required permissions to view the files attached to this post.
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
User avatar
exxos
Site Admin
Site Admin
Posts: 28391
Joined: 16 Aug 2017 23:19
Location: UK

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by exxos »

Going back to 220MHz tests. On boot up.

Code: Select all

RESET
RESET
RESET
RESET
CMD_READ        tgt=0 lun=0 (0x08:00:00:00:01:00) (00)
CMD_READ        tgt=1 lun=0 (0x08:00:00:00:01:00) (02)
CMD_READ        tgt=1 lun=0 (0x08:00:00:00:01:00) (02)
Then get 4 bombs. Though writes (at least in general) have worked better at that speed.
User avatar
exxos
Site Admin
Site Admin
Posts: 28391
Joined: 16 Aug 2017 23:19
Location: UK

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by exxos »

dad664npc wrote: 18 May 2023 07:02 I too can replicate what exxos has seen, in that a cold startup, writes work for a few minutes before corruption starts.
Do you also get this at 8MHz with either the original or beta GAL firmware ? I've lost track.

Been doing testing with another revised firmware and I think is just be easier to release the tweaked GAL firmware for anyone who ends up with similar issues. It seems to be working at both 8MHz and 32MHz speeds now.

The problem is I'm just going around in circles with all of this. For some bizarre reason, it seems like the RW timings gets screwed up with some drives but not others. As to how it can go from a DMA cycle to a RW timing skew is beyond me. But after spending the best part of three weeks on this, I am just getting nowhere, and if the tweaked GAL firmware offers a workaround and it seems to work, then that will just have to be the fix for now.
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: Raspberry PI PICO ATARI ST Hard Drive Emulator (WIP)

Post by dad664npc »

I am back to using the original GAL firmware. Writes are corrupted in both 8 MHz and 32 MHz
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk

Return to “MEMBER BLOGS”

Who is online

Users browsing this forum: ClaudeBot and 11 guests