Attention is currently required from: Thomas Heijligen, Angel Pons, qianfan, Anastasia Klimchuk.
2 comments:
File ch347_spi.c:
Patch Set #3, Line 69: free(data);
Do you have to free this? `ch341a_spi` does not, but `ft2232_spi` does.
Both my code and `ft2232_spi` allocate memory for the data passed around in flashctx, so I would think that memory should be freed later. `ch341a_spi` doesn't free anything because it doesn't pass around data in flashctx and thus there isn't anything to free in the first place.
Patch Set #3, Line 261: 64 * 1024
Where does this come from?
With the CH347, you can basically read an unlimited amount of bytes with one command. The read command accepts a 32 bit unsigned value representing the number of bytes that requested, and then you just continually issue USB_BULK_IN transfers until it has returned that number of bytes. I just chose some decently large number (it's the same as what the ft2232 chooses), and chose the same value for writes (for writes, you just continually issue write commands with a little over 500 bytes of payload data each until you've sent out all the bits you need) 64k is probably a bit overkill though for writes, as for SPI flash I think the most number of bytes would be a page program, which generally seem to be 256 bytes/page)
To view, visit change 70573. To unsubscribe, or for help writing mail filters, visit settings.