DSPRelated.com
Forums

Hex conversion utility issues in C6713

Started by Aditi Akula August 9, 2011
Hi,

I am using a custom C6713B board. I want to boot from Flash.

And so I have read the TI Doc SPRA999A to create a secondary bootloader.

I am using the hex conversion utility. And have a couple of questions.

1) If I am using a 512k x 8 Flash device. What do I specify in the options
of the hex

conversion utility for

-memwidth and -romwidth ?

2) If I specify -memwidth2 (since C6713 is a 32-bit device) and
-romwidth=8, the hex utility generates

4 files (xx.hex, xx.a1, xx.a2, xx.a3). All the 4 files start out to be same.
So I do not understand what that means.

3) If I specify -memwidth=8 and -romwidth=8, the hex utility generates only
one file.

The thing is I use the Flash manufacturers low level driver (lld) code to
write to Flash.

I created a CCSv4 project in which I read char bytes from the hex file
created above

and call the "lld" functions to write to Flash.

Can you guide me in this regard as to what is the correct procedure to
generate the hex file/ files.

Needed ASAP.

Thanks,

Aditi.
Aditi,

IN general,,,

each source file is (in your case) one byte of a 32 bit ram word.
To load those 4 source files into 8 bit flash, is like this:

file 1 byte 0 goes to flash byte 0 = first ram word
file 2 byte 0 goes to flash byte 1 "
file 3 byte 0 goes to flash byte 3 "
file 4 byte 0 goes to flash byte 4 "

file 1 byte 1 goes to flash byte 5 = second ram word
file 2 byte 1 goes to flash byte 6 "
file 3 byte 1 goes to flash byte 7 "
file 4 byte 1 goes to flash byte 8 "

and so on.

R. Williams

---------- Original Message -----------
From: Aditi Akula
To: c...
Sent: Tue, 9 Aug 2011 17:20:23 -0700
Subject: [c6x] Hex conversion utility issues in C6713

> Hi,
>
> I am using a custom C6713B board. I want to boot from Flash.
>
> And so I have read the TI Doc SPRA999A to create a secondary bootloader.
>
> I am using the hex conversion utility. And have a couple of questions.
>
> 1) If I am using a 512k x 8 Flash device. What do I specify in the options
> of the hex
>
> conversion utility for
>
> -memwidth and -romwidth ?
>
> 2) If I specify -memwidth2 (since C6713 is a 32-bit device) and
> -romwidth=8, the hex utility generates
>
> 4 files (xx.hex, xx.a1, xx.a2, xx.a3). All the 4 files start out to be
> same. So I do not understand what that means.
>
> 3) If I specify -memwidth=8 and -romwidth=8, the hex utility generates
> only one file.
>
> The thing is I use the Flash manufacturers low level driver (lld) code
> to write to Flash.
>
> I created a CCSv4 project in which I read char bytes from the hex file
> created above
>
> and call the "lld" functions to write to Flash.
>
> Can you guide me in this regard as to what is the correct procedure to
> generate the hex file/ files.
>
> Needed ASAP.
>
> Thanks,
>
> Aditi.
------- End of Original Message -------

_____________________________________
Aditi,

On 8/9/2011 7:20 PM, Aditi Akula wrote:
>
> Hi,
>
> I am using a custom C6713B board. I want to boot from Flash.
>
> And so I have read the TI Doc SPRA999A to create a secondary bootloader.
>
> I am using the hex conversion utility. And have a couple of questions.
>
> 1) If I am using a 512k x 8 Flash device. What do I specify in the
> options of the hex
>
> conversion utility for
>
> -memwidth and -romwidth ?
>
> 2) If I specify -memwidth2 (since C6713 is a 32-bit device) and
> -romwidth=8, the hex utility generates
>
> 4 files (xx.hex, xx.a1, xx.a2, xx.a3). All the 4 files start out to be
> same. So I do not understand what that means.
>
> 3) If I specify -memwidth=8 and -romwidth=8, the hex utility generates
> only one file.
>

Your experiment got the right solution - hex6x has a bug - use
--memwidth 8 --romwidth 8
To generate an Intel file use the following:
hex6x -i --romwidth 8 --memwidth 8 -o t1a.hex -map t1a.map -i t1.out
NOTE:
Always generate a map file. It can give you clues as to what is going
on. When you use the correct memwidth of 32, you get:
<-------top of file snipped------->
OUTPUT FILES: t1a.hex [b0..b7]
t1.i1 [b8..b15]
t1.i2 [b16..b23]
t1.i3 [b24..b31]

CONTENTS: 00000000..000000ff t1.out(.text)

This is an obvious indication that hex6x has created files for
'romwidth=2'.

When working with a new [to you] tool like hex6x, I prefer to create a
small, simple test case to verify correct operation and my
understanding. In this case I used a simple asm macro with a '.byte' to
write 0x00-0xFF and verified the hex file.

mikedunn
>
> The thing is I use the Flash manufacturers low level driver (lld) code
> to write to Flash.
>
> I created a CCSv4 project in which I read char bytes from the hex file
> created above
>
> and call the "lld" functions to write to Flash.
>
> Can you guide me in this regard as to what is the correct procedure to
> generate the hex file/ files.
>
> Needed ASAP.
>
> Thanks,
>
> Aditi.