How to merge 2 projects

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

How to merge 2 projects

Jump to solution
5,463 Views
thysell
Contributor I
Hi
 
What I want to do is to merge two separate codewarrior projects to be able to flash both of them.
 
I have a small bootloader and a larger application in seperate projects which both have been developed using codewarrior 5.0 for HCS08... The MCU is a MC9S08GT32...
 
The flash is divided into two partions... the application is being flashed to the first and the bootloader to the second...
 
I have searced around in this forum and found similar threads, but I can't seem to get what they are suggesting to work.
 
First of all, I don't get a file *.s19, which is mentioned alot... only files called *.abs.s19 are these the same?
It seems to as it is the *.abs that contains the important information.
 
I have tried to manually cut and paste these files but then the debugger won't load them... I have also tried to use the expert mode programmer to program a module after specifying the object file from the other project...
 
It seems that this is kind of an easy task, but I seem to miss some basic knowledge...
 
would be grateful for help
 
//Daniel Thysell,
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
2,667 Views
CrasyCat
Specialist III
Hello
 
Basically the .abs.s19 is in fact a  S record file.
To merge the bootloader code into the application S19 file, just use the HEXFILE command as specified in a previous thread.
 
CrasyCat

View solution in original post

0 Kudos
Reply
8 Replies
2,667 Views
thysell
Contributor I
thank you very much
 
I think that I've got it to work now
 
//Thysell
0 Kudos
Reply
2,667 Views
thysell
Contributor I
ok...
 
as of now I've tried to implement a line:
 
HEXFILE booter.abs.s19
 
in the application .prm file... this too seem to download the code fot the bootloader into the flash...
 
now I get a bunch of errors that says:
 
code loading overlap detected in range
 
... and then it outputs this for all the ranges that hold my main application... that can't be good either... since it doesnt execute the application properly...
 
regards
//Daniel
0 Kudos
Reply
2,667 Views
CrasyCat
Specialist III
Hello
 
Are you using the same memory areas for the bootloader and the application?
That could not work. If you want to keep a bootloader and an application in CPU flash, both application should use separate memory areas.
 
So adjust your .prm file and make sure code from bootloader is loaded separately from application code.
 
CrasyCat
0 Kudos
Reply
2,667 Views
thysell
Contributor I
I changed the openfile command to specify an .abs file instead of an .s19 file...
 
So now I think I am downloading the .abs files but I still get the no main function error...
 
thanks very much
 
 
//Daniel
0 Kudos
Reply
2,667 Views
thysell
Contributor I
another thing...
 
when I load that .s19 file... the command window outputs this:
 
Stop at Function: No function with the name "main" was found.
which don't feel quite right...
 
So I don't think that my suggested solution works
 
//Daniel
0 Kudos
Reply
2,667 Views
CrasyCat
Specialist III
Hello
  HEXFILE should be used in linker command file.
  Please refer to following post:
 
This will include code from the bootloader into the application .abs and .abs.s19 file.
 
Note that the .abs.s19 file contains only executable code, but no debug information. You can use this file for production flash programming or to program the flash as long as you do not want to debug the application.
 
If you want to debug the application, you need to download the .abs file. This will provide you with information on application functions, variables, and so on.
 
Per default the debugger is configured to start and run till main function is reached. If you download the .abs.s19 file, there is no debug information, so the debugger  does not know where to stop. This is the reason for the message you are seeing.
 
So if you want to debug the application, make sure to download the .abs file.
 
CrasyCat
0 Kudos
Reply
2,667 Views
thysell
Contributor I
Ok...
 
should i use the command HEXFILE in the debuggers command window? I've tried that and the reply is: Error: no such command: HEXFILE
But... after some more researsh I have written a file callet test.cmd wich includes the following
 
OPENFILE "C:\Documents and Settings\danielt\My Documents\flashtest\bin\output.s19"
format=motorola
busWidth=1
origin=0
len=0x10000
destination=0
SRECORD=Sx
SENDBYTE 1 "C:\Documents and Settings\danielt\My Documents\flashtest\bin\cabinet.abs"
SENDBYTE 1 "C:\Documents and Settings\danielt\My Documents\flashtest\bin\project.abs"
CLOSE
this makes an file called output.s19 wich I am then able load through the debugger, now it seems to be flashed down alright... At least it looks that way in the memory window... But it still don't seem to work as it should
 
thanks for your help
 
//Daniel
0 Kudos
Reply
2,668 Views
CrasyCat
Specialist III
Hello
 
Basically the .abs.s19 is in fact a  S record file.
To merge the bootloader code into the application S19 file, just use the HEXFILE command as specified in a previous thread.
 
CrasyCat
0 Kudos
Reply