Gosh, this is a fast moving thread.
I'll try to address some of the dangling points...
gfoot wrote:
Nice! Some corrections/additions
I've made those changes.
gfoot wrote:
hoglet wrote:
Jumper J2 must be fitted, otherwise captures from fx2pipe will not work.
Other way around - it must
not be fitted. I used it instead to bridge from SLWR to GND which was quite convenient!
I really don't understand why it's this way around.
There is an obvious difference between the boards:
- LCSoft: A0 is intenally pulled down by the EEPROM, and the jumper connects it to VCC
- Geeetech: A0 is externally pulled up by R1, and the jumper connects it to GND
I've been trying to work out what effect A0 has on the FX2. A0 is part of the EEPROM device address (on the I2C bus). So changing A0 (with A1/2 unconnected) is changing the device address between 000 and 001.
The
FX2 Technical Reference Manual explains this on page 192. The idea is to allow the FX2 to be compatible with both small and large EEPROMs. Small EEPROMS use 8-bit addresses and large EEPROMs use 16-bit EEPROMS.
As far as I can see, all these boards are fitted with AT24C128 EEPROMs, which are large. To support these A0 should be high (device address 001).
On the LCSoft board, fitting the jumper connects A0 to VCC, allowing the device configuraion to be correctly read from the (large) EEPROM. That's consistent with my observations that when the jumper is fitted, the USB VID/PID changes to a non-Cypress ID.
On the Geeetech board, fitting the jumper connects A0 to GND, which should inhibit reading of the (large) EEPROM. I would expect this to be the setting where fx2pipe works. But it seems the oppositite is true. i.e. fx2pipe is only working when the jumper is missing.
I really don't understand how this is possible, because with the EEPROM inhibited both boards should be identical.
The only possibility I can think of is that your EEPROM is a fake. i.e. it uses an 8-bit address, even though it's marked as a 24C128.
gfoot wrote:
Regarding the issue with my reset sequence, my guess is that when my system is running from ROM the extensive clock-stretching is upsetting the FX2, perhaps because the clock has a very skewed duty cycle and very long high periods that may be equivalent to the high periods of a regular 4MHz clock, and that's below the specified 5MHz.
Yesterday I explored the valid clock ranges with a signal generator. In slave synchronous mode, when the clock is reduced, at about 3.9MHz the data transfer stops, and the FX2 appears to hang until the next reset.
Paganini wrote:
Interesting. The capture I just posted above was at 8MHz, with Ø2 connected to RDY0 (or RDY1 or whatever) using fx2pipe -a. I haven't tried to go faster than that, but I didn't realize I was already breaking the speed limit!
This is consistent with what I observed yesterday. I think I got to about 10MHz before it looked like data was being dropped. I imagine 8MHz would be fine.
gfoot wrote:
I'm sure Dave has seen this before, where it dumps some stale data at the start. Perhaps he remembers what caused it. There is a --skip option to the decoder but I have a feeling it doesn't work with these synchronous captures, only with the async ones. You can use "dd" to cut some bytes off the start though if necessary - or just ignore everything the decoder says until after the reset, like you did.
Yes, I see this frequently.
It looks like there is still a bug where the first 16KB of data received is stale.
So it looks either the firmware's FIFORESET sequence is not reliably resetting the endpoint, or this data is somehow getting buffered in the host's USB stack.
I often add the --skip=4000 parameter to decode6502 (the value is hex).
This should work regardless of the capture mode.
Dave