davidgiven / fluxengine

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

Building the client #249

Open Credominute opened 3 years ago

Credominute commented 3 years ago

Hi. I would like to build the client with make on MSYS2 but no target and makefile associated. I installed prerequisites after updating MSYS2, make, ninja, mingw-w64-i686-libusb, mingw-w64-i686-sqlite3, mingw-w64-i686-zlib, mingw-w64-i686-gcc for Windows with MSYS2 but if an executive fluxengine shoud have been created, how and what is that ? Otherwise, Cypress board has been flashed with FluxEngine.hex.

davidgiven commented 3 years ago

It should just be a matter of running make and everything should work --- the build script used by the continuous integration system is here: https://github.com/davidgiven/fluxengine/blob/master/.github/workflows/ccpp.yml

Can you post a build log?

Credominute commented 3 years ago

On Windows 10 I have set up msys2-x86_64-20210419, updating it (pacman -Syu, -Su), and using pacman -S to install all packages from make to ...gcc, takes some while, finally the result : "$ make make: *** No targets specified and no makefile found. Stop." on MSYS and MinGW 64bits command prompts...it is writtehn mingw32 is necessary but it comes with MYS2, right ? By the way can one cut parts of the CY8CKIT board after flashing it ?

davidgiven commented 3 years ago

Sorry, thought I'd replied to this but apparently I hadn't...

This may be a stupid question, but it looks like you're not in the right directory when running make, as it says it can't find the Makefile; could you do a pwd and a ls to make sure you're in the right place?

Credominute commented 3 years ago

I got message "/home/user" after doing pws and ls, next, I got same error with "make" than before. By the way, the script on build skips as all paches are now "up to date". MYS2 path is on C:/mys64 and the shell starts here.

davidgiven commented 3 years ago

Right, you're not in the FluxEngine directory. You will need to unzip the source code somewhere, then from the command prompt use cd to move into that directory. You need to be in the same directory as the makefile.

Credominute commented 3 years ago

Sure, but what is the FluxEngine directory to cd or where is the makefile to find ? I have the PSoC Programmer, FluxEngine.cydsn file used with it, and 3 programs from Fluxengine.zip unzipped also in MSYS2. What else is needed or is it something to do related to "actions/checkout@v1" in the script ?

davidgiven commented 3 years ago

It depends where you put the source when you unzipped it! Did you by any chance download the Windows binary package instead, which doesn't contain any source code?

Credominute commented 3 years ago

Things are not so bad as I suceeded to setup a 5,25 drive on traditionnal 34 pins nappe, takes some times though (jumpers to set up) and I can hear the good sound on those drives reading effectively 5,25 floppies. That being said, such expert level with code and so on is pretty much advanced but FC5025 being not shipped outside US and Greasewheazzle sold out by now, difficult to see another cheap solution to set up with an USB. I was wondering if it could be of use to install again MSYS 2 in another directory than C:/msys64 and look where is going "make ninja mingw-w64-i686-libusb mingw-w64-i686-sqlite3 mingw-w64-i686-zlib mingw-w64-cross-gcc zip" after command pacman -S ? What is the source you are talking to ? The only zipped folder was FluxEngine.zip, right ? Is it needed to put those files in a special directory ? I put them simply in C:/msys64

davidgiven commented 3 years ago

The source code is in the sourcecode.zip file here: https://github.com/davidgiven/fluxengine/releases/tag/dev

But it sounds like what you actually want is the precompiled binary in the fluxengine.zip, unless you want to modify the program itself.

Credominute commented 3 years ago

Thanks for reply. Yes, I can see, I did not unzipped the source code.zip which is named fluxengine-dev.zip as there is indeed a makefile there. I will proceed, and sorry if my reply takes time, time for hobby is scarce sometimes.

Credominute commented 3 years ago

I put fluxengine-dev into C:/msys64 and cd /c/msys64/fluxengine-dev for the directory using "make" but it triggers many "failed" (ninja build stopped : subcommand failed., 10 failed /383, Error 1). Complete function of make from the script given does the same. But what the point of doing all of this as the program "fluxengine.exe" exists already in the first file fluxengine.zip ?

davidgiven commented 3 years ago

You need to build it yourself if you're not running on Windows, or you want to modify the program in some way. It sounds like you just want to use the precompiled binary and don't need to build from source at all.

Credominute commented 3 years ago

