E128 start issues...

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

E128 start issues...

1,615 Views
rhb3
Contributor II
Hello,

I have two current projects using a E64 80-pin part and a E128 11-pin part. For the former I'm able to load my code w/out issues. For the latter, I'm trying to load a very basic program and can't seem to get it to run at all. I build using maker.exe and a *.mak script. I've added this code to a generic CodeWarrior project to debug as well. This is simple init and turn on and LED code! Then I simulate, the code seems to get lost so I have a variety of questions/comments below and would appreciate any advice!

1) For the E128 part, I use INITRM = 0x20 in my _EntryPoint() code which is listed as INIT _EntryPoint in the PRM file. I also have RAM defined as 0x2000 - 0x3FFF in my PRM file. I think this is aligning my 8k RAM end to 0x3FFF. I'm leaving the INITRG at reset value 0x00 for both the E64 and E128.

2) What are the RAM boundaries for the E64 and E128? The E64 works when I set INITTM 0x30 and use PRM defining RAM from 0x3000 to 0x3FFF (4k).

3) I'm thinking of changing these to...0x21 and 0x39 to force alignment to the upper range but I have a hunch the alignment bit does not matter for these two parts but I'm uncertain as I can't find the boundary information! I've seen threads talking about 12k RAM in 16k boundary parts where this is more critical. For my two cased I surmise since the 0x20 sets the start it's really not meaningful to set the end too as 8K will put it there anyway.

4) I checked the MOD lines and things look good there. I confirmed with the debugger that the simple code is getting lost just after Init() in start12.c. Funny thing is, in the simulator this works just fine!

5) I don't specifically set PPAGE anywhere. I am using the -Mb switch for the compiler and assembler. I read some posts indicating main() might not be possible to find; however, my DEFAULT_ROM maps like: INTO PAGE_4400, PAGE_3C, PAGE_3D and followed by Page 38-3B for the E128 only. The 4400 is because I have a sector of flash variable storage from 4000 to 43FF...btw, is the sector size 0x400 for both the E128 and E64?.

6) I use -CpPPAGE=RUNTIME. Can someone explain this directive? I know it works with datapage.c but the default of 0x35 doesn't make sense to me. Is this setting where the PPAGE register is OR what it's value should be? For E64 this would be 0x3C-3F and fro E128 this would be 0x38-0x3F, right?

7) I've also tried programming with pemicro's prog12z with no luck. It works on the E64 but not the E128. Another point of intereset is that I used the -EnvSRECORD=SX and then use log2phy to convert the *.sx file. This works fine with my E64 code. For whatever reason, the *.phy files coming out of CodeWarrior seem much smaller! I took all my code and added it to a test CodeWarrior project to debug via my P&E USB-12 (???).

This code is extremely simple so that's why I really think I'm missing something specific to the E128. My E64 code was my first HCS12 experience and it seems to be working well so again, I feel I'm missing something particular to the E128 which is the first part in this series I've used that breaks the 64k address space.

Thanks for reading!
Labels (1)
0 Kudos
2 Replies

406 Views
rhb3
Contributor II
Some additional information...
 
Basically, the code is getting lost in Init() from start12.c. 
0 Kudos

406 Views
CompilerGuru
NXP Employee
NXP Employee
Well, to many questions for me alone to answer :smileyhappy:
Anyway, where in Init does it get lost?
Is the SP register pointing into RAM? Is the return address correctly pushed on the stack?
Does it set INITRM prior to calling Init (I hope so :smileyhappy:
The -CpPPAGE=RUNTIME instructs the compiler to use runtime routines to access all constants controled via PPAGE, do you have far data accesses at all?
If no, it should not matter much.
If yes, check if your simple test app works without them.

The 0x35 in datapage.c does not refer to the value inside of the PPAGE register, it does refer to the address of the PPAGE register itself (that's why it is called PPAGE_ADDR).
Also the value to be used for a HCS12 is 0x30, 0x35 was for some old HC12's only (and HC12 V4.5 does actually pick up 0x30, but I'm not sure which version you use).

For all the other questions: I did not see anything which I would know to be wrong, but also a bit outside of my knowledge area.

Daniel
0 Kudos