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

New functionality to allow reading flash memory and to query chip id/revision #27

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tjko
Copy link

@tjko tjko commented May 11, 2020

In case you find this useful. This change add additional functionality to CCLoader to also read/dump flash from C254x chips (if flash is not protected) as well as to identify chip and its revision. Read functionality was tested by successfully backing up latest MH-10 firmware from a MH-10 unit.

Usage: ./ccloader_tng <serialport> <device> <command> [<bin file> [<verify> | <read_start_block> <read_blocks>]]
Examples:
Read Chip ID: ./ccloader_tng /dev/ttyUSB0 1 id
 Write Flash: ./ccloader_tng /dev/ttyUSB0 1 write flash.bin 1
  Read Flash: ./ccloader_tng /dev/ttyUSB0 1 read dump.bin 0 512
Example: ./ccloader_tng /dev/ttyUSB0 1 id
          <device>: 0 -- Default (e.g. UNO)
                    1 -- Leonardo/Mini Pro/etc...
          <verify>: 0 -- No verify (default)
                    1 -- Verify (when flashing)
 <read_stat_block>: 0 -- Start flash dump from block (0 = beginning of the flash)
     <read_blocks>: 512 -- How many blocks to read (512 = 256Kb)

Note! This merge request only contains updated Arduino sketch as well as updated Linux command line tool. (Windows/MacOSX tools would need to be updated to work with the enhanced Arduino sketch...)

@AranVink
Copy link

Thanks for this, exactly what I was looking for! Thought about implementing this after looking at the code in main but you beat me to it 👍
If it works out for me then I'll create a PR to add the Windows/MacOSX to your PR so it works across all platforms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants