EmbeddedRelated.com
Forums

Programming via BDM

Started by carman712000 October 17, 2003
All -

I have a lot of code written, and now I'm trying to program the
interrupt vectors in FLASH (FF80-FFFF) to continue development and
debug. I'm currently using MiniIDE as my assembler and
communication utility to my controller. I have an evaluation board
set up as a POD connected to my board via a BDM cable.

When I used the older 68HC912B32 microcontroller (connected via BDM
cable as well) I could program both the EEPROM and FLASH by setting
the correct bits in the corresponding control registers and
downloading the file. Here is an example of what I'm talking about:
S> mm (set the bits in the control register)
S> load (fload for FLASH)

I'm now using the newer HCS12 series controller (DT256 to be more
specific). I am able to do the same type of thing to program
EEPROM. I set the clock divide register with the correct value
(0x15 --> divider of 21 for 4.0MHz crystal) and initialize the
EERPOM protection register to enable programming. I then
type `load' at the S> prompt and download my s19 file. Everything
works fine.

When I try to do the same thing for FLASH I can't get it to work. I
initialize the FLASH clock divide register with 0x15 again,
initialize the FLASH protection register, but when I type `fload' at
the S> prompt and download my s19 file the FLASH doesn't get
programmed. Does anyone have any ideas?



Are you using S-Records or Logical records to program your device. The B32 does not have address paging and hence uses S-Records (physical addresses). Many assemblers/compilers use
logical records in order to handle paging. You may have to convert your records in order to properly program them.

Regards
Dave Perreault

>
> From: "carman712000" <>
> Date: 2003/10/17 Fri AM 11:01:46 EDT
> To:
> Subject: [68HC12] Programming via BDM
>
> All -
>
> I have a lot of code written, and now I'm trying to program the
> interrupt vectors in FLASH (FF80-FFFF) to continue development and
> debug. I'm currently using MiniIDE as my assembler and
> communication utility to my controller. I have an evaluation board
> set up as a POD connected to my board via a BDM cable.
>
> When I used the older 68HC912B32 microcontroller (connected via BDM
> cable as well) I could program both the EEPROM and FLASH by setting
> the correct bits in the corresponding control registers and
> downloading the file. Here is an example of what I'm talking about:
> S> mm (set the bits in the control register)
> S> load (fload for FLASH)
>
> I'm now using the newer HCS12 series controller (DT256 to be more
> specific). I am able to do the same type of thing to program
> EEPROM. I set the clock divide register with the correct value
> (0x15 --> divider of 21 for 4.0MHz crystal) and initialize the
> EERPOM protection register to enable programming. I then
> type `load' at the S> prompt and download my s19 file. Everything
> works fine.
>
> When I try to do the same thing for FLASH I can't get it to work. I
> initialize the FLASH clock divide register with 0x15 again,
> initialize the FLASH protection register, but when I type `fload' at
> the S> prompt and download my s19 file the FLASH doesn't get
> programmed. Does anyone have any ideas? >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ >




You do know that the newer FLASH hardware doesn't even resemble the old
FLASH, don't you? It's just that you are quite specific about your
programming procedures, but didn't mention your hardware.

Gary Olmstead
Toucan Technology
Ventura CA

At 03:01 PM 10/17/03 +0000, you wrote:
>All -
>
>I have a lot of code written, and now I'm trying to program the
>interrupt vectors in FLASH (FF80-FFFF) to continue development and
>debug. I'm currently using MiniIDE as my assembler and
>communication utility to my controller. I have an evaluation board
>set up as a POD connected to my board via a BDM cable.
>
>When I used the older 68HC912B32 microcontroller (connected via BDM
>cable as well) I could program both the EEPROM and FLASH by setting
>the correct bits in the corresponding control registers and
>downloading the file. Here is an example of what I'm talking about:
>S> mm (set the bits in the control register)
>S> load (fload for FLASH)
>
>I'm now using the newer HCS12 series controller (DT256 to be more
>specific). I am able to do the same type of thing to program
>EEPROM. I set the clock divide register with the correct value
>(0x15 --> divider of 21 for 4.0MHz crystal) and initialize the
>EERPOM protection register to enable programming. I then
>type `load' at the S> prompt and download my s19 file. Everything
>works fine.
>
>When I try to do the same thing for FLASH I can't get it to work. I
>initialize the FLASH clock divide register with 0x15 again,
>initialize the FLASH protection register, but when I type `fload' at
>the S> prompt and download my s19 file the FLASH doesn't get
>programmed. Does anyone have any ideas? >
>-------------------- >
>">http://docs.yahoo.com/info/terms/
>