Skip to content

Conversation

@docprofsky
Copy link
Collaborator

The long awaited feature[citation needed] is finally here!
This adds the ability to edit memory with the hex editor.
Support for blacklisting of memory regions to edit is included. The blacklist is separate from the read blacklist.

Usage:
Set button enters and exits edit mode. In edit mode, the mode button will advance to the next digit.
The keypad is layed out as follows.

7 8 9 a
4 5 6 b
1 2 3 c
0 f e d

@travisgoodspeed
Copy link
Owner

Sweet!

Some quick questions, which might all have the same answer:

  1. What is the behavior when writing to ROM? 0x1000
  2. What is the behavior when writing to Flash? 0xFFBE
  3. What is the behavior when writing to unmapped memory? 0x7FFE

@docprofsky
Copy link
Collaborator Author

  1. Writing to ROM is not allowed, one can not enter edit mode. This prohibited in hex_can_edit(unsigned int adr)

  2. Not allowed, same reason.

  3. Writing is allowed, though it appears that no change occurs.

@travisgoodspeed
Copy link
Owner

Well yes, but what happens with a write that is not allowed? Is the write silently ignored or does the watch reboot?

@docprofsky
Copy link
Collaborator Author

When the write is not allowed, the watch does not allow entering a new value. See here.

Does this answer your question or is your question what happens if ((unsigned int*) 0x1000) = 0xcafe; is executed?

@travisgoodspeed
Copy link
Owner

Yes, I'm interested in what happens when writes are made to those three addresses, just to make sure that none of them trigger a reboot.

@docprofsky
Copy link
Collaborator Author

What is the behavior when writing to ROM? 0x1000
The write is ignored, thought I believe the CC430F6137 (what I am testing on) and the CC430F6147 use a flash bootloader, so this is just additional flash memory.

What is the behavior when writing to Flash? 0xFFBE
The write is ignored.

What is the behavior when writing to unmapped memory? 0x7FFE
The write is ignored.

Would it make sense to add support for editing flash to the hex editor?
This would have to allocate 512 bytes of ram to support this. We could also just add support for editing flash without erasing first, but this is less useful.

@travisgoodspeed
Copy link
Owner

Ignoring writes to Flash is totally fine. I'll try to test this code this week and get it merged.

@docprofsky
Copy link
Collaborator Author

Were you able to do any testing of this?

@travisgoodspeed
Copy link
Owner

I wasn't, but I really ought to. Perhaps there should be a testing branch that works its way to master?

This will be my first patch to test after I dust off my development kit and wire it up in the new lab.

@docprofsky
Copy link
Collaborator Author

A testing/devel/next branch could be useful. I have been keeping a local branch that is master with this PR, #124, #130 merged into it.

@travisgoodspeed
Copy link
Owner

I'm hoping to finish assembling eight new watch boards this weekend, will try pulling in those PRs and wearing the code for a while.

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.

3 participants