davidgiven / fluxengine

PSOC5 floppy disk imaging interface
MIT License
350 stars 68 forks source link

Broken write bk800 format #611

Open nightgryphon opened 1 year ago

nightgryphon commented 1 year ago

The disks written using "bk800" format from ".img" disk image are not recognized by BK machine while can be successfully read back with fluxengine. Checked with 3 spare FDD controllers and 2 floppy drives

davidgiven commented 1 year ago

Good to know --- this was never tested on real hardware.

When you say that they're not recognised, to you mean that it's aware they're formatted but can't understand the filesystem, or is it simply unable to detect the sectors?

nightgryphon commented 1 year ago

Well... It seems i was wrong. After hours of investigating including logic analyser, swapping hardware, jumpers, rewiring cable etc. it started to work. I was able to write operable boot floppy from image as shown below. May be some parameters are excessive but huh it works like this.

write_bk.bat

fluxengine.exe write bk800 --drive.rotational_period_ms=200 --encoder.ibm.trackdata.target_clock_period_us=4 -i "%1"  --usb.greaseweazle.port=COM9

I succeeded using EPSON SD800 double 5.25+3.5 FDD with jumpers SS2 set to D and L and rewiring cable line 10 to pin 14 at FDD connector. For other FDD models line 10 shold be connected to pin 12 at FDD

Sorry for misinforming. FluxEngine works well (except for GUI) Thank you!

nightgryphon commented 1 year ago

It seems floppies written on PC with fluxengine are less reliable than ones written by BK0010 itself. So i write disks from images with fluxengine and than duplicate them on BK using "Disk Xerox" software. I can't find the exact reason for that behavior as i use the same floppy drive (reconnect) on PC an BK

I can read/upload diskette image formatted by BK if that can help. I use greaseweazle based on STM32F103 blue pill board. What is the recommended command to read floppy image to check format/compatibility ?

davidgiven commented 1 year ago

This could be one of several issues:

Is there anything that the failures have in common, such as track number, sector number, etc?

merclangrat commented 11 months ago

@nightgryphon that's great to know and thanks for your research!

I am using FluxEngine with GreaseWeazle based on STM32F403 and BK-0010-01 with SMK-512, most of diskettes work well but yes, sometimes I have issues too.

@davidgiven your code doesn't seem to be broken, I think you know better about floppy drives pecularities. The written diskettes may be less reliable because of those.

if I try to write a HD (1.2Mb) diskette by FluxEngine, I can't read it on BK. Also, the same issue was if I tried to write a 720Kb diskette on 1.2MB floppy drive. But that's expected, I guess. I had to spend some time too to configure my the second 5.25" floppy to work well with BK diskettes.

davidgiven commented 11 months ago

I wouldn't be at all surprised if the code was broken! It might also be because there's no write precompensation implemented yet.

FluxEngine always checks to make sure the write succeeded, so we know the disks can read back on the FE itself, so there's something about what the BK is expecting. It's worth using the flux explorer (click on a track after doing a read) to check the gap lengths between disks written with FE and disks written with the BK.