JoeliPikkarainen / AT28C256

This is project to program AT28C256 EEPROM with ATmega 2560
2 stars 0 forks source link

Can't program bin file #1

Open esalgado opened 2 years ago

esalgado commented 2 years ago

Hello! Thanks for this project, I wired my Mega in 10 minutes and successfully read/wrote the AT28 chip using the test function.

I have some difficulties flashing a bin file, that is like this:

~/Descargas $ hexdump rom.bin 0000000 ffa9 028d a960 8d55 6000 aaa9 008d 4c60 0000010 8005 eaea eaea eaea eaea eaea eaea eaea 0000020 eaea eaea eaea eaea eaea eaea eaea eaea * 0007ff0 eaea eaea eaea eaea eaea eaea 8000 eaea 0008000

All I get from the flashing is zeros, even if it apparently detects the data OK as seen by the data interpreted, i.e addr 0 data 169, corresponds to A9 addr 1 data 255, that corresponds to FF addr 2 data 141, that corresponds to 8D etc.

see here the output: output

what am I doing wrong? Thanks a lot in advance :)

JoeliPikkarainen commented 2 years ago

Hello Edgar,

If you tried flashing with the latest python tool from master It is likely that the file flashing function is broken. See the commit master:9d2578f492869edaaa57abbfff83823f0b5dd0c3

commit 9d2578f492869edaaa57abbfff83823f0b5dd0c3 (HEAD -> master, origin/master, origin/HEAD) Author: Joeli Pikkarainen @.***> Date: Fri Jul 3 00:59:03 2020 +0300

Migrate to python3

py-flash-file not working, currently

If you check out a commit before the python 3 migration commit you might be able to flash the file. (Offcourse use python 2.7 env then.)

I also added new branch development that had some changes to the latest master, dont know if it made it work but you can try if you like.

I don't currently have the required hardware to test the setup. But if you send me the logs again I might be able to help you troubleshoot.

Message me back about your results.

Br, Joeli Pikkarainen


Lähettäjä: Edgar Salgado @.> Lähetetty: torstai 3. marraskuuta 2022 0.42 Vastaanottaja: JoeliPikkarainen/AT28C256 @.> Kopio: Subscribed @.***> Aihe: [JoeliPikkarainen/AT28C256] Can't program bin file (Issue #1)

Hello! Thanks for this project, I wired my Mega in 10 minutes and successfully read/wrote the AT28 chip using the test function.

I have some difficulties flashing a bin file, that is like this:

~/Descargas $ hexdump rom.bin 0000000 ffa9 028d a960 8d55 6000 aaa9 008d 4c60 0000010 8005 eaea eaea eaea eaea eaea eaea eaea 0000020 eaea eaea eaea eaea eaea eaea eaea eaea * 0007ff0 eaea eaea eaea eaea eaea eaea 8000 eaea 0008000

All I get from the flashing is zeros, even if it apparently detects the data OK as seen by the data interpreted, i.e addr 0 data 169, corresponds to A9 addr 1 data 255, that corresponds to FF addr 2 data 141, that corresponds to 8D etc.

see here the output: https://hastebin.com/ajoqocezis.yaml

what am I doing wrong? Thanks a lot in advance :)

— Reply to this email directly, view it on GitHubhttps://github.com/JoeliPikkarainen/AT28C256/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACD32DZLEN27EKUOO3QT623WGLU7DANCNFSM6AAAAAARVSQKCQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

esalgado commented 2 years ago

Thanks for your answer Joeli :)

I tried the develop branch, but I need to go to python/old for it to run, the command-handler.py in the python folder is almost empty, and it has a dash, and not an underscore.

When runing from python/old folder:

~/Descargas/AT28C256/python/old ‹develop*› $ python serial_commander.py 130 ↵

Python Serial Commander for project AT28C256 sources: https://github.com/JoeliPikkarainen/AT28C256 use "pyfuncs" to enter PC command interface Connecting to tty device....

