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

Python code does not properly calculate size / does not properly handle some devices #19

Open
dshadoff opened this issue Jul 1, 2019 · 3 comments

Comments

@dshadoff
Copy link

dshadoff commented Jul 1, 2019

While trying to identify/read a 8KB FeRAM device MB85RS64V, the JEDEC ID is properly identified (0x04 0x7F 0x03), but the python code then goes into an infinite loop grabbing JEDEC ID again and again instead of determining memory size (which is 64 kbit / 8KB).

Product was purchased here: https://www.adafruit.com/product/1897
Datasheet here: http://www.adafruit.com/datasheets/MB85RS64V-DS501-00015-4v0-E.pdf

Likewise, a 128KB FeRAM MR45V100A was properly identified as (0xae 0x83 0x09), but was improperly identified as 512 bytes (actual size = 1Mbit / 128KB).

@jamesbowman
Copy link
Owner

Fixed the infinite loop bug, and pushed to PyPI:
https://pypi.org/project/spidriver/

You can specify the size on the command-line using the -s argument, so for the MB85RS64V use -s 65536, and for MR45V100A -s 131072. This is meant for parts where the size isn't computable from the third ID byte, like these.

However reading further down the MB85RS64V datasheet, I see that it uses 16-bit addresses, and the flash tool assumes 24-bit addresses.
image

However the MR45V100A does use 24-bit addressing, so it might work - please let me know.
image

@dshadoff
Copy link
Author

dshadoff commented Jul 2, 2019

Thanks, the infinite loop bug appears to be fixed.

The third-byte size computation... may not be as straightforward as you had thought.
I tested a AT25SF041 (very common 4Mb / 512KB Flash), which has JEDEC ID (0x1f 0x84 0x01)... this clearly also doesn't follow your expected rules.

As a result, it would be helpful if the spidriver.pdf file could be updated with this point about memory size, including the '-s ' operand for the python script.

jamesbowman added a commit to jamesbowman/datasheets that referenced this issue Jul 2, 2019
@biboc
Copy link

biboc commented Nov 4, 2022

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

No branches or pull requests

3 participants