flashreader


Nameflashreader JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryRead/write i2c & spi memory chipsets (Flash & EEPROM)
upload_time2024-09-22 18:45:53
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT License Copyright (c) 2024 o0zz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords i2c spi eeprom flash rpi flashreader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Flash Reader
Flash Reader allows to read and/or write any EEPROM or Flash memory via SPI or I2C.
This library is particularly useful in case of reverse engineering or prototyping for embedded systems (RPI, etc..).

```
from flashreader.memory import spiflash, m95, mx25, w25q, _24lc, _25lc, _25aa
from flashreader.platform import ft232h, raspberrypi

with ft232h.Platform() as platform: #Open FT232H adapter
    with spiflash.Memory(platform) as memory: #Open generic SPI flash
        print(f"Writing hello world @0x0000...")
        memory.write(0x0000, b'Hello World')

        buf = bytearray(memory.read(0x00000000, 11))
        print(f"Read @0x0000: {buf}")
```

## Supported platform
- [x] Raspberry pi 4
- [x] FT232H ([Adafruit](https://www.adafruit.com/product/2264))

## Support memory
- [x] Various spi serial flash
- [x] Macronix mx25R..., mx25L...
- [x] Microchip 25aa..., 25lc...
- [x] Winbond w25q...
- [x] Microchip 24lc...
- [x] ST m95...

## Quick start (Raspberry pi 4)
### Setup Raspbian

```
apt-get install python3 python3-pip python3-spidev python3-monotonic
sudo raspi-config
```
- Go to "Interfacing Options" > "SPI" > "Enable"
- Reboot the RPI

### Wiring
- **SPI:** PIN19(MOSI), PIN21(MISO), PIN23(SCK), PIN11(CS)
- **I2C:** PIN3(SDA), PIN5(SCL)

## Quick start (Windows)
### Setup Windows
- Plug FT232H
- Use Zadig (https://zadig.akeo.ie/), select the USB device in the list, select libusb-win32 and replace the driver (DO NOT USE WINUSB or any other driver).

### Wiring
- **SPI:** D0(SCK), D1(MOSI), D2(MISO), D3(CS)
- **I2C:** D0(SCL), D1(SDA)

## Run
Read spi flash (By using generic driver: spiflash)

`python -m flashreader --platform raspberrypi --memory spiflash --read ./dump.bin --offset 0`

Write spi flash (By using generic driver: spiflash)

`python -m flashreader --platform raspberrypi --memory spiflash --write ./dump.bin --offset 0`


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flashreader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "i2c, spi, eeprom, flash, rpi, flashreader",
    "author": null,
    "author_email": "o0Zz <--@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/03/46/4635a7f212068b59d90302e5ce16068ba7e99b906aadde4c6e2cc2fd0d54/flashreader-1.1.0.tar.gz",
    "platform": null,
    "description": "# Python Flash Reader\r\nFlash Reader allows to read and/or write any EEPROM or Flash memory via SPI or I2C.\r\nThis library is particularly useful in case of reverse engineering or prototyping for embedded systems (RPI, etc..).\r\n\r\n```\r\nfrom flashreader.memory import spiflash, m95, mx25, w25q, _24lc, _25lc, _25aa\r\nfrom flashreader.platform import ft232h, raspberrypi\r\n\r\nwith ft232h.Platform() as platform: #Open FT232H adapter\r\n    with spiflash.Memory(platform) as memory: #Open generic SPI flash\r\n        print(f\"Writing hello world @0x0000...\")\r\n        memory.write(0x0000, b'Hello World')\r\n\r\n        buf = bytearray(memory.read(0x00000000, 11))\r\n        print(f\"Read @0x0000: {buf}\")\r\n```\r\n\r\n## Supported platform\r\n- [x] Raspberry pi 4\r\n- [x] FT232H ([Adafruit](https://www.adafruit.com/product/2264))\r\n\r\n## Support memory\r\n- [x] Various spi serial flash\r\n- [x] Macronix mx25R..., mx25L...\r\n- [x] Microchip 25aa..., 25lc...\r\n- [x] Winbond w25q...\r\n- [x] Microchip 24lc...\r\n- [x] ST m95...\r\n\r\n## Quick start (Raspberry pi 4)\r\n### Setup Raspbian\r\n\r\n```\r\napt-get install python3 python3-pip python3-spidev python3-monotonic\r\nsudo raspi-config\r\n```\r\n- Go to \"Interfacing Options\" > \"SPI\" > \"Enable\"\r\n- Reboot the RPI\r\n\r\n### Wiring\r\n- **SPI:** PIN19(MOSI), PIN21(MISO), PIN23(SCK), PIN11(CS)\r\n- **I2C:** PIN3(SDA), PIN5(SCL)\r\n\r\n## Quick start (Windows)\r\n### Setup Windows\r\n- Plug FT232H\r\n- Use Zadig (https://zadig.akeo.ie/), select the USB device in the list, select libusb-win32 and replace the driver (DO NOT USE WINUSB or any other driver).\r\n\r\n### Wiring\r\n- **SPI:** D0(SCK), D1(MOSI), D2(MISO), D3(CS)\r\n- **I2C:** D0(SCL), D1(SDA)\r\n\r\n## Run\r\nRead spi flash (By using generic driver: spiflash)\r\n\r\n`python -m flashreader --platform raspberrypi --memory spiflash --read ./dump.bin --offset 0`\r\n\r\nWrite spi flash (By using generic driver: spiflash)\r\n\r\n`python -m flashreader --platform raspberrypi --memory spiflash --write ./dump.bin --offset 0`\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 o0zz  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Read/write i2c & spi memory chipsets (Flash & EEPROM)",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/o0Zz/flashreader"
    },
    "split_keywords": [
        "i2c",
        " spi",
        " eeprom",
        " flash",
        " rpi",
        " flashreader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a639fe1db13a8e3364c7c98823ac3eca734cd5ea2ee6008287fa3bb1ab999c0b",
                "md5": "f879a08b1ee359f1db632cbd7d3b9eb1",
                "sha256": "22f32a0d442a2471cc5f6a6d34a593ce3b6d8c1fc48b787be7feea22bdeb5995"
            },
            "downloads": -1,
            "filename": "flashreader-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f879a08b1ee359f1db632cbd7d3b9eb1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11903,
            "upload_time": "2024-09-22T18:45:51",
            "upload_time_iso_8601": "2024-09-22T18:45:51.881358Z",
            "url": "https://files.pythonhosted.org/packages/a6/39/fe1db13a8e3364c7c98823ac3eca734cd5ea2ee6008287fa3bb1ab999c0b/flashreader-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03464635a7f212068b59d90302e5ce16068ba7e99b906aadde4c6e2cc2fd0d54",
                "md5": "3206f3acfb0fd208c1fa0d30448553ad",
                "sha256": "f7c1676f78ed53badc6fd819f9d6f1d271373ff3c7720d65b183eb1d0edc6890"
            },
            "downloads": -1,
            "filename": "flashreader-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3206f3acfb0fd208c1fa0d30448553ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10436,
            "upload_time": "2024-09-22T18:45:53",
            "upload_time_iso_8601": "2024-09-22T18:45:53.553165Z",
            "url": "https://files.pythonhosted.org/packages/03/46/4635a7f212068b59d90302e5ce16068ba7e99b906aadde4c6e2cc2fd0d54/flashreader-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-22 18:45:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "o0Zz",
    "github_project": "flashreader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flashreader"
}
        
Elapsed time: 1.24709s