S-Record data must be given in whole WORDS

cancel
Showing results for 
Search instead for 
Did you mean: 

S-Record data must be given in whole WORDS

1,935 Views
standa
Contributor I
I built a project for MC56f8323 with CodeWarrior for 56800/E v 8.0 and PE v. 2.98, when I tried to download generated S-Record file into dsp's flash memory with usb flash programmer, this error message popped our saying:
 
"CHawkV2::VirtualImage::LoadFile: S-Record data must be given in whole WORDS"
 
I am sure I selected the combined .elf.s file instead of .elf.p.s or .elf.x.s. Another fact may be interseting:
 
When I have tried download *.elf file, process was succesfull, but MCU is not running - is stoped. I have found same problem this forum, but without solution. When I use for download CW Debug function /F5/ and RUN function - everything is OK.
 
Thanks,
 
Labels (1)
Tags (1)
0 Kudos
2 Replies

30 Views
standa
Contributor I
Solution from Freescale Support
Please uncheck the option "Generate Byte Addresses" in the M56800ELinker panel of target setting, because this option is not supported by56800E Flash Programmer. If you have already done this, the issue may be due to some stringscontaining even number of characters. For example, the following stringhas 4 characters:Char *str ="1234";However, after being compiled with the compiler, the str has 4characters plus an ending byte of 0.So the str actually has 5 bytes in the memory. And the linker generatesa 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:           S306020000B40043After modification: S307020000B4000042It 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 stringwhich has even number of chars. This problem has been fixed in the latest patch (CodeWarrior 8.1), seethe comments below in CW8.1 release note. * MTWX20712: Linker adds padding only when user requests SRecgeneration. Linker also issues a warning when padding sections.
0 Kudos

30 Views
Maki_2880
Contributor I
I have been getting the same error on my code... I tried the above suggestion but I was still not able to program using flash. I tried the solution on the second to the last line of my S file and was able to program using Flash but some error in memory were affected. Any suggestions on a work around? 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?
0 Kudos