Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Flash writing problem.

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Flash writing problem. - lenux22 - Aug 2 11:29:00 2004

There is 2 flash blocks on Motorla DG128: Flash Block 0 and Flash.
Block 1. For Flash Block 1 i had set the security byte(0xFF0F) to 0xFE (security disabled) and set protection byte of block 0 (0xFF0D) to protect range 0xF000-0xFFFF (contains my bootrom and flash protections bytes). All working fine. But now I need to write flash block 1. But, then i erasing last address range of block 1, byte at address 0xFF0F also changed to 0xFF. What wrong whith it? changing. The byte at 0xFF0F can't be changed, becouse: 1) I writing flash 1, not flash 0. 0xFF0F address contained in flash
0. 2) Full 0xF000-0xFFFF range is protected. No bytes from it can not
changing.





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Flash writing problem. - Doron Fael - Aug 2 11:51:00 2004

Flash Block 0 corresponds to Pages 3C - 3F and Flash Block 1 corresponds to
Pages 38 - 3B (counter intuitive than can be expected).
Check figure 3-1 of:
http://www.freescale.com/files/microcontrollers/doc/ref_manual/S12FTS128KV2.pdf

This explains why the protection doesn't work as you expect it. You need to
protect the same address range in Flash Block 0 (rather than Block 1). In
order to protect the $F000 - FFFF range, you need to write the appropriate
protection byte to $FF0D instead of $FF0C.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html At 16:29 02/08/2004 +0000, you wrote:
>There is 2 flash blocks on Motorla DG128: Flash Block 0 and Flash.
>Block 1. For Flash Block 1 i had set the security byte(0xFF0F) to >0xFE (security disabled) and set protection byte of block 0 (0xFF0D) >to protect range 0xF000-0xFFFF (contains my bootrom and flash >protections bytes). All working fine. But now I need to write flash >block 1. But, then i erasing last address range of block 1, byte at >address 0xFF0F also changed to 0xFF. What wrong whith it? changing. >The byte at 0xFF0F can't be changed, becouse: >1) I writing flash 1, not flash 0. 0xFF0F address contained in flash
>0. >2) Full 0xF000-0xFFFF range is protected. No bytes from it can not
>changing. [Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Flash writing problem. - lenux22 - Aug 3 3:36:00 2004

Hello, Doron! Thank you for answer. I forget to say, i program flash in special
mode. Yes, i know about protection: 0xFF0C is protection byte for Flash Block 1 0xFF0D is protection byte for Flash Block 0. But I can't understand why secure byte changed (location 0xFF0F). Then I erasing Flash Block 1 (Flash Block 0 area 0xF000 is
protected!), the byte 0xFF0F (this area in not banked!) is changed to 0xFF. And
this is catastrophic for me - after this i need execute unprotection
procedure described in AN2400/D. Maybe I do something wrong: I erase flash in Special mode and using in erasing procedure instead
of: *((unsigned int *)(FLASH_ADDR)) = DUMMY_BYTE; FCMD = FLASH_ERASE;

this code: FADDR = FLASH_ADDR; FDATA = DUMMY FCMD = FLASH_ERASE;

