Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Export program memory (ROM)

2 posters

Go down  Message [Page 1 of 1]

1Export program memory (ROM)  Empty Export program memory (ROM) Wed Aug 30, 2023 9:42 am

royqh1979



While testing mcs51, I often need to handcode machine code through the mcu monitor's flash tab, and watch the simulation result.

But data in the mcu's program memory would be lost after simulIDE exited. And I don't have an assembler and don't know how to handcraft a hex file.

It would be very handy to have an option to export program memory/ and import back.


2Export program memory (ROM)  Empty Re: Export program memory (ROM) Wed Aug 30, 2023 9:55 am

arcachofo

arcachofo

Exporting data to ihex is planned for all memories.

Have a look at src/gui/memory/memdata.cpp
MemData::saveData should call MemData::saveHex (and others).

The algorithm to create the hex file could probably be reversed from MemData::loadHex.

3Export program memory (ROM)  Empty Re: Export program memory (ROM) Wed Aug 30, 2023 9:57 am

royqh1979



arcachofo wrote:Exporting data to ihex is planned for all memories.

Have a look at src/gui/memory/memdata.cpp
MemData::saveData should call MemData::saveHex (and others).

The algorithm to create the hex file could probably be reversed from MemData::loadHex.

That's great!

4Export program memory (ROM)  Empty Re: Export program memory (ROM) Wed Aug 30, 2023 10:47 am

royqh1979



arcachofo wrote:Exporting data to ihex is planned for all memories.

Have a look at src/gui/memory/memdata.cpp
MemData::saveData should call MemData::saveHex (and others).

The algorithm to create the hex file could probably be reversed from MemData::loadHex.

I tried to implement loadHex but failed.

I cant decide which byte is reserved space, and which is useful code.

But i think export .bin/.data is enough for now.

5Export program memory (ROM)  Empty Re: Export program memory (ROM) Wed Aug 30, 2023 11:06 am

arcachofo

arcachofo

I cant decide which byte is reserved space, and which is useful code.
Yes, I see the problem.
Dumping everything in the hex file would not be very efficient.

But i think export .bin/.data is enough for now.
As far as I can remember it should posible to "Load Firmware" with .bin or .data, but saving program memory is the problem.
We could probably implement a context menu with load/save data directly in src/gui/memory/memtable.cpp
Them from the Mcu Monitor just right-click in any memory table and save/load would be available (also for any device with Memory table).

6Export program memory (ROM)  Empty Re: Export program memory (ROM) Wed Aug 30, 2023 2:13 pm

royqh1979



arcachofo wrote:
I cant decide which byte is reserved space, and which is useful code.
Yes, I see the problem.
Dumping everything in the hex file would not be very efficient.

But i think export .bin/.data is enough for now.
As far as I can remember it should posible to "Load Firmware" with .bin or .data, but saving program memory is the problem.
We could probably implement a context menu with load/save data directly in src/gui/memory/memtable.cpp
Them from the Mcu Monitor just right-click in any memory table and save/load would be available (also for any device with Memory table).

Great idea! I'm working on it.

arcachofo likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum