Generate CRC by linker (ld)

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

Generate CRC by linker (ld)

6,215件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tomkrysl on Sun Jan 15 06:05:44 MST 2012
Hello,
we're porting our existing application and bootloader to LPC now and I have problem to port following behavior from old architecture (Renesas NEC):

I need to generate checksum (CRC) by ld or another gnu tool and place it to the resulting intel hex file.

The purpose is to check integrity of the application after loading to FLASH by my bootloader.

This boot loader calculates his own CRC after loading the application to FLASH and compare this with that one generated by ld.

Is there any method to generate a CRC and to place it to resulting hex file?
Any documented one?

I produce the hex file by objcopy.

Remark: In post build steps there was sth. like:
"checksum -p ${TargetChip} -d ${BuildArtifactFileBaseName}.bin;"
, but I didn't find any documentation about that.

Thx
0 件の賞賛
返信
7 返答(返信)

4,297件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Tue Jan 17 02:39:54 MST 2012
You don't state which chip you are using, but this code to attach a checksum to LPC1343 binaries may be helpful as a starting point: https://github.com/microbuilder/LPC1343CodeBase/tree/master/tools/lpcrc
0 件の賞賛
返信

4,296件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tomkrysl on Sun Jan 15 15:49:00 MST 2012

Quote: TheFallGuy
Product documentation goes out of date.:mad:

At the top of the forum is a sticky thread with some guidance on how to find more information. As a Junior Member, I suggest you start there.



Thank you, hopefully LPC chips are not going out of date too. Our company decided to use these a month ago...
0 件の賞賛
返信

4,296件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Jan 15 13:46:29 MST 2012

Quote:

Anyway, this should be described in the Xpresso documentation. Why to search some google or wiki for this simple thing...

Product documentation goes out of date.:mad:

At the top of the forum is a sticky thread with some guidance on how to find more information. As a Junior Member, I suggest you start there.
0 件の賞賛
返信

4,297件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jan 15 13:23:30 MST 2012
Dear tomkrysl,

I'm sorry if you feel offended by this smileys, I've deleted them. Since I use a lot of them to colour the text I'll follow you wish and don't answer you question any more to avoid further excitement.

Let me know if you wish me to delete my complete answer.

I don't feel burdened or anything, this answer is just what it is: a 1 minute answer to give you a hint. Obviously you don't like my style and I'll respect that, that's no problem. I'm old enough to survive this and can spent my time with other things :)
0 件の賞賛
返信

4,296件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tomkrysl on Sun Jan 15 12:46:56 MST 2012

Quote: Zero
:confused:

Could be helpful to search issues like this at Code Red Wiki :eek:

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



Dear senior member,
thanks for your answer.
Please keep out those smileys next time.
I'm not asking for those.
If you feel burdened by my question please don't answer next time.
Obviously I am starting with LPC and I really DON'T know there is some particular wiki. I think you didn't know this either when you were junior member.

Anyway, this should be described in the Xpresso documentation. Why to search some google or wiki for this simple thing...
0 件の賞賛
返信

4,297件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jan 15 07:27:55 MST 2012

Quote: tomkrysl
Remark: In post build steps there was sth. like:
"checksum -p ${TargetChip} -d ${BuildArtifactFileBaseName}.bin;"
, but I didn't find any documentation about that.

(deleted smiley)

Could be helpful to search issues like this at Code Red Wiki (deleted smiley)


Quote:
[B]Image Checksums (NXP LPC families) [/B]NXP parts  use a word in the vector table of the processor to store a checksum that  is examined by the bootloader to identify a valid image. For ARM7/ARM9  based parts this checksum word is stored at offset 0x14, for Cortex-M  based parts it is stored at offset 0x1C.
When downloading code via the debugger, this checksum word will be filled in automatically as the image is downloaded.
When  creating a binary file, you will need to ensure that you run the  supplied checksum utility to post-process the binary yourself. If you  modify the supplied post-build step to create your binary (as per the  FAQ Post-processing your linked application, then this will normally be done automatically by the post-build step...

http://support.code-red-tech.com/CodeRedWiki/OutputFormats
0 件の賞賛
返信

4,297件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Skashkash on Sun Jan 15 06:43:32 MST 2012
You can probably use the srecord utility to calculate and insert a CRC into your .hex file. Not sure if the CRC formula will be the same one you use, but srecord has a few options for that.


http://srecord.sourceforge.net/


-skashkash
0 件の賞賛
返信