EEPROM flasher for AT28C256 Version: 0.0.0 Joeli Pikkarainen Finland 2020 https://github.com/JoeliPikkarainen/AT28C256 EEPROM-FLASHER ----COMMANDS---- flash-file read-eeprom write-test flash-reset-vector help pyfuncs Python methods: py-flash-file py-flash-file path to file: /home/esalgado/Descargas/eeprom/rom.bin py_internal_do_flash<built-in method decode of bytes object at 0x7f0384cc58b0>addr 0 data 169 addr 0 data 255

Traceback (most recent call last): File "/home/esalgado/Descargas/AT28C256/python/old/serial_commander.py", line 106, in use_serial() File "/home/esalgado/Descargas/AT28C256/python/old/serial_commander.py", line 22, in use_serial py_funcs() File "/home/esalgado/Descargas/AT28C256/python/old/serial_commander.py", line 40, in py_funcs py_flash_file() File "/home/esalgado/Descargas/AT28C256/python/old/serial_commander.py", line 54, in py_flash_file py_internal_do_flash(hex_data) File "/home/esalgado/Descargas/AT28C256/python/old/serial_commander.py", line 81, in py_internal_do_flash prnt("e addr %d data %d" % (i,byte1e)) TypeError: %d format: a real number is required, not bytes ~/Descargas/AT28C256/python/old ‹develop*› $

I change the line 81 and 82 to: prnt("e addr %d data %d" % (i,int.from_bytes(byte1e, "big"))) prnt("e addr %d data %d" % (i,int.from_bytes(byte2e, "big")))

and I get this: ` py-flash-file path to file: /home/esalgado/Descargas/eeprom/rom.bin py_internal_do_flash<built-in method decode of bytes object at 0x7fc1167c99f0>addr 0 data 169 addr 0 data 255

e addr 0 data 102e addr 0 data 108addr 1 data 255 addr 1 data 141

e addr 1 data 97e addr 1 data 115addr 2 data 141 addr 2 data 2

e addr 2 data 104e addr 2 data 45addr 3 data 2 addr 3 data 96

e addr 3 data 102e addr 3 data 105addr 4 data 96 addr 4 data 169

e addr 4 data 108e addr 4 data 101addr 5 data 169 addr 5 data 85

e addr 5 data 10e addr 5 data 119addr 6 data 85 addr 6 data 141

e addr 6 data 97e addr 6 data 105addr 7 data 141 addr 7 data 0

e addr 7 data 116e addr 7 data 105addr 8 data 0 addr 8 data 96

e addr 8 data 110e addr 8 data 103addr 9 data 96 addr 9 data 169

e addr 9 data 32e addr 9 data 102addr 10 data 169 addr 10 data 170

e addr 10 data 111e addr 10 data 114addr 11 data 170 addr 11 data 141

e addr 11 data 32e addr 11 data 104addr 12 data 141 addr 12 data 0

e addr 12 data 101e addr 12 data 120addr 13 data 0 addr 13 data 96

e addr 13 data 32e addr 13 data 102addr 14 data 96 addr 14 data 76

e addr 14 data 105e addr 14 data 108addr 15 data 76 addr 15 data 5

e addr 15 data 101e addr 15 data 13addr 16 data 5 addr 16 data 128

e addr 16 data 10e addr 16 data 70addr 17 data 128 addr 17 data 234

e addr 17 data 108e addr 17 data 97addr 18 data 234 addr 18 data 234

e addr 18 data 115e addr 18 data 104addr 19 data 234 addr 19 data 234

e addr 19 data 105e addr 19 data 110addr 20 data 234 addr 20 data 234

e addr 20 data 103e addr 20 data 46addr 21 data 234 addr 21 data 234

e addr 21 data 46e addr 21 data 46addr 22 data 234 addr 22 data 234

e addr 22 data 13e addr 22 data 10addr 23 data 234 addr 23 data 234 `

It hangs at address 23!

Then I do a read-eeprom, and it is all blanks.

The write-test runs well, it fills the first bytes with 0, 1, 2, 3, 4, etc, and I can read them back again.

I have flashed the firmware in the develop branch!

I will try to test with the previous 2.7 python version, but I need to set up the environment, my distribution does not have pip 2.7, so I can't install pyserial 2.7 :/

I will report back :)

JoeliPikkarainen commented 1 year ago

Latest master commit has a more robust method for flashing and reading.

python3 serial-commander.py pyfuncs 2