EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Erasing/writing to a specific sector in Flash using Flash Magic

Started by Hard...@allenvanguard.com March 29, 2011
Hello,

I had a question about erasing/writing to a specific sector in Flash using Flash Magic without erasing the application.

My application is located at flash sectors 0-4. I have some data which I would like to store in sector 26 of flash and then use from my main application. I created a .txt file which contains the following data: "A B C D E F G H". I converted the .txt file into a .hex file using a QNX utility (ntox86-objcopy). When I try to write the .hex file to flash sector 26, it writes it to sector 0. Has anyone tried to do this?

Thanks.
hgida

An Engineer's Guide to the LPC2100 Series

Hello Hardeep,

It's fairly easy, just read about the hex file format (google will find you
more than enough info) and change the addresses on your hex file to the
addresses that will be on sector 26. Hex files are fairly simple.

Or, if you want to do it the lazy way you can find a bin2hex application on
the web. You can then use it to create an hex file with the data at any
position.
I once used to merge a wave file into a hex file with my program code for an
LPC2138 with this command:
BIN2HEX /L393216 /O65536 /4 /T /M mywavfile.wav myprogramfile.hex

Regards,
Bernardo Marques.
On Tue, Mar 29, 2011 at 8:13 PM, wrote:

> Hello,
>
> I had a question about erasing/writing to a specific sector in Flash using
> Flash Magic without erasing the application.
>
> My application is located at flash sectors 0-4. I have some data which I
> would like to store in sector 26 of flash and then use from my main
> application. I created a .txt file which contains the following data: "A B C
> D E F G H". I converted the .txt file into a .hex file using a QNX utility
> (ntox86-objcopy). When I try to write the .hex file to flash sector 26, it
> writes it to sector 0. Has anyone tried to do this?
>
> Thanks.
> hgida
>
>
Hi Bernardo,

Thanks for your help. I looked up the format for a hex file as you
suggested and found that the "address" can only be four hex digits. The
address of sector 26 is not accessible in four hex digits. For the short
term, I changed the sector to sector 6 because I know it's accessible in
four hex digits. I was successfully able to write and read from that
sector. Thanks again for your help. Now, I just need to find that
bin2hex application so that I can write to higher flash addresses .

Thanks.

Hgida

From: l... [mailto:l...] On Behalf
Of Bernardo
Sent: March 29, 2011 4:20 PM
To: l...
Subject: Re: [lpc2000] Erasing/writing to a specific sector in Flash
using Flash Magic

Hello Hardeep,

It's fairly easy, just read about the hex file format (google will find
you more than enough info) and change the addresses on your hex file to
the addresses that will be on sector 26. Hex files are fairly simple.

Or, if you want to do it the lazy way you can find a bin2hex application
on the web. You can then use it to create an hex file with the data at
any position.

I once used to merge a wave file into a hex file with my program code
for an LPC2138 with this command:

BIN2HEX /L393216 /O65536 /4 /T /M mywavfile.wav myprogramfile.hex

Regards,

Bernardo Marques.

On Tue, Mar 29, 2011 at 8:13 PM, wrote:

Hello,

I had a question about erasing/writing to a specific sector in Flash
using Flash Magic without erasing the application.

My application is located at flash sectors 0-4. I have some data which I
would like to store in sector 26 of flash and then use from my main
application. I created a .txt file which contains the following data: "A
B C D E F G H". I converted the .txt file into a .hex file using a QNX
utility (ntox86-objcopy). When I try to write the .hex file to flash
sector 26, it writes it to sector 0. Has anyone tried to do this?

Thanks.
hgida

This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
There is usually a command in the .hex file that extends the addressing
range beyond 16bits. Most modern .hex formats now support at least 32 bit
addresses.

Mike

-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Hardeep Gida
Sent: Tuesday, March 29, 2011 3:00 PM
To: l...
Subject: RE: [lpc2000] Erasing/writing to a specific sector in Flash using
Flash Magic

Hi Bernardo,

Thanks for your help. I looked up the format for a hex file as you suggested
and found that the "address" can only be four hex digits. The address of
sector 26 is not accessible in four hex digits. For the short term, I
changed the sector to sector 6 because I know it's accessible in four hex
digits. I was successfully able to write and read from that sector. Thanks
again for your help. Now, I just need to find that bin2hex application so
that I can write to higher flash addresses .

Thanks.

Hgida

From: l... [mailto:l...] On Behalf Of
Bernardo
Sent: March 29, 2011 4:20 PM
To: l...
Subject: Re: [lpc2000] Erasing/writing to a specific sector in Flash using
Flash Magic

Hello Hardeep,

It's fairly easy, just read about the hex file format (google will find you
more than enough info) and change the addresses on your hex file to the
addresses that will be on sector 26. Hex files are fairly simple.

Or, if you want to do it the lazy way you can find a bin2hex application on
the web. You can then use it to create an hex file with the data at any
position.

I once used to merge a wave file into a hex file with my program code for an
LPC2138 with this command:

BIN2HEX /L393216 /O65536 /4 /T /M mywavfile.wav myprogramfile.hex

Regards,

Bernardo Marques.

On Tue, Mar 29, 2011 at 8:13 PM, < H...@allenvanguard.com
> wrote:

Hello,

I had a question about erasing/writing to a specific sector in Flash using
Flash Magic without erasing the application.

My application is located at flash sectors 0-4. I have some data which I
would like to store in sector 26 of flash and then use from my main
application. I created a .txt file which contains the following data: "A B C
D E F G H". I converted the .txt file into a .hex file using a QNX utility
(ntox86-objcopy). When I try to write the .hex file to flash sector 26, it
writes it to sector 0. Has anyone tried to do this?