OK, so no need as I am on Windows, better if I knew that from the beginning. Do you cut the Cypress board in two there ? Cables can be tricky indeed, I got a 5,25 drive with jumpers Mitsubishi MF503C and it accepts only a twisted cable with its 5,25 connector at the end (second 3,5), 5.25 as second (first 3,5) or only 5,25 will not work. The second Teac FD-55 GFR 140) I have has no jumpers.

davidgiven commented 3 years ago

You can cut it in two if you wish, but you'll need to wire the two halves together to reprogram it --- easier not to. Your floppy drive cable should have an IDC connector on the long end for connection to the motherboard, even if the two drive connectors are for 5.25" edge connectors. It's the motherboard connector which attaches to the board.

Credominute commented 3 years ago

So I pluggged the 5,25 drive with a floppy inside it (it turns then) and entered on the shell : "fluxengine rpm", result is : "Error : no USB devices fround (is one plugged in?) Do you have permission to access USB devices?". The board is grounded to the 5.25 drive and pin 33 of the connector also. I got the blue led on the board, so it is programmed. USB is connected from the board to thhe PC. Is my soldering not enough good ? A programming issue ? The type of cable - which would not astonish me - or something else ?

davidgiven commented 3 years ago

Make sure you're using the MicroUSB socket on the board, not the programming port. You should be able to see the board show up in the Device Manager as a Cowlark Technologies FluxEngine.

Credominute commented 3 years ago

The USB is connecting to the 5,25 drive (red ligh on) but indeed I am not seing at any place in Device Manager "Cowlark Technologies FluxEngine". I tried other MicroUSB cables, still 5,25 drive and board (blue LCD) recognize it, but nothing changes in Device Manager, of course there is this sound when introducing USB in PC : something is lacking for hardware to be recognized..

davidgiven commented 3 years ago

Hmm. It sounds like it's been programmed correctly. I'd like to double-check that you are using the MicroUSB socket and not the programming port --- you will have to remove some tape to get at it. The other thing is to figure out what's happening when it's plugged into the PC. Something should be appearing in the Device Manager. If you have access to a Linux device, it's generally easier to debug things there because there are useful messages in the system logs.

Credominute commented 3 years ago

Yes, I can find this evening (not this morning) some differences now in Device Manager : one is "composite USB device" in the port where the USB is connected and the second one, also in usb bus controler category, is "support usb printing". Down the Device Manager I can see also in universial serial bus peripherals category, "FluxEngine", which stays even if the usb is disconnected (only configuration, not that the device is started of course). No, only the MicroUSB from board....not the usb programming I did not cut, thanks. Doing "fluxengine rpm" is by now different. It says : "Using Fluxengine with serial number 6000020517160593 No index pulse detected from the disk. Common causes of this are: no drive is connected, the drive doesn't have an index sensor (...) the disk has no index holes (...) (most common) no disk is inserted in the drive! ...but of course there is a disk which is turning in the drive! I have a Linux Mint DVD in my hand and can put it on one of my hard disks if necessary.

davidgiven commented 3 years ago

Good; that means the computer can talk to the board, but the board can't talk to the drive. That's progress!

When you say the disk is turning, do you mean it's turning continuously, or only when you run a command? If it's running continuously, that means you've plugged the FluxEngine board in upside down (it's a common symptom).

Credominute commented 3 years ago

Previous error was caused by a bad USB -MicroUSB cable as others are not reproducing such mismatch. As for the drive to board connexion, I used three different cables but same error. By the way, test bandwidth shows 937 kB/s FluxEngine -> PC and 561 kB/s PC -> FluxEngine but it does not read anything on disk. Yes, it is running continuously when floppy is inserted and there are erratic light on on the drive, it switch on continuously if doing test bandwidth and on only two seconds when doing rpm. As for plugging board upside-down, I have followed the image given at "if you are using a connector - line up like this", no difference, and I have grounded pin 33 with drive and GND board before 1.7...

davidgiven commented 3 years ago

That's very peculiar. I suspect there is a wiring problem somewhere, but where it could be I don't know. Some 5.25" drives require termination resistors; sometimes they have termination resistors built-in, with jumpers to enable them. If you've got the datasheet for the drive, it's worth checking that.

Also, could you try fluxengine test voltages and then paste the output here? This will measure the signal level of various lines, and can be useful for diagnosing termination issues.

Credominute commented 3 years ago

