views:

564

answers:

2

I have been trying to do a fill using the open source Srecord Program. The thing is I need to do a fill that is 0xC2AF00. It appears the program can only do fills that are a byte long (ex: 0xff).If this is not possible with the Srecord program, then how would I go about writing my own algorithm to do what I want. I am not quite sure how to determine what needs a fill and then how I would proceed to go about doing the fill that is needed. And on the off chance that someone could answer the same question for a Tektronix file, that would be just as good or better than how to do what I am asking for on the Intel hex file.

+3  A: 

The -repeat-data generator can take multiple bytes as parameters. The following will fill bytes 16 through 31 with C2AF00C2AF00...

srec_cat -Output -Intel -generate 0x10 0x20 -repeat-data 0xC2 0xAF 0x00

Combine with your actual input, or other generators, to fill the appropriate ranges.

Sparr
Your are simply awesome.
Paul
I had never touched SRecord until you posted this question. I just started developing for AVR microcontrollers, and I recognized your question as something I would want to be able to do soon (produced pattern fills for my EEPROM images), so it seemed like the perfect time to go manpage digging.
Sparr
I can not seem to get it to work still. I will digg further and let you know as well. the problem is I can not seem to get generate to work ... it give me an error. Oh well I will play and post back.Thanks again. (I too today found the relevant section of the srecord of file.)
Paul
my last sentence should have been at the end 'srecord pdf file'
Paul
I am stupid it is all in the manual:./srec_cat ulc14_04.hex --ignore-checksums -o -intel / -linelength 75 ulc14_04.hex Then./srec_cat ulc14_04.hex -intel \> -generate '(' 0x0000 0xFFFE -minus -within ulc14_04.hex -intel ')' \> -repeat-data 0xC2 0xAF 0x00 \> -o ulc14_04.hex -intel
Paul
A: 

You can have full control over generating Intel Hex file with some special library, e.g. with this IntelHex Python library

bialix