Giter Club home page Giter Club logo

Comments (9)

spth avatar spth commented on May 31, 2024

I tried with two PL2303 cables, both made by VTOP, and see exactly the same problem on both.

I'll get a few USB-RS232 adapters with other chipsets to see if the problem is chipset-specific vs. happening with all USB-serial adapters - serial programming cable combinations.

On the other hand, I do not see such a problem with the USB programming cable from Digi, which apparently uses an FT232RL internally.

from openrabbit.

tomlogic avatar tomlogic commented on May 31, 2024

You might need to make tcdrain() a compile-time option. In my initial Windows test, processor verification errors out almost immediately.

reset rabbit
loaded 873 bytes from ../../../DCRABBIT_9.62/Bios/coldload.bin
flushing data for baudrate set
set baudrate to 2400
Warning: Processor verification sequence failed!
Error: Status line should be low before sending initial loader.

Or maybe not. Even with reverting back to usleep(15000) it failed. I'm guessing it's something with the serial ioctl code. I'll try to do a serial port capture later to see what's happening.

Edit: Oops, it wasn't even getting to the part where it sends coldload.bin. When I added some debug printf() calls, I found that it wasn't reading DSR (TIOCMGET never set TIOCM_DSR).

from openrabbit.

spth avatar spth commented on May 31, 2024

I've now tried PL2303RA, PL2303GT and PL2303TA. Neither works (only checked with the tcdrain codepath).

Intend to test with some non-Prolific chips (CH340G and FT231XS) later.

Wonder if this is a hardware shortcoming vs. a Linux driver issue.

from openrabbit.

spth avatar spth commented on May 31, 2024

The old usleep(15000) method works with PL2303GT and PL2303TA, but not PL2303RA.

from openrabbit.

tomlogic avatar tomlogic commented on May 31, 2024

For more reliability, we may have to take a current time reading, send the serial data, and then have a timeout based on start_time_ms + bytes_sent * ms_per_byte + timeout_ms. Wait for the STATUS line to change or for the current time to exceed the calculated timeout. In the calculation, timeout_ms would allow for some leeway and be at least 100ms, maybe longer.

from openrabbit.

spth avatar spth commented on May 31, 2024

For now, I'm wondering if there is a bug in the PL2303 Linux driver, so I opened a ticket there:
https://bugzilla.kernel.org/show_bug.cgi?id=209359

But even if that one gets fixed or we implement a workaround, there is still the checkum error with PL2303RA.

from openrabbit.

tomlogic avatar tomlogic commented on May 31, 2024

We might want to add a verbose mode, or some sort of logging to aid in debugging. It'd be interesting to see ALL bytes that come back. I know that the RFU code flushes the receive buffer before it expects the target to send any data, and we might want to do that right before "Tell her we're done with initial loader." in rabbit.c.

It might be necessary to use a logic probe to monitor the TX/RX pins of the programming cable to see what actually goes out on the wire. There are some options for monitoring data sent to/from the tty, but that all happens before the Linux driver.

from openrabbit.

spth avatar spth commented on May 31, 2024

Just to document this somewhere:

All the PL2303 I tested had the same idProduct. But they had different bcdDevice:

PL2303RA: 4.00
PL2303GT: 3.05
PL2303TA: 3.00

from openrabbit.

spth avatar spth commented on May 31, 2024

In 9fcddfe a --slow option has been implemented for the usleep()-fallback.

from openrabbit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.