In DG64 Flash Guide registers FADDR, FDATA mentioned as reserved
registers. But all my erasing/writing procedures (in special mode!)
of DG128's FLash Block 0 working fine for a year.
--- In , Doron Fael <doronf@n...> wrote: > Flash Block 0 corresponds to Pages 3C - 3F and Flash Block 1
corresponds to > Pages 38 - 3B (counter intuitive than can be expected). > Check figure 3-1 of: >
http://www.freescale.com/files/microcontrollers/doc/ref_manual/S12FTS1
28KV2.pdf > This explains why the protection doesn't work as you expect it. You
need to > protect the same address range in Flash Block 0 (rather than Block
1). In > order to protect the $F000 - FFFF range, you need to write the
appropriate > protection byte to $FF0D instead of $FF0C. > Hope this helps, > Doron > Nohau Corporation > HC12 In-Circuit Emulators > www.nohau.com/emul12pc.html > At 16:29 02/08/2004 +0000, you wrote: > >There is 2 flash blocks on Motorla DG128: Flash Block 0 and Flash. > >Block 1. For Flash Block 1 i had set the security byte(0xFF0F) to > > > >0xFE (security disabled) and set protection byte of block 0
(0xFF0D) > > > >to protect range 0xF000-0xFFFF (contains my bootrom and flash > > > >protections bytes). All working fine. But now I need to write flash > > > >block 1. But, then i erasing last address range of block 1, byte
at > > > >address 0xFF0F also changed to 0xFF. What wrong whith it?
changing. > > > >The byte at 0xFF0F can't be changed, becouse: > > > >1) I writing flash 1, not flash 0. 0xFF0F address contained in
flash > >0. > > > >2) Full 0xF000-0xFFFF range is protected. No bytes from it can not > >changing. > [Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Flash writing problem. - Doron Fael - Aug 3 3:58:00 2004

Location 0xFF0F is part of Flash Block 1 - not Flash Block 0.

In other words:

You need to protect Flash Block 1 - not Flash block 0, in order to protect
location 0xFF0F from being erased.

Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 08:36 03/08/2004 +0000, you wrote:
>Hello, Doron!
>
>Thank you for answer. I forget to say, i program flash in special
>mode. Yes, i know about protection:
>
>0xFF0C is protection byte for Flash Block 1
>
>0xFF0D is protection byte for Flash Block 0.
>
>But I can't understand why secure byte changed (location 0xFF0F).
>
>Then I erasing Flash Block 1 (Flash Block 0 area 0xF000 is
>protected!),
>
>the byte 0xFF0F (this area in not banked!) is changed to 0xFF. And
>this is catastrophic for me - after this i need execute unprotection
>procedure described in AN2400/D. Maybe I do something wrong:
>
>I erase flash in Special mode and using in erasing procedure instead
>of:
>
> *((unsigned int *)(FLASH_ADDR)) = DUMMY_BYTE;
> FCMD = FLASH_ERASE;
>
>this code:
>FADDR = FLASH_ADDR;
>FDATA = DUMMY
>FCMD = FLASH_ERASE;
>
>In DG64 Flash Guide registers FADDR, FDATA mentioned as reserved
>registers. But all my erasing/writing procedures (in special mode!)
>of DG128's FLash Block 0 working fine for a year. [Non-text portions of this message have been removed]



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Flash writing problem. - lenux22 - Aug 3 5:39:00 2004

Maybe i stupid, but I can't understand how it can be. Text on page 15
of FTS 128K User guide is describe Flash Block 0 holding protection
bytes for all other Flash blocks. And security byte is one for all
blocks. And it's located at Flash Block 0.
Page 15. Text under Table 3.1 :
Security information that allows the MCU to prevent intrusive access
to the Flash module is stored in the Flash Protection/Options field of
Flash block 0 as described in Table 3-1.
--- In , Doron Fael <doronf@n...> wrote: > Location 0xFF0F is part of Flash Block 1 - not Flash Block 0. > In other words: > You need to protect Flash Block 1 - not Flash block 0, in order to
protect > location 0xFF0F from being erased. > Doron > Nohau Corporation > HC12 In-Circuit Emulators > www.nohau.com/emul12pc.html > At 08:36 03/08/2004 +0000, you wrote: > >Hello, Doron! > > >Thank you for answer. I forget to say, i program flash in special > >mode. Yes, i know about protection: > > >0xFF0C is protection byte for Flash Block 1 > > >0xFF0D is protection byte for Flash Block 0. > > >But I can't understand why secure byte changed (location 0xFF0F). > > >Then I erasing Flash Block 1 (Flash Block 0 area 0xF000 is > >protected!), > > >the byte 0xFF0F (this area in not banked!) is changed to 0xFF. And > >this is catastrophic for me - after this i need execute
unprotection > >procedure described in AN2400/D. Maybe I do something wrong: > > >I erase flash in Special mode and using in erasing procedure
instead > >of: > > > *((unsigned int *)(FLASH_ADDR)) = DUMMY_BYTE; > > FCMD = FLASH_ERASE; > > >this code: > >FADDR = FLASH_ADDR; > >FDATA = DUMMY > >FCMD = FLASH_ERASE; > > >In DG64 Flash Guide registers FADDR, FDATA mentioned as reserved > >registers. But all my erasing/writing procedures (in special
mode!) > >of DG128's FLash Block 0 working fine for a year. > [Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Flash writing problem. - Doron Fael - Aug 3 6:11:00 2004

I am sorry. My mistake.
My email from yesterday contained the right information. The email from
today was wrong (I got confused between Block 1 and Block 0).

Which S12DG128 mask set are you using? I believe early mask sets (0L85D)
did not have Flash protection and security fully working. Maybe this is the
source of your problem.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 10:39 03/08/2004 +0000, you wrote:
>Maybe i stupid, but I can't understand how it can be. Text on page 15
>of FTS 128K User guide is describe Flash Block 0 holding protection
>bytes for all other Flash blocks. And security byte is one for all
>blocks. And it's located at Flash Block 0.
>Page 15. Text under Table 3.1 :
>Security information that allows the MCU to prevent intrusive access
>to the Flash module is stored in the Flash Protection/Options field of
>Flash block 0 as described in Table 3-1. [Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Flash writing problem. - lenux22 - Aug 3 7:40:00 2004

Yes, i have 0L85D mask. :( But Freescale web-site on DG128 page
provide erratas only for mask sets 0L40K. :(

--- In , Doron Fael <doronf@n...> wrote: > I am sorry. My mistake. > My email from yesterday contained the right information. The email
from > today was wrong (I got confused between Block 1 and Block 0). > Which S12DG128 mask set are you using? I believe early mask sets
(0L85D) > did not have Flash protection and security fully working. Maybe this
is the > source of your problem. > Hope this helps, > Doron > Nohau Corporation > HC12 In-Circuit Emulators > www.nohau.com/emul12pc.html



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Flash writing problem. - Steve Russell - Aug 3 13:31:00 2004

Hi,

Using the Freescale keyword search for 0L85D I got:
http://www.freescale.com/files/microcontrollers/doc/errata/MSE9S12DT128B_0L85D.pdf

They keep shuffling things around...

Hope this helps
Steve Russell
Nohau Emulators

At 05:40 AM 8/3/2004, lenux22 wrote:
>Yes, i have 0L85D mask. :( But Freescale web-site on DG128 page
>provide erratas only for mask sets 0L40K. :( >
>
>--- In , Doron Fael <doronf@n...> wrote: > > I am sorry. My mistake. > > My email from yesterday contained the right information. The email
>from > > today was wrong (I got confused between Block 1 and Block 0). > > > Which S12DG128 mask set are you using? I believe early mask sets
>(0L85D) > > did not have Flash protection and security fully working. Maybe this
>is the > > source of your problem. > > > Hope this helps, > > Doron > > Nohau Corporation > > HC12 In-Circuit Emulators > > www.nohau.com/emul12pc.html > >Yahoo! Groups Links




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )