SREC file detects like Binary/Raw format

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

SREC file detects like Binary/Raw format

跳至解决方案
3,064 次查看
evgenik
Contributor IV

Hello.

I am working with Kinetis K21FN120 MCU.

I wrote a C Sharp language program to create .srec files. This is a necessity for our project. All conditions, such as file format, checksum calculation, addressing, were complied with according to the technical documentation of the Motorola file. Nevertheless, when I tried to write the .srec file built by my program through Freescale "Flash File To Target", Freescale cannot determine it as a Motorola S-Record file but sees it as Binary/Raw format.
I even tried to get the file generated by my program and copy it to a file generated from IAR, which was previously detected as Motorola S-Record file. After copying, the result is the same as with my file: it is seen as Binary/Raw, not Motorola S-Record. So I thought there was some kind of problem with encoding.
Please tell me, this is an ordinary text file with the extension .srec, encoded as UTF8. Where to look for an error?
Thanks
EvgeniWith IAR srec file.pngWith my srec file.png

标签 (1)
1 解答
2,948 次查看
ErichStyger
Senior Contributor V

Hi Evgeni,

I think you have written the content of your file in a wrong way. I suggest that you check/read it with srec_cat (see Generating Intel Hex Files with a given Length using srec_cat | MCU on Eclipse ) or check it with srec_info (see CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse | MCU on Eclipse ).

Other than that: post your file here.

Erich

在原帖中查看解决方案

4 回复数
2,948 次查看
evgenik
Contributor IV

I have added both files for comparison. As you can see they are identical. But file from IAR is detected like Motorola S-Record file and file from my application is detected like Binary/Raw format file.
I have checked my file with srec_info and have received the next warning: "ignoring garbage lines". How can I found these lines? Why compare images found that both files are the same?

0 项奖励
2,948 次查看
ErichStyger
Senior Contributor V

Hi Evgeni,

sorry, I did not realize that you already had provided the files.

I checked them, and the files are not the same.

You can easily see this with EHEP in Eclipse (5 Best Eclipse Plugins: #4 (EHEP) | MCU on Eclipse ):

pastedImage_1.png

So your generated files starts with binary data (EF BB BF) (Unicode byte order mark): simply store that file as a normal ASCII file instead.

I hope this helps,

Erich

2,948 次查看
evgenik
Contributor IV

Hi Erich.

After making some changes in my program, when working with srec_info, I issued the same warning indicating the problematic line number. After a detailed analysis of this line, I found an error in my code and fixed it. Now my file is detected as a Motorola S-Record file.
Many thanks for the help.

2,949 次查看
ErichStyger
Senior Contributor V

Hi Evgeni,

I think you have written the content of your file in a wrong way. I suggest that you check/read it with srec_cat (see Generating Intel Hex Files with a given Length using srec_cat | MCU on Eclipse ) or check it with srec_info (see CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse | MCU on Eclipse ).

Other than that: post your file here.

Erich