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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

2,443 次查看
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 项奖励
回复
5 回复数

2,415 次查看
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 项奖励
回复

2,368 次查看
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 项奖励
回复

2,425 次查看
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 项奖励
回复

2,437 次查看
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 项奖励
回复

2,418 次查看
forum2
Contributor I
Hi, I answered you in a previous message.
0 项奖励
回复