Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2009-07-13 04:11:42

samy
Contributor
From: los angeles, california
Registered: 2009-06-18
Posts: 148
Website

How to write to flash?

Hey guys,

Any ideas on how to write data to flash? Not firmware, just plain data to be reused. This is important in offline mode where there's no PC attached and I'm trying to store data for later reuse.

I assume I can just replicate something like the LoadFlashFromSRecords to store data and just specify an address out of range of the firmware. Is this reasonable? Does anyone know at what address I can begin storing data?

Also note, I'm converting a lot of the functions in command.cpp into the armsrc in order to run many of the functions in an offline mode -- not sure how much size that will add.

Offline

#2 2009-07-13 07:05:52

d18c7db
Contributor
Registered: 2008-08-19
Posts: 292

Re: How to write to flash?

You can absolutely re-use the code for writing to FLASH, just remember that flashing is done one page at a time (even when only one byte changes), read the ARM datasheet for further details or I can help you out if you prefer.

An easy way out would be to assume a 256K FLASH micro and use the last page of the FLASH. A better way is to query the micro through the DBGU registers, find the FLASH size and use the last page of the FLASH. How much room do you need? 256 bytes enough? If not use pages from the top of FLASH going down but put a limit on it so you don't end up rewriting the firmware.

Last edited by d18c7db (2009-07-13 07:07:22)

Offline

#3 2009-07-13 09:20:48

samy
Contributor
From: los angeles, california
Registered: 2009-06-18
Posts: 148
Website

Re: How to write to flash?

256 is enough for now. I looked through the datasheet but didn't quite get where to do it. If I can just determine where to write it out, that should be enough. I was looking at this doc: http://www.atmel.com/dyn/resources/prod … R3_trm.pdf

However, isn't there only 128K on the ARM (it is a AT91SAM7S128, right?)

If I'm just taking the last page, can I just write to 0x1ff00 (128 * 1024 - 256)?

Offline

#4 2009-07-13 12:38:23

d18c7db
Contributor
Registered: 2008-08-19
Posts: 292

Re: How to write to flash?

The real datasheet is 757 pages long, see page 103 for the FLASH ops.

I've seen ppl in this forum use 128, 256 and 512 flavours. Just use the DBGU_CIDR register, I already added the defines for DBGU in at91sam7s128.h ages ago so it's real easy to use now. See page 233 of the datasheet.

Offline

#5 2009-07-13 19:01:10

samy
Contributor
From: los angeles, california
Registered: 2009-06-18
Posts: 148
Website

Re: How to write to flash?

Great, thanks! For any others that are interested, I think the link above is a mispaste - the real big 'ol datasheet can be found here

Offline

Board footer

Powered by FluxBB