Linker/Burner Problem??

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

Linker/Burner Problem??

Jump to solution
611 Views
sebasira
Senior Contributor I

I've got a problem here... It's hard for me to describe it with words, and I guess images do it better.

 

 

I place a BREAKPOINT at certain function, in the ASSEMBLY window of HiWave, I can see that the code to be executed is BGND... but I generate a list file and I can see that's not really the code...

 

Here's what I see on the list file (just a part of it)

   95:    /* RECEPCIONES DESDE LA PC */   96:    /***************************/   97:      void SCI_CENTRAL_PCRx (void){ 0000 1b9b         [2]     LEAS  -5,SP   98:        byte N, dato, fin1, fin2;   99:        byte* GETptr;  100:          101:        if (BAX_SCI_CENTRAL.Rx_cnt > 0){  0002 f60000       [3]     LDAB  BAX_SCI_CENTRAL:258  0005 2770         [3/1]   BEQ   *+114 ;abs = 0077  102:          AIR_saveTxPUTptr();   0007 4a000000     [7]     CALL  AIR_saveTxPUTptr,PAGE(AIR_saveTxPUTptr)  103:            104:          GETptr = BAX_SCI_CENTRAL.RxGPA[BAX_SCI_CENTRAL.RxGPA_GETidx];  000b f60000       [3]     LDAB  BAX_SCI_CENTRAL:251  000e 87           [1]     CLRA    000f 59           [1]     LSLD    0010 b745         [1]     TFR   D,X  0012 ece20000     [4]     LDD   BAX_SCI_CENTRAL:231,X  0016 6c82         [2]     STD   2,SP

 

and I've attached and Image of HiWave where you can see that the only part of the code that match is the higlighted line.

 

 

Any clues?? This never happend to me. I'm using MC9S12A256B and CW 4.6

 

Thanks in advance!!!

Labels (1)
0 Kudos
1 Solution
448 Views
sebasira
Senior Contributor I

My bad!

 

I talk to the one who assembly the hardware and he told me that they decided to use MC9S12A128B instead of MC9S12A256B because they've got pelnty of them and this new application does not requere as much flash.

 

Nevertheless, it's strange why there some code at page 30 at all, because it doesn't have that page.

If I recall correctly, HiWave used to warn me when the deravative selected doesn't match the one I'm loading the code to.

 

Thanks for your help kef!!!

Best Regards!

View solution in original post

0 Kudos
5 Replies
448 Views
kef
Specialist I

You asked recently for the help with flash routines. Couldn't it be some misbehaving flash routine? I would

1) edit debuggers memory map to make flash in question updated every time debugger stops, reflash code and inspect bytes at 308f00.

2) check S-records, if it matches the code.

0 Kudos
448 Views
sebasira
Senior Contributor I

Hi kef, thanks for your quick reply!

 

This new project does not perfom writes to FLASH, so flash routines are not present on it.

 

1) edit debuggers memory map to make flash in question updated every time debugger stops, reflash code and inspect bytes at 308f00.

I don't remember how to "edit debuggers memory map to make flash in question updated every time debugger stops". Right know if I inspect memory at address 308F00 I see all 0x00 (i've attached an image)

And from address 30EF8 to 308EFF I have: 14D97812ED0A1B9B

And If you chek below, it mataches with the S-REcord, but from 308F00 I see all zeros on the debugger

This is what I see right after I load the code to the MCU, before I let it run.

 

 

2) check S-records, if it matches the code.

I believe this is the part of the S-record that need to be inspected:

 

S224308EE013E8180312EE13D4180312EE13EA180313F114D7180313F114D97B12ED0A1B9BD8

 

S224308F00F613EF27704A822E30F613E88759B745ECE213D46C821A8234CC12EE3BC6E687E9


S224308F204A8D4D301B840431FD1A8234CC12EE3BC6E6876E844A8D4D301B846B84EC803B52

 

I don't know much about HEX-code but those are not zeros.

 

0 Kudos
448 Views
kef
Specialist I

Debugger memory map menu is in debugger under P&E multilink menu.

 

Since S records look fine (no zeros at 308F00), it doesn't look as a linker problem. Next you may try switching to simulator mode and loading the same abs/elf file. Also try loading not elf/abs, but S records file. It should give you are clue.

If your version of debugger flash loader (CW 4.6) doesn't like only 308f00, then you may exlude it from your prm file...

0 Kudos
449 Views
sebasira
Senior Contributor I

My bad!

 

I talk to the one who assembly the hardware and he told me that they decided to use MC9S12A128B instead of MC9S12A256B because they've got pelnty of them and this new application does not requere as much flash.

 

Nevertheless, it's strange why there some code at page 30 at all, because it doesn't have that page.

If I recall correctly, HiWave used to warn me when the deravative selected doesn't match the one I'm loading the code to.

 

Thanks for your help kef!!!

Best Regards!

0 Kudos
448 Views
kef
Specialist I

Setting PPAGE to 0x30 on 128k derivative should be the same as setting PPAGE to 0x38, the same page 38 should be mapped to page window. It is weird though why do you see that LEAS if code wasn't programmed. Maybe some debugger feature

0 Kudos