9S12XDP512 New User Help

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

9S12XDP512 New User Help

3,929 次查看
Lewis139
Contributor I

Hello all,

 

I've recently began working with the 9S12XDP512 board from Technological Arts, and I've having a bit of trouble. I'm sure these are just growing pains, but I've got a couple of problems I could use some advice on:

 

1.) I'm using CodeWarrior 5.9.0 (info from the About CodeWarrior menu) with SRecCvt GUI to compile my .s19 then convert it to the correct format as I understand it. I know my board and loading technique are in order, because I'm able to load this .s19 file (acquired from a website):

 

S2147F4000CF400016405587CE10008E100027056AD9
S2147F4010000820F6CE405ACD10008E405A2706184C
S2147F40200A307020F516402A20FE34B7751B9EC6D0
S2147F4030FF7B025AC6FF7B02584A8000E02010C6EC
S2147F4040FF7B02584A8000E07902584A8000E020D1
S20E7F4050EEB757303D1D0016073D02
S2147FFFD0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD
S2147FFFE0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D
S2147FFFF0FFFFFFFFFFFFFFFFFFFFFFFFFFFF40004B
S21478000034B7751B9ECC00006C1E2007EC1EC30010
S212780010016C1EEC1E8CFA0025F2B757300AEB

 

onto the flash memory and it works just fine (blinks the LED). However, when I try to simulate the output using  CodeWarrior and SRecCvt, I don't get anything like this. Mine, after conversion, looks like this:

 

S21CFE8000C6FF7B025A7B02584A801AFEC6FF7B02584A801AFE790258C3
S21CFE801820EE1869AE2003186280EC80B74DCDFA0035B746C7873BB74A
S21CFE80306416C0312DE93A0AFEC011FDC00F270E35ED31EC3169700453
S21CFE804834FB310326F2FEC013EC31270BED31180A30700434F920F160
S21CFE80600AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12
S21CFEBFF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF2100C6055B134AD3
S21CFF80088038FE4A8000FE0000C015C03B00000000000000000000000E
S21CFF80200000000000000000000000000000000000AC8418AE82311B80
S21CFF80388405400000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76
S9030000FC

 

If my settings are correct (which may be part of the problem), I'd expect my output, which was compiled with the same*.c file, to be similar to that of the previous, correct .s19. When I load this not-so-snazzy code on the board, obviously it doesn't work. Any advice for me on this issue? I just want to write a program to blink the LED on the board using CodeWarrior and SRecCvt.

 

2.) Where can I find a good document on how to code for the 9S12XDP512? I'm a software engineer by profession, using only high-level languages, and I'm a bit out of my element. I am used to having large developer communities to leech information from, but it seems like there isn't as much "entry-level" information for these micro controllers. I don't want my hand held throughout the process, but I'd like some good info that can get me started. Any ideas?

 

Thanks in advance for your help. Like I said, I'm new to all of this, so I'll go ahead and claim ignorance for any fouls in my post.

 

-Derrick

标签 (1)
0 项奖励
回复
8 回复数

1,639 次查看
kef
Specialist I

I don't know why are you converting S-records using sreccvt. CW should produce  S-records file with banked addresses, and another S-records file with global addressing addresses. Look in your bin folder for *.sx and *.s19 file.

 

First your file uses global addresses. Below 7FFFF0 is global address of S record. 14 in front of it hex S-record length. And underlined 4000 is reset vector at global address 0x7FFFFE:

 

S2147FFFF0FFFFFFFFFFFFFFFFFFFFFFFFFFFF40004B

 

 

Another file uses banked addresses. I don't see reset vector in it, but red FE is PPAGE and 8000 16bit CPU address.

 

S21CFE8000C6FF7B025A7B02584A801AFEC6FF7B02584A801AFE790258C3

0 项奖励
回复

1,639 次查看
Lewis139
Contributor I


"First your file uses global addresses. Below 7FFFF0 is global address of S record. 14 in front of it hex S-record length. And underlined 4000 is reset vector at global address 0x7FFFFE:"

 

I knew that this was the reset vector, and that was actually another question I had. I didn't see the reset vector in my converted code OR my compiled program from CodeWarrior.

 

"I don't know why are you converting S-records using sreccvt. CW should produce  S-records file with banked addresses, and another S-records file with global addressing addresses. Look in your bin folder for *.sx and *.s19 file."

 

From all the documentation I've read, for the board I have (9S12XDP512) you have to convert the product of CodeWarrior to produce something to load. When I look at the raw .s19 file produced by CW, it looks very odd compared to the proper .s19. Nothing seems to line up, and in some cases the adresses aren't contiguous. I'll post an example of the code tomorrow, I'm out of the lab today.

 

