.incbin produces the wrong result (does not match original file)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.incbin produces the wrong result (does not match original file)

1,379 Views
forum2
Contributor I

Hello,

I am trying to add some binary file to the final elf according to section
12.2.7.1.3 incbin
of "CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual"
Below is the the source of asm file:

 

.section .rodata
.global _flashBuf
_flashBuf:
.incbin "D:/Freescale/Projects/test-core00/Sources/flash.bin"

 

The final elf file contains the original data from binary "flash.bin" file of the correct size but with all bytes 0x0A changed to 0x0D. All other bytes except of 0x0A are not changed.
It looks like .incbin parses the binary file not as raw data, but as text,

0 Kudos
5 Replies

1,351 Views
forum2
Contributor I

The problem turned out to be in assembler: PA\PA_Tools\Command_Line_Tools\mwasmeppc.exe
It's a bug that the binary file by .incbin directive is opened as text and than function FixTextHandle called internally where all '\n' characters are replaced with '\r'.
In my case the mwasmeppc.exe file has the following version:
Freescale assembler for embedded PowerPC.
Version 4.3 build 303 Run time: June 16, 2015, 12:00:17 PM.

0 Kudos

1,304 Views
yipingwang
NXP TechSupport
NXP TechSupport

The version (Version 4.3 build 303 ) of mwasmeppc.exe is from CodeWarrior for PA 10.5.1, it is the latest version for PA architecture. I will report this bug to CodeWarrior development team.

0 Kudos

1,361 Views
forum2
Contributor I

Hi,

I have recompiled the project for each processor from the drop-down list:
e300v1, e300c2, e300c3, e300c4, e500e1, e500v2, e600 and generic processors.
The result is the same and does not depend on the specific processor.


1.jpg

0 Kudos

1,373 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Please let us know your chip part number thus we can assign this thread to the right engineer.

Thanks,

Jun Zhang

0 Kudos

1,354 Views
forum2
Contributor I
Hi, I answered you in a previous message.
0 Kudos