Codewarrior;Test Project.How to generate s19 file? The file I find is both s1 and s2

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

Codewarrior;Test Project.How to generate s19 file? The file I find is both s1 and s2

8,812 Views
kwik
Contributor I
My mission ;
To make a test program using Codewarrior ,generate an s19 file and
send it via serial line to my Dragon12 board.

I have generated a test project.

- All I did was using the File->New and then the wizard.
- Let all settings in the wizard be as default ,
except I selected 9s12DP256B as CPU
- I also selected 2 targets .....HCS12 Serial Monitor and
Full chip simulation

Then clicking on Make button .

So ,first challenge ....were is the s19 file ...my guess is in Bin
directory ... I wonder which s19 file to send to the board .....

Could it be HCS12_Serial Monitor.abs.s19 ?

It cannot be sendt ; the s0 record is too long ,and it has both s1 and
s2 records ...I need a s19 file with a "normal s0 and only s1 records ...

How do I get that ? Okay I click Help ......read on S records ...

It says set -B option and set SRECORDS=1

But were ? (And which file do I send to the board?) The Help doesnt say
were to put the options.

I must be in Project Settings ? But in that case were ?

Is it under
-Target
-Target Settings
-Access Paths
-Build Extras
-File Mappings
-Source Trees
-OSEK Sysgen
-Assembler for...
-Burner for ...
-Compiler for ..
-Importer for ...
-Linker for ..
-Simulink

My guess ..... Nah I give up ...
Labels (1)
0 Kudos
11 Replies

1,066 Views
kwik
Contributor I
Okay I have understood the following ;

