Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "EraseFlux" command to greaseweazle firmware #43

Open
gilmod714 opened this issue Dec 21, 2024 · 3 comments
Open

Add "EraseFlux" command to greaseweazle firmware #43

gilmod714 opened this issue Dec 21, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@gilmod714
Copy link

gilmod714 commented Dec 21, 2024

I built the pi pico GW version and it works OK for read/write with 4.7k pullup resistor on read-data line (it's a bit slow, but it works) , however, I noticed that, the "erase" disk function does not work, or not supported ?!

gw.exe erase --device=COM44

Great work by the way ..

Thank you

@criscrafter
Copy link

Are you pulling the pin up to 5V or 3.3V?
Sadly I don't have a solution for you, but I can't get mine to work...

@gilmod714
Copy link
Author

I'm using 3.3v pull .. but I don't think it's that .. it seems to me the "erase" function isn't included in the sketch! .. the read/write works ok though .. but much slower than the stm32 for sure.. I'm using RP2040 zero/and also tried it on pi pico ..

erase1

erase2

erase3

@jepler jepler added enhancement New feature or request help wanted Extra attention is needed labels Dec 23, 2024
@jepler jepler changed the title No Erase in gw ?! Add "EraseFlux" command to greaseweazle firmware Dec 23, 2024
@jepler
Copy link
Member

jepler commented Dec 23, 2024

EraseFlux (command #17) is not presently supported by our gw-compatible firmware.

In the official gw firmware, it appears this mode works simply by turning on the write gate and leaving it on for a specified time:

/*
 * ERASE PATH
 */

static uint8_t floppy_erase_prep(const struct gw_erase_flux *ef)
{
    op_delay_wait(DELAY_write);

    if (get_wrprot() == LOW)
        return ACK_WRPROT;

    write_pin(wgate, TRUE);

    floppy_state = ST_erase_flux;
    flux_op.status = ACK_OKAY;
    flux_op.end = time_now() + time_from_samples(ef->ticks);

    return ACK_OKAY;
}

static void floppy_erase(void)
{
    if (time_since(flux_op.end) < 0)
        return;

    floppy_flux_end();

    /* ACK with Status byte. */
    u_buf[0] = flux_op.status;
    floppy_state = ST_command_wait;
    floppy_end_command(u_buf, 1);
}```

I've marked this "help wanted" because I'd be thrilled if someone contributed the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants