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

Reading memory results in exception #16

Closed
svenKautlenbach opened this issue Feb 18, 2015 · 8 comments
Closed

Reading memory results in exception #16

svenKautlenbach opened this issue Feb 18, 2015 · 8 comments
Assignees

Comments

@svenKautlenbach
Copy link

When trying to read memory I get "ERROR: ord() expected string of length 1, but int found".
When removing the mdebug at the read section, I get similar error when it tries to write data to file - "ERROR: sequence item 0: expected string, int found".

@svenKautlenbach
Copy link
Author

Ok, I think I managed to get it correct. Maybe it is the fault of python 2.7?
mdebug(5, " 0x%x: 0x%02x%02x%02x%02x" % (conf['address']+(i*4), rdata[3], rdata[2], rdata[1], rdata[0]), '\r')
file(args[0], 'ab').write(''.join(str(reversed(rdata))))

@JelmerT
Copy link
Owner

JelmerT commented Feb 19, 2015

Interesting bug, thanks for reporting it.

Are you getting back the correct data after making your proposed fix? It sounds to me that cmdMemRead is returning something that it shouldn't into rdata

@JelmerT JelmerT self-assigned this Feb 19, 2015
@svenKautlenbach
Copy link
Author

Hi!

Sorry for slow response.
Actually this fix did not work, it just enabled to run the script with no problems, but inside the memory file was still incorrect data. And I have lost the file now, but there was text something about the iterator or object at 0x######. Can you assert which python version you are specifically running.

@JelmerT
Copy link
Owner

JelmerT commented Mar 16, 2015

The script should work with both 2.7 and 3.4.
Are you maybe willing to share the firmware file with me, so I can try to reproduce the error? If you still have it.

@svenKautlenbach
Copy link
Author

It is Contiki build, I simply am not allowed to share the specific binaries :(

@JelmerT
Copy link
Owner

JelmerT commented Mar 20, 2015

I understand, can you share the command you used to try to read the memory? Could have something to do with the length and location.

@svenKautlenbach
Copy link
Author

Sorry all gone by now. I will try to reproduce it when I have time, I will just try out and experiment with the script. Could you please hold on for now?

@JelmerT
Copy link
Owner

JelmerT commented Apr 17, 2015

No problem, I'll close this for now, feel free to comment when you come across the problem again.

@JelmerT JelmerT closed this as completed Apr 17, 2015
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

2 participants