CW 10.2 / K70 How to create S19 or other file for Flash burn

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

CW 10.2 / K70 How to create S19 or other file for Flash burn

Jump to solution
8,342 Views
crezyoz
Contributor IV

I need to send files form CW to someone for burning to flash. I have been able to use CW's flash burner to burn form the .afx  file but I don't see any 'burner.bbl' file or anything in the UI to allow me to generate these files. Please advise.,

Labels (1)
0 Kudos
Reply
1 Solution
2,994 Views
mjbcswitzerland
Specialist V

Hi

In the CW10.x project properties the "C/C++ Build | Settings | Tool Settings | ARM Linker | Generate S-Rec File" can be ticked so that an SREC output is generated automatically when building the project. There is however no binary output option (at the moment).

Also, in build steps ("C/C++ Build | Settings | Build Steps") post build steps can be added (like executing a bat file or calling objcpy to make other formats out of the .axf or .S19 (if using the .S19 ny version of objcopy will be OK since there is nothing processor dependent in it)).

The uTasker utilities are also often called here since they allow combining files (useful for combining boot loaders with applications), and generating combined binary, iHEX or SREC files for use by certain downloading tools - or for encrypting them for encrypted SW updates). The tools are available (for free) here: uTasker Utilities

Regards

Mark

http://www.uTasker.com [enabling Freescale Coldfire and Kinetis to do more, faster and with less resources...]

View solution in original post

0 Kudos
Reply
13 Replies
2,994 Views
JimDon
Senior Contributor III

Try this:

Under the lightning bolt, select 'Flash File to target."

Browse to the .elf file for the project  and select it.

Uncheck "Save as Target Task", or enter a name for the target task

Click "Erase And Program"

0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

Just for future reference:

If you were to down load and install:

Sourcery CodeBench Lite Edition for ARM EABI

or

GNU Tools for ARM Embedded Processors (Linaro)

Then you could do this to convert an elf to s19:

copy mycode.elf mycode.s19
arm-none-eabi-objcopy -O srec mycode.s19

I also found the disassembler handy:

arm-none-eabi-objdump -S mycode.elf
2,995 Views
mjbcswitzerland
Specialist V

Hi

In the CW10.x project properties the "C/C++ Build | Settings | Tool Settings | ARM Linker | Generate S-Rec File" can be ticked so that an SREC output is generated automatically when building the project. There is however no binary output option (at the moment).

Also, in build steps ("C/C++ Build | Settings | Build Steps") post build steps can be added (like executing a bat file or calling objcpy to make other formats out of the .axf or .S19 (if using the .S19 ny version of objcopy will be OK since there is nothing processor dependent in it)).

The uTasker utilities are also often called here since they allow combining files (useful for combining boot loaders with applications), and generating combined binary, iHEX or SREC files for use by certain downloading tools - or for encrypting them for encrypted SW updates). The tools are available (for free) here: uTasker Utilities

Regards

Mark

http://www.uTasker.com [enabling Freescale Coldfire and Kinetis to do more, faster and with less resources...]

0 Kudos
Reply
2,994 Views
crezyoz
Contributor IV

That will create an S19 file? ?

What I need to do is create a portable file that I can send to others to burn with commercial burners like P&E Micro's standalone units. I tried searching this forum but the links inside posts are all broken now that the format has changed. I don't see any way to do that.

I can burn flash to the K70 from CW with the burner in CW but I don't see a way to generate portable files. There is no .elf file and I don't see any way to generate one.

0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

Sorry,I thought you were trying to burn with CW.

Ok, investigate objcopy. This is gnu utility.

You will need to find the correct command line parameters, like --output-target=srec

0 Kudos
Reply
2,994 Views
crezyoz
Contributor IV

Thanks Jim. I was able to burn with CW using the afx file. I will find objcopy and attempt to get it working ..

But.. there are a few versions of that. Most say M68k? Which works for the K70 and does it convert .afx files?

0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

I can't say this for a fact, but perhaps it does not matter in converting a binary image from elf to s19.

Also, I do not know for a fact of P&E uses s19 for Kinetis.

If you reach a dead end, try P&E tech support, they are really great.

2,994 Views
crezyoz
Contributor IV

Jim.. thanks for sticking with me on this. I really appreciate it.

At the moment I don't see even an elf file. Just the afx file. I don't think there is a setting to generate an elf file in CW/K70 setup?

0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

Well, actually I am use 10.3 beta (still has bugs!) for KL25 and it generates an elf file using ARM tools. I did find this:

"AXF stands for "ARM Executable Format", which is the generic term for the formatted (not pure binary image) output files produced by the ARM Linker. Output files from the ARM Linker often have the extension ".AXF". The only way to determine whether a ".AXF" file contains records in ELF format or in AIF format is by reading the file header"


Open the file in a text editor, and see if the first three character are ELF.

0 Kudos
Reply
2,994 Views
crezyoz
Contributor IV

wow.. Jim., Very helpful. I did find the chkbox for generating S19 files in:

Project | Properties | C/C++ Build | settings | Arm LInker | Output.- Generate S-Record File

With the help of P&E! I am thinking that should do it.

I was getting jealous about the 10.3 users. I am too close to delivery to switch. Now I don't feel so bad.

0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

I only went to 10.3 beta because I got a freedom board. All my other project are still in 10.2.

Glad to have been a help.

I always get a P&E because they have helped me sooo many times, and their drivers always work great.

0 Kudos
Reply
2,994 Views
LuisCasado
NXP Employee
NXP Employee
0 Kudos
Reply
2,994 Views
JimDon
Senior Contributor III

Thanks, that is interesting, but I now prefer the lightning bolt.

You can also do that from the command line.

BAT file:
"(path to)\cwide.exe" -data (path to)/WORKSPACE -vmargsplus -Dcw.script=(path to)/burn.tcl

burn.tcl:
fl::target -lc "LC for Simple Flash"
fl::target -b 0x20000000 0xffff
fl::target -v off -l off
cmdwin::fl::device -d "CFM_MCF5225X_512" -o "256Kx16x1" -a 0x0 0x7ffff
cmdwin::fl::image -f "(path to)\\MYPROJECT.elf.S19" -t "Auto Detect" -re on -r 0x0 0x7ffff -oe off
cmdwin::fl::erase image
cmdwin::fl::write
quitIDE

You figure out what goes in the TCL file from burning with the lightning bolt.

0 Kudos
Reply