Thanks.
hgida

IMPORTANT LEGAL NOTICE

This message is intended only for the use of the named addressee. It may
contain information that is copywritten, privileged, confidential and exempt
from disclosure under applicable law. If you are not the intended recipient,
you are notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this in error,
please notify the sender immediately and delete it from your system.
Communications using this system are monitored and recorded for lawful
business purposes.

Hi Hardeep,

Sorry for what might not be a timely post. I'm just getting caught up after
traveling... Still, I thought you might be interested in the following hex
editor program called Neo:

http://www.hhdsoftware.com/

It's worked well for me. I'm sure there are many other other similar programs
out there.

Hope that's helpful.
Norman

________________________________
From: Hardeep Gida
To: l...
Sent: Tue, March 29, 2011 3:00:25 PM
Subject: RE: [lpc2000] Erasing/writing to a specific sector in Flash using Flash
Magic

Hi Bernardo,

Thanks for your help. I looked up the format for a hex file as you suggested and
found that the “address” can only be four hex digits. The address of sector 26
is not accessible in four hex digits. For the short term, I changed the sector
to sector 6 because I know it’s accessible in four hex digits. I was
successfully able to write and read from that sector. Thanks again for your
help. Now, I just need to find that bin2hex application so that I can write to
higher flash addresses .

Thanks.
Hgida

From:l... [mailto:l...] On Behalf Of
Bernardo
Sent: March 29, 2011 4:20 PM
To: l...
Subject: Re: [lpc2000] Erasing/writing to a specific sector in Flash using Flash
Magic

Hello Hardeep,

It's fairly easy, just read about the hex file format (google will find you more
than enough info) and change the addresses on your hex file to the addresses
that will be on sector 26. Hex files are fairly simple.

Or, if you want to do it the lazy way you can find a bin2hex application on the
web. You can then use it to create an hex file with the data at any position.
I once used to merge a wave file into a hex file with my program code for an
LPC2138 with this command:
BIN2HEX /L393216 /O65536 /4 /T /M mywavfile.wav myprogramfile.hex

Regards,
Bernardo Marques.

On Tue, Mar 29, 2011 at 8:13 PM, wrote:

Hello,

I had a question about erasing/writing to a specific sector in Flash using Flash
Magic without erasing the application.
My application is located at flash sectors 0-4. I have some data which I would
like to store in sector 26 of flash and then use from my main application. I
created a .txt file which contains the following data: "A B C D E F G H". I
converted the .txt file into a .hex file using a QNX utility (ntox86-objcopy).
When I try to write the .hex file to flash sector 26, it writes it to sector 0.
Has anyone tried to do this?

Thanks.
hgida
IMPORTANT LEGAL NOTICE
This message is intended only for the use of the named addressee. It may contain
information that is copywritten, privileged, confidential and exempt from
disclosure under applicable law. If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this communication
is strictly prohibited. If you have received this in error, please notify the
sender immediately and delete it from your system. Communications using this
system are monitored and recorded for lawful business purposes.
Thanks for all the tips everyone!

Hgida

From: l... [mailto:l...] On Behalf Of Norman Felder
Sent: April 1, 2011 11:25 AM
To: l...
Subject: Re: [lpc2000] Erasing/writing to a specific sector in Flash using Flash Magic

Hi Hardeep,

Sorry for what might not be a timely post. I'm just getting caught up after traveling... Still, I thought you might be interested in the following hex editor program called Neo:

http://www.hhdsoftware.com/

It's worked well for me. I'm sure there are many other other similar programs out there.

Hope that's helpful.

Norman

________________________________

From: Hardeep Gida
To: l...
Sent: Tue, March 29, 2011 3:00:25 PM
Subject: RE: [lpc2000] Erasing/writing to a specific sector in Flash using Flash Magic

Hi Bernardo,

Thanks for your help. I looked up the format for a hex file as you suggested and found that the “address” can only be four hex digits. The address of sector 26 is not accessible in four hex digits. For the short term, I changed the sector to sector 6 because I know it’s accessible in four hex digits. I was successfully able to write and read from that sector. Thanks again for your help. Now, I just need to find that bin2hex application so that I can write to higher flash addresses .

Thanks.

Hgida

From: l... [mailto:l...] On Behalf Of Bernardo
Sent: March 29, 2011 4:20 PM
To: l...
Subject: Re: [lpc2000] Erasing/writing to a specific sector in Flash using Flash Magic

Hello Hardeep,

It's fairly easy, just read about the hex file format (google will find you more than enough info) and change the addresses on your hex file to the addresses that will be on sector 26. Hex files are fairly simple.

Or, if you want to do it the lazy way you can find a bin2hex application on the web. You can then use it to create an hex file with the data at any position.

I once used to merge a wave file into a hex file with my program code for an LPC2138 with this command:

BIN2HEX /L393216 /O65536 /4 /T /M mywavfile.wav myprogramfile.hex

Regards,

Bernardo Marques.

On Tue, Mar 29, 2011 at 8:13 PM, wrote:

Hello,

I had a question about erasing/writing to a specific sector in Flash using Flash Magic without erasing the application.

My application is located at flash sectors 0-4. I have some data which I would like to store in sector 26 of flash and then use from my main application. I created a .txt file which contains the following data: "A B C D E F G H". I converted the .txt file into a .hex file using a QNX utility (ntox86-objcopy). When I try to write the .hex file to flash sector 26, it writes it to sector 0. Has anyone tried to do this?

Thanks.
hgida

IMPORTANT LEGAL NOTICE

This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.

The 2024 Embedded Online Conference