The good : Mitsubishi MF504C 5,25 drive is working, rpm is 359,281, even, the type of cable seems of no importance for the fluxengine. The ugly : TEAC FD-55GFR 5,25 drive had its light on all the time with a traditionnal nappe , DC (Disk change) seemed on conflict with RY (Ready) jumpers. I disconnected RY one, and the icon 5,25 disk controller icon became present on Windows but I still cannot read disks (so the cable ?). I paste both 5,25 drive outputs with fluxengine text voltages, but the ugly one had its jumper on RY when test was performed. TEAC FD-55GFR Mitsubishi MF504C

Credominute commented 3 years ago

OK, the TEAC FD-55GFR 5,25 drive is now working with Fluxengine, rpm is again 359,281. Interesting enough, it is still not working with a traditionnal nappe, I have three cables and not a single one is working whereas one of the three only is working for the Mitsubishi MF504C. The reason why it was not working previously with Fluxengine is mechanical : the lever in the front of the 5,25 drive was removed from its original course, little damage from 40 years old use but not severe, necessary to see it and do some adjustment. By the way, the Mitsubishi drive had such similar issue, a needle was removed and lever was putting off : fragile aspect of 5.25 drives. As for the jumpers, easy to understand DS0 to 3 and dependency on type of cables and positions but the other jumpers, it changes from one drive to the another, well... Perhaps there is a proper setting of jumpers with nappe to make the TEAC work but Fluxengine is making it work.

davidgiven commented 3 years ago

Oh, good --- that's good to know. Yes, 5.25" drives are increasingly old! My two both failed a couple of years ago and it took me ages to realise that they just needed lubricating. http://youtube.com/watch?v=csryg56feu8

This does sound like a termination issue. The voltages show that in the second picture the output low voltage is 0.56V, where it should be lower than that. Unfortunately I don't have a lot of experience debugging this. There's some information here: https://www.retrotechnology.com/herbs_stuff/drive.html#term One thing you could try is, if you have a cable that also has 3.5" drive plugs, attaching one of those on drive 1. These are typically self-terminating and may just fix the problem. (This is also my setup.)

Regarding DSKCHG/READY: FluxEngine doesn't use this line at all, so it doesn't care about the jumper setting, but most PC FDCs require DSKCHG.

Credominute commented 3 years ago

Good video, as for a 3D printer, mechanical part is as much important than electronics and software. Terminaison as it is a big success, still, need to find where is ibm.img file ? But 98% of good reading despire alll my manipulations with peticulliar 5.25 disk ! I have already try to put 3.5 with 5,25 with traditionnal nappe actually but the PC could not resolve both, better to use external 3.5 here but I will try with Fluxengine. The output low voltage of 0.56V was for the drive which can work with traditionnal nappe, OK.

Credominute commented 3 years ago

Hi ! May I still comment here or introduce new issue about "using fluxengine" ? I may have no ibm.img file, as I said before, or where it is ? I can see a sector map, but that is all. What is the point of somewhat reading 5,25" disks without being able to read contents in them ? Did I miss something ? Some commands are not working, for exemple "fluxengine inspect", gives "Error : two flags use the name '-H'", "fluxengine upgradefluxfile", "Error : Syntax: fe-upgradefluxfile ". Right, it can read various formats, I tried indeed atarist, apple2, C64 and ibm, effective, but again I am looking to information in them : how extracting?

davidgiven commented 3 years ago

Sorry, I dropped your previous message on the floor...

It should indeed emit a file. However, it sounds like you're using the old client, and the syntax has changed a bit --- could you get the new one from the releases page, please? The syntax is:

fluxengine read ibm -s drive:0 -o ibm.img
Credominute commented 3 years ago

Thanks for reply. Indeed there is an updated package, upper command works this time, it seems to read better however compared to old fluxengine, which found 100% good sectors, this is by now only 87% on one particular (not important) disk. There is no ibm image file in the fluxengine folder or at the end of the script just "wrote 80 tracks, 2 sides, 1200 kB total", I have one image file but this was when I used Badcopy to retrieve some data from one slightly damaged 5,25 disk.

davidgiven commented 3 years ago

The image file (ibm.img) will be placed in the current directory when you run the command. Are you doing this from a Windows cmd.exe window?

Credominute commented 3 years ago

Yes, you are right, the ibm image was there. I confused with anotherr floppy disk drive where I can read through traditionnal way 5,25 disks. So the command worked this time, then a good update. The fact also is those old floppies are often damaged. A 40 years old floppy can be entirely intact, which is quite surprising, but the other one next to it can be severely damaged. I am cleaning disks and heads with isopropanol and using Badcopy, sometimes it works. Sure, it was Windows cmd.exe. You have no page for Atarist disks, there are often less damaged ones.