Bootloader questions for HCS08AW

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

Bootloader questions for HCS08AW

1,228 Views
jerryn
Contributor I

I am trying to get a bootloader for field upgrading of my MC9S08AW32 app and have some questions.  I have read AN2295 and have built the latest project for the 9S08.

For starters I just built the bootloader and tried to establish communication with the master gui app.

1) The bootloader builds, but when I try to load and run it using a P&E Multilink BDM, it breaks, with the following displayed in the command window:

 

Frequency change to ~7902832hz.
Frequency change to ~0hz.
Frequency change to ~3790830hz.
ILLEGAL_BP

in>

 

I started the master gui app and it runs and displays:

Parsed S-record lines: 220   Bytes total:6873

Source address range: 0x8000-0xFFFF

Waiting for HS(S)08 reset ACK...

 

Restarting the BDM still does not change the above behavior

1) What do I need to do to get it to run?

2) Inspecting the included mc9s08aw60.prm, there are lines

  NVPROTROM = READ_ONLY 0xFFBD TO 0xFFBD;
  NVOPTROM  = READ_ONLY 0xFFBF TO 0xFFBF;
I was expecting these to be set to protect the bootloader.  What do there parameters have to be to protect the bootloader, while implementing the interrupt vector re-mapping?

3) If I want to build the bootloader into my app so that it will be loaded as a single file, what changes to the interrupt vector table or other changes to the prm file have to be accomplished, and still be compatible with the initializer?

My current .prm file is:

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    Z_RAM                    =  READ_WRITE   0x0070 TO 0x00FF;
    RAM                      =  READ_WRITE   0x0100 TO 0x086F;
    ROM                      =  READ_ONLY    0x8000 TO 0xFF8F;
    ROM1                     =  READ_ONLY    0xFF90 TO 0xFFCB;
 /* INTVECTS                 =  READ_ONLY    0xFFCC TO 0xFFFF; Reserved for Interrupt Vectors */
END

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    DEFAULT_RAM                         /* non-zero page variables */
                                        INTO  RAM;

    _PRESTART,                          /* startup code */
    STARTUP,                            /* startup data structures */
    ROM_VAR,                            /* constant variables */
    STRINGS,                            /* string literals */
    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */
    DEFAULT_ROM,
    COPY                                /* copy down information: how to initialize variables */
                                        INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */

    _DATA_ZEROPAGE,                     /* zero page variables */
    MY_ZEROPAGE                         INTO  Z_RAM;
END

STACKSIZE 0x400  

//VECTOR 0 _Startup     /* Reset vector: this is the default entry point for an application. */
 

 

4) For the MC9S08AW32, is the "FC Protocol, Version 2, HC9S08", the applicable version?

5) When using a 16 Mhz external oscillator, and ICG, is there still the ability to trim the baud rate clock?

Labels (1)
0 Kudos
2 Replies

385 Views
RWalker
Contributor I

I can only comment on the first part of your questions.

The ILLEGAL_BP is normal when running the bootloader with the BDM.

When using the BDM it halts on errors such as the ILLEGAL_BP.

 

You need to have the pc program running before you run the bootloader program in the micro otherwise the bootloader will timeout and cause a illegal operation to force a reboot which normally would allow the micro to start running your code if it were in the micro.

 

Other things i can think of that could cause probles are:

How do you have the PC serial port connected to the micro?

What serial port are you using in the micro to connect to the serial port on the PC?

Did you complile the bootloader to use the correct serial port in the micro?

Message Edited by RWalker on 2009-03-26 08:48 AM
0 Kudos

385 Views
jerryn
Contributor I

Thanks for the reply.  Yes, I needed to start the download app and select the download file....I got it to work, and found a few other details with my app that may need to be changed, as it includes writing to flash, which is the only part that seems to break versus a directly loaded version.

 

Jerry

 

 

0 Kudos