Flash on LPC1114

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Flash on LPC1114

1,971件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Dec 15 03:55:36 MST 2010
Hi All,

           I am using LPC1114 in my project and trying to do a back ground check on the FLASH.

What I have noticed is that there is a difference between the generated hex file and the code I read back from the LPC1114.

Image (from 0x00 to 0x2F) read back from LPC1114 using FlashMagic:
00200010E1000000550100005D010000
000000000000000000000000[COLOR=Red]6DDCFFEF[/COLOR]
00000000000000000000000065010000

Image (from 0x00 to 0x2F) from the hex file which was programmed using FlashMagic:
00200010E1000000550100005D010000
000000000000000000000000[COLOR=Red]00000000[/COLOR]
00000000000000000000000065010000

Everything after 0x20 seems to match. any clues on how we are getting this value [COLOR=Red]6DDCFFEF[COLOR=Black]

      Regards,
      Syed
[/COLOR][/COLOR]
0 件の賞賛
返信
5 返答(返信)

1,803件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Dec 15 10:22:56 MST 2010
Thanks everyone for your help. I have generated checksum in the hex file using the checksum.exe and it matches the one geneated using the Flashmagic.

Regards,
Syed
0 件の賞賛
返信

1,803件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Wed Dec 15 09:01:48 MST 2010
This is important. Without this checksum, the LPC microcontrollers will go into bootloader mode instead of running your code from Flash. The memory map location is an open slot in the vector table, so no modification of your actual code occurs when that word is changed. Most of the debug and download tools silently calculate the correct value and program it.
0 件の賞賛
返信

1,803件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Dec 15 04:54:43 MST 2010
Sorry, we aren't flash magic experts. But I would certainly hope that flash magic would overwrite the checksum word with exactly the same checksum value as placed into it by our tools After all the same algorithm should be being used to calculate it in both tools!

Probably the best way to confirm is to try it :)

For more information on using flash magic, you'll need to consult their documentation or support forums - or wait for a flash magic expert to post here.

Regards,
CodeRedSupport.
0 件の賞賛
返信

1,803件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Dec 15 04:26:16 MST 2010
Thanks for your reply. The following is given in the wiki


Quote:
Note that FlashMagic will automatically set the  checksum word for you when you use it to program a hex file to an LPC  device. [COLOR=Red]But if you wish to set the checksum yourself, then the recommend  way of creating such a hex file is as follows[/COLOR]:

[LIST]
[*]convert to binary
[*]run the checkum utility
[*]convert the binary in hex, using arm-none-eabi-objcopy -I binary -O ihex myfile.bin myfile.hex
[/LIST]

[COLOR=Black]If I generate the hex file by the above method
1) Can I use the flash magic to program the hex file ?
2) Do I need to do anything so that flashmagic does not generate the checksum again ?

      Regards,
      Syed
[/COLOR]
0 件の賞賛
返信

1,803件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Dec 15 04:11:20 MST 2010
From LPC111x/LPC11C1x User manual, section 20.3.3 (Rev. 2 — 2 November 2010)...


Quote:

Criterion for valid user code: The reserved Cortex-M0 exception vector location 7 (offset 0x 0000 001C in the vector table) should contain the 2’s complement of the check-sum of table entries 0 through 6. This causes the checksum of the first 8 table entries to be 0. The bootloader code checksums the first 8 locations in sector 0 of the flash. If the result is 0,then execution control is transferred to the user code.

I believe that the checksum will be set automatically for you by flash magic - it certainly is when the LPCXPresso IDE debugger downloads your image. A checksum utility is also supplied as part of LPCXpresso that can be used to set the checksum word.

For more information, please see:

http://support.code-red-tech.com/CodeRedWiki/OutputFormats

Regards,
CodeRedSupport
0 件の賞賛
返信