If it's true that I don't have to convert the file to get banked addressing, what settings can I change to make it look as it should?

 

Thanks again.

 

-Derrick

0 项奖励
回复

1,639 次查看
Lewis139
Contributor I

Here is the C Code for the program I'm trying to make work:

 

#include "mc9s12dp512.h"

 

void blink_delay(void);

 

void main()
{
   int i;
   DDRP = 0xFF;
   PTP = 0xFF;


   blink_delay();


   while(1)
   {
      PTP = 0xFF; //LED on
      blink_delay();
      PTP = 0x00; //LED off
      blink_delay();
    }
}


void blink_delay(void)
{
   int i;
   for(i=0;i<64000;i++)
   {
      ;
   }
}

 

Here is the .s19 file that is generated by CW for the above code:

 

S02A0000433A5C4320436F64655C435750726F6A5C435750726F6A5C62696E5C50726F6A6563742E616273D0
S123C000CF2100C6055B134A8038FE4A8000FE0000C015C03B00000000000000000000005B
S120C0200000000000000000000000000000000000AC8418AE82311B840540000072
S105FFFEC0003D
S224FE8000C6FF7B025A7B02584A801AFEC6FF7B02584A801AFE79025820EE1869AE20031843
S224FE80206280EC80B74DCDFA0035B746C7873BB76416C0312DE93A0AFEC011FDC00F270E1D
S224FE804035ED31EC3169700434FB310326F2FEC013EC31270BED31180A30700434F920F113
S205FE80600A12
S9030000FC

 

From what I understand, this file is in the "logical" format and must be converted by SRecCvt into the physical format. Is this correct? If not, how can I alter my CW settings to give me the correct output? Thanks again

 

-Derrick

0 项奖励
回复

1,639 次查看
kef
Specialist I

If you are using CW integrated Hivawe debugger, then you don't need to convert S records. When you press start button, *.abs file is loaded to your target.

If you are using some third party software, which understands S-records only, then this software defines requirements for S-files. Some are configureable and may understand both banked S2 addresses and linear/global addresses.

I said previously that in bin folder you may find *.sx file. It seems for S12X targets CW generates S19 and GLO S-records files. For S12 CW generates S19 and SX S-records files. In S19 file, S2 records have banked addresses, in SX file - linear S2 addresses, in GLO file- global S2 addresses. "Logical" may mean either linear or global.

0 项奖励
回复

1,639 次查看
CompilerGuru
NXP Employee
NXP Employee

In a standard S12/S12X wizard generated project there is a *.s19 file which contains the content in banked/logical format.

In a S12 project there is additionally a *.phy, in a S12X additionally a *.glo file. Those files are SRecords with physical/global addresses, same content, different address encodings.

Both files are generated by the burner, which is configured with a *.bbl file. The bbl file contains explicitely how the two srecords should be generated. Therefore custom *.bbl's

can generate different files with different content.

 

A *.sx file is not generated by default. But the linker and the assembler (in absolute assembly mode) support to generate srecords as well, and those file get this extension if they are not otherwise configured. As the linker/assembler generated files contain the same content as the *.s19, there is usually no need for *.sx files. Also the linker/assembler do not offer the configuration posibilities of the burner (bbl file).

 

Last, but not least, many tools support to directly load the elf file (*.abs), I recommend to use elf files with all tools supporting them.

0 项奖励
回复

1,639 次查看
Lewis139
Contributor I

I wouldn't really consider my issue solved yet...

 

CodeWarrior is not generating a .phy file when I compile it. All it's doing is creating the .s19 file. How can I force it to create the other file? Even hitting F5 doesn't produce the .phy file. If it can produce the .phy file for me then I wouldn't have to convert it. Any ideas?

 

-Derrick 

Message Edited by Lewis139 on 2009-04-14 04:01 PM
0 项奖励
回复

1,639 次查看
CrasyCat
Specialist III

Hello

 

According to my understanding you are looking for a S record file containing all addresses in linear format

 

Search www.freescale.com for SRECCVTSW. This is a small utility program, which can convert S record containing banked addresses into S record file containing linear ones.

 

CrasyCat

0 项奖励
回复

1,639 次查看
CompilerGuru
NXP Employee
NXP Employee

I don't know your project, so good possible that it does not happen.

For standard wizard generated projects the *.bbl file is reponsible for creating the *.s19 and the *.glo (for a S12X it generates a *.glo file, not a *.phy file).

If this does not happen for you, compare your bbl with one created by the wizard.

 

Attaching the burner.bbl as generated for a S12XDP512.

 

 

Daniel

 

0 项奖励
回复