Paul John Maquilan

Error Programing *.S files using JTAG

Discussion created by Paul John Maquilan on Aug 31, 2007
Latest reply on Sep 4, 2007 by Pascal Irrle
Hi, I am curently working on a project using 568013 and was able to successfully program *.S files using JTAG so far. Then, after a while, I was no longer able to program my *.S files using JTAG but my *.ELF files run normally. I am getting the error:

"CHawkV2::VirtualImage::LoadFile: S-Record data must be given in whole WORDS"

I found the below work around regarding the error above but it was not able to help.

========================================================================
Solution from Freescale Support
Please uncheck the option "Generate Byte Addresses" in the M56800E
Linker panel of target setting, because this option is not supported by
56800E Flash Programmer.

If you have already done this, the issue may be due to some strings
containing even number of characters. For example, the following string
has 4 characters:
Char *str ="1234";
However, after being compiled with the compiler, the str has 4
characters plus an ending byte of 0.
So the str actually has 5 bytes in the memory. And the linker generates
a S-Record for only 5 bytes, not 6 bytes (in whole words).

There are two workarounds as below to solve this issue,
1) Simply add one byte at the end as 00 as below in your S-record file:
Original line:           S306020000B40043
After modification: S307020000B4000042
It should work.

2) This is CW issue, and when you have even number of chars in a string.
You also can workaround it by adding one more char '\x00' in your string
which has even number of chars.

This problem has been fixed in the latest patch (CodeWarrior 8.1), see
the comments below in CW8.1 release note.
* MTWX20712: Linker adds padding only when user requests SRec
generation. Linker also issues a warning when padding sections.

========================================================================

I tried the above suggestions but I was still not able to program using
JTAG.
Before Edit:
S7050000005C9E

After Edit:
S7060000005C009D

I tried the solution on the second to the last line of my S file
instead and was able to program using Flash but some errors in the
memory of my code occured like being unable to write to flash (via PMBus).

Before Edit:
S30E000018ACCBE6E1E8EFFAFDF4F3E6
S7050000005C9E

After Edit:
S30F000018ACCBE6E1E8EFFAFDF4F300E5
S7050000005C9E

Am I doing this wrong or are there any other suggestions on a work
around with this? How can I fix this issue if I am using CW ver7.3
and can't upgrade to 8.1 because of some limitations on the DSC ICs
we are using?

Outcomes