LRAE doesn't execute downloaded S-rec on MC9S12C32

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

LRAE doesn't execute downloaded S-rec on MC9S12C32

2,739 Views
K_p
Contributor I
Hi

I have been doing a bootloader for MC9S12C32 and I have some trouble when when code gets JMP command to downloaded s-record wich is located in RAM 0x3800. Code is dummy-code that just prints stuff at SCI and its compiled with PIC- and PicRTS-options , works fine if it is just uploaded stand a lone code via Multilink.

Calling code:

asm ldx    startAddress.word;
asm jsr    0,x;

The checksum is correct and still i get Illegal BP, I'm out of options.

Juha-Matti
Labels (1)
0 Kudos
Reply
2 Replies

1,519 Views
K_p
Contributor I
Hi

It seems that some reason i don't get any replies, so let's get back to start.

Tools/Hardware:
MC9S12C32
FS CodeWarrior 4.6 (using Processor Expert)
PE Micro USB Multilink interface

Goal:
To make workin bootloader for CAN-analyzer via Serial connection (Actually USB, but converted by hardware) without extra buttons.

I Have read quite many of forum posts, and program examples. Both AN3391 and AllAcces-bootloader had nice features.

But I didn't get AN3391 work at all as i wanted, I modified the code and got SCI-connection, and even managed to write things to FLASH or RAM, but program execution was the problem. When was time to run loaded program, the processor started to jump radomly in memory.

AllAcces worked fine in our Hardware, but the problem is that we don't have chance to use extra button to "booting" , so would be nice to get signal via Serialport or somethin. I noticed that bootin route is made in start.c and therefore interrupts are dissabled and no RAM avaivable for variables? so i cannot use loop for scanning SCI? , and SCI-flags are out of question for marking arrived data?

So any of you wise men have any idea what kind of path is good to follow.
0 Kudos
Reply

1,519 Views
K_p
Contributor I
Hi again

Last message had a little error, last line of calling was jmp, not jsr. But anyway i'm still strugling those illegal break points and program crashes.

I have tried to write new code to ram or flash, neither works as i want. I have made "virtual" vector table and tried to configure that to new program but i cannot alter certain things because of Processor Expert, for example last bits are masked to FF by PE.

When I inspected the S-record i noticed there are "two vector tables" in record? Is that correct, the first is for virtual table and the second (few last lines) are for protected area in ROM. I tried to overwrite existing virtual table with new one before executing new code, still it crashes.

So any idea whats the key to get that loadable program running in RAM?

Juha-Matti
0 Kudos
Reply