Coder Social home page Coder Social logo

ch341prog's People

Contributors

astralix avatar cg9999 avatar danielkucera avatar dougg3 avatar dronov avatar ermito avatar fftmp avatar iglooom avatar jelmert avatar nes0 avatar setarcos avatar ssomov avatar zensey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ch341prog's Issues

Select which CH341 to use

As mentioned in the libusb docs, libusb_open_device_with_vid_pid is nice for simple tests but too limited for serious use. Is any somewhat experienced C programmer reading who could upgrade our detection so I can select a specific CH341A via bus number and device number?
I might try and implement it myself but it's a long time since I've last dealt with C, so not sure if my attempt will be as helpful as I'd hope. (Usually I use python for USB stuff.)

BUG: the code used to verify a just written firmware doesn't work properly

The code added with this commit doesn't find any error even if the firmware has been corrupted during the write process.
The issue is here:

int ch1, ch2;
ch1 = getc(fp);
ch2 = getc(test_file);

while ((ch1 != EOF) && (ch2 != EOF) && (ch1 == ch2)) {
    ch1 = getc(fp);
    ch2 = getc(test_file);
}

The "start of file" pointers of FILE * variables are not reset before start the test. ch1 and ch2 are always equal to EOF so the test exit always without find any errors.

To solve the BUG you have to modify the code in this way:

fseek(fp, 0, SEEK_SET);
fseek(test_file, 0, SEEK_SET);

int ch1, ch2;
ch1 = getc(fp);
ch2 = getc(test_file);

while ((ch1 != EOF) && (ch2 != EOF) && (ch1 == ch2)) {
    ch1 = getc(fp);
    ch2 = getc(test_file);
}

You have also to modify the mode used to open the test_filename file from:

test_file = fopen(test_filename, "wb");

to:

test_file = fopen(test_filename, "w+b");

In this way the verification of a written firmware works fine! ;-)

Could you add this patch to your code?
Thanks...
Gianluca

I2C EEPROM Detection

I guess your Project supports the flashing of i2c eeproms.
But for me, only SPI ones got detected. Is there anything i have to set to use i2c?

ETA goes negative

When writing large flash chips, the ETA displayed in verbose mode goes negative.

The problem is integer overflow when calculating the ETA time:
(int) ( (dur*size*1.0)/done-dur))

When dur*size > 2^31 (such as size = 8MB and dur > 256s), this overflows signed integers before being cast to double, so the ETAs for the second half of the write are negative nonsense.

(i get bored waiting on the flash to write)

Awesome job!

Awesome job also it works on MacOS.

Thanks a lot.

Wrong offset when reading over SPI

Hi
I'm working with MX25L25735FMI FLASH chip, trying to read it's content over SPI. And I noticed that offset command works in some weird way way:
--offset 1 will give offset of 0h100 bytes instead of 1 byte
--offset 2 will give offset of 0h200 bytes instead of 2 bytes
and so on.
Is there any way to set offset for reading in bytes instead of hex hundreds of bytes?
Thanks.

Which chips get detected?

Hello,
I had a query that are there some specific eeprom chips that are detected. I tried with SPI EEPROM 25LC256 , checked connection properly but device was not detected.

Thanks & Regards
Asmita

Incopatible programmer

Hello. I have CH341 programmer from ebay, but it not work with this software.

$ lsusb
Bus 001 Device 005: ID 1a86:5523 QinHeng Electronics CH341 in serial mode, usb to serial port converter

This software work only with 1a86:5512. It can be modified to work with 1a86:5523?

My programmer is bought http://www.ebay.com/itm/201364328713

Many thanks!

Change github About

  1. I make tags using Wikipedia... I suggest to add this tags:
    chip-programmer
    prom-writer

  2. Please rename
    CH341a
    to
    CH341A
    According to doc

chip erase timeout

when i try to erase some 25q128, sometimes an error appears after a some minuts:
chip erase timeout.

compatibility with 24c02

Hello,
I have a ch341 usb adapter (1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter).
When I run your program all the information are wrong (ff).
The program gave me the error "No CFI structure found, trying to get capacity from device ID. Set manually if detection fails."
If I set manually the length in bytes (2048) the result don't change.
What I have to make to solve?

The eeprom is a pc2400 (24c02),
Thank you and compliments for your program,
cheers,
Paolo

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.