Help function shows the options (But not whether it concerns compiler,linker ,builder or whatever ,

But ,Codewarrior has an IDE for this were you check/uncheck stuff .....

so ..... I found that under Settings->Burner for HC12... there is
a button called Options .....and there is a tab in the dialog that
pops up called Output ....and you can check "Configure S-Records ...

I did that and Checked "No Path in S0-Record" ....

And the S0 lenght became "normal" (So that D-Bug12 can accept it at my Dragon12 board)

So now the s19 file for an almost empty main.c file looks like this ;

S01B000048435331325F53657269616C5F4D6F6E69746F722E61627339
S123C000CF1100790011CC09395B105A124A8004304A8000300000C01BC01F00000000001B
S104C020001B
S105FFFEC0003D
S22430800010EF20FEFEC017FDC015270E35ED31EC3169700434FB310326F2FEC019EC31274F
S2113080200BED31180A30700434F920F10AE7
S804000000FB

The s22 and s21 will not be accepted by D-Bug12 ,and it should end with s9........
0 Kudos

1,066 Views
CrasyCat
Specialist III
Hello

That is strange it is in my opinion a feature missing in the D-Bug12 loader.
The definition of the S record format specifies S2 record must be used when addresses are encoded on 3 bytes.

Which is obviously the case here (you are loading code to 0x308000...
Code Warrior alternatively generates a s record file with physical addresses (HCS12_Serial Monitor.abs.phy).
This record contains physical addresses i.e. contains only S2 records.

Now the question is does D-Bug12 allow you to load code in banked flash?
If not you have to use small memory model only (and limit Flash area used for code to 0x4000-0x7FFF, 0xC000-0xFFFF.

Otherwise you have to figure out how the loader is expecting banked flash data in the s record file.

CrasyCat
0 Kudos

1,066 Views
kwik
Contributor I
Okay CrasyCat ! Thanks !

I restarted the while creation of the project ,with small memory-model .

Now the S19 file looks like this ;

S01B000048435331325F53657269616C5F4D6F6E69746F722E61627339
S123C000FEC03DFDC03B270E35ED31EC3169700434FB310326F2FEC03FEC31270BED3118AA
S123C0200A30700434F920F13DCF1100790011CC09395B105A1207C806C0450000C041C0E9
S10EC040490000000010EF20FE00008B
S105FFFEC02914
S9030000FC

Unfortunately when I try to send this to D-Bug12 ,it says

Can't Write Target Memory

Arrrrggghh !!

I believe the reason is that the lines above are too long.

If I do the same with Eric Englers or Frank Voorburghs IDE's ,they
produce a s19 file with 42 chars long lines.They work immedialtely.

Any setting to force each line to 32 when generating s19 file ?
0 Kudos

1,066 Views
CrasyCat
Specialist III
Hello
Yep
Just add a SLINELEN command to your .bbl file.

For instance
SLINELEN=20
Will generate s record with 20 bytes of data.

As far as I remember that number raw data (not including prefix byte, address, length and checksum).

CrasyCat
0 Kudos

1,066 Views
kwik
Contributor I
Okay ,I entered it manually myself in the beginning of the file ;

Here ,in burner.bbl ;

OPENFILE "%ABS_FILE%.s19"
format=motorola
busWidth=1
origin=0
len=0x1000000
destination=0
SRECORD=Sx
SLINELEN=16
SENDBYTE 1 "%ABS_FILE%"
CLOSE

Now the S19 file looks like this

S01B000048435331325F53657269616C5F4D6F6E69746F722E61627339
S113C000FEC03DFDC03B270E35ED31EC31697004B7
S113C01034FB310326F2FEC03FEC31270BED31181F
S113C0200A30700434F920F13DCF1100790011CCAD
S113C03009395B105A1207C806C0450000C041C048
S10EC040490000000010EF20FE00008B
S105FFFEC02914
S9030000FC

While the output from Syn_HG12 (which works) looks like this;

S01300002E2E2F62696E2F7661726D652E733139D3
S1132000CF2000162202CE2F62CD1000CC00122762
S113201007180A30700434F9CC00082708CE1012CF
S113202069300434FB16205C162F4A20FB2006205E
S113203018C60D162122C60A162122F60240C8012E
S11320407B0240CD0000CE0000CC00FA0434FD0831
S11320508E1B572FF4028D00042FEB3D1B946980D7
S113206069811C024203180BFF0003CC2580162053
S1132070F7CC000A1621D6F60240C8027B0240EED5
....
....
....

I still get Can't Write Target Memory;
which believe is because of that long S0 line....

(Obs that all lines above ,except the long S0 ,are equally long.
Its just the font giving different length for different chars)

Message Edited by kwik on 2006-08-25 12:05 PM

0 Kudos

1,066 Views
peg
Senior Contributor IV
Hi,
 
Just delete the S0 line or replace it with one from a file that works.
 
This will tell you if this is the problem.
 
S0 is not required by the target.
 
Regards David
 
0 Kudos

1,066 Views
kwik
Contributor I
Tried that ....didnt help ... okay I give up for now.

Back to Eric Englers GNU IDE.

But there was some interesting Application examples from freescale I would have liked to try out....especially AN2250 ...were you can convert a WAV file into a format that can be played on a 9s12 target !!

Hmmmm
0 Kudos

1,066 Views
CrasyCat
Specialist III
Hello
 
There is one major difference between the two S 19 file you mentioned in an earlier post.
With CodeWarrior you are linking code to access 0xC000-0xC0FF (i.e in Flash).
With the other IDE you are linking code to address 0x2000-0x20FF (i.e. in RAM).
 
Looks like your loader is not able to program the flash and is only loading into RAM :smileysad:
 
CrasyCat
0 Kudos

1,066 Views
kwik
Contributor I
Yes ,You are right !!!

When using that D-Bug12 you need a BDM to program flash. (As far as I understand,so far)

Thats quite allright for me at the moment.For a while at least.
Its' ok in a develpment phase to run RAM software only....faster turnaround,isnt it?
(Or is flash-burning quick nowadays ?)

I was used to set program start (and stack) in memory.x , before using Codewarrior...

I have tried to find out were to set program start address in Help ,but no luck.Also been looking through all Settings entries ...

.........cant find it?
0 Kudos

1,066 Views
CrasyCat
Specialist III
Hello
If you want CodeWarrior to link your application into RAM, adjust your PRM file and make sure you place DEFAULT_ROM into RAM location.
 
In this purpose modify your .prm file as follows (I assume you are using a HCS12DP256B):
In the SEGMENTS block change
    RAM = READ_WRITE 0x1000 TO 0x3FFF;
to
    RAM = READ_WRITE 0x1000 TO 0x1FFF;
    RAM_CODE = READ_ONLY 0x2000 TO 0x3FFF;
In the PLACEMENT block change:
    _PRESTART,               
    STARTUP,                 
    ROM_VAR,              
    STRINGS,            
    VIRTUAL_TABLE_SEGMENT,     
    DEFAULT_ROM, NON_BANKED,                  
    COPY                                                         INTO ROM_C000/*, ROM_4000*/;
to
    _PRESTART,               
    STARTUP,                 
    ROM_VAR,              
    STRINGS,            
    VIRTUAL_TABLE_SEGMENT,     
    DEFAULT_ROM, NON_BANKED,                  
    COPY                                                         INTO RAM_CODE;
 
Finally comment out the line
VECTOR 0 _Startup
 
This should generate a S record with code loaded at 0x2000.
 
Basically one of the issue with debugging code from RAM is there is only limited RAM available and you cannot debug big applications. 
CrasyCat
0 Kudos

1,066 Views
kwik
Contributor I
I have given up making a ram-file.

Instead I have succeeded in programming a flash version of my card.
Yippee ! Using CodeWarrior . So,bye bye ram ,hello flash.

So I'm happy. I was used to programming a ram-version of the program on the Dragon12 board (from Wytec),using EmbeddedGnu.exe from Eric Engler.
That gave me a very small turnaround time from version to version.

My final goal was (using the Dragon12 as an experimental board) to
flash my final target board ,a small 40 pin DIP module called
DRAGONfly12 from Wytec. Then this little card could do the job for me.
Its based on a MC9S12C128 MCU.

The job? To measure 8 temperature-points using AD592 temp.sensors
and send the result on a seral line to a PC. On the PC its easy to make graphics and stuff ,and plot temperature-curves.....

The little MC9S12C128 based card is now lying there ,sending one telegram pr second with 8 temps ,and blinking a small led....
0 Kudos