AnsweredAssumed Answered

Unable to program flash --- CW says 'Device is secured' even after a full erase

Question asked by Leif Finnerud on Sep 22, 2011
Latest reply on Sep 28, 2011 by Daniel Lundin

Hi,

 

I'm running into some problems trying to program the flash of S09QG8 and S09QE8 devices. I'm using CW 10.1 and a new PEmicro USB Mulitlink programmer. (However, I've tried the same hardware setup with classical CW, and it too refuses to program these two types of microcontrollers)

 

First I click Erase Device, that seems to work fine despite the worrying warnings:

 

 

fl::target -lc "8-kanals analog IO_MC9S08QG8_PnE U-MultiLink"fl::target -b 0x80 0x200fl::target -v off -l off -ie on -i "" -p MC9S08QG8cmdwin::fl::device -d "MC9S08QG8_FLASH" -o "8kx16x1" -a 0xe000 0xffffcmdwin::fl::erase all Beginning Operation ...    ------------------------- Initializing remote connection ...    Performing target initialization ...    Device MC9S08QG8_FLASH is secured    Can't autodetect flash clock divider. Set FCDIV register manually and use Active Debug Context for run configuration in target task.    Erasing .............Erase Command Succeeded.   Device MC9S08QG8_FLASH    cmdwin::fl::blankcheck all Beginning Operation ...    ------------------------- Flash Operation.   Device MC9S08QG8_FLASH     Blank Checking .............BlankCheck Command Succeeded.  

 

Then I click Program with Erase:

 

fl::target -lc "8-kanals analog IO_MC9S08QG8_PnE U-MultiLink"fl::target -b 0x80 0x200fl::target -v off -l off -ie on -i "" -p MC9S08QG8cmdwin::fl::device -d "MC9S08QG8_FLASH" -o "8kx16x1" -a 0xe000 0xffffcmdwin::fl::image -f "Z:\\LOF_Fritid\\Min_kildekode\\workspace_CW\\8-kanals analog IO\\MC9S08QG8\\8-kanalsanalogIO.abs.s19" -t "Auto Detect" -re on -r 0xe000 0xffff -oe offcmdwin::fl::erase image Beginning Operation ...    ------------------------- Auto-detection is successful.     File is of type Motorola S-Record Format.    Initializing remote connection ...    Performing target initialization ...    Device MC9S08QG8_FLASH    Detect frequence ...   Frequence 3971.07 Khz    Erasing .............Erase Command Succeeded.   Device MC9S08QG8_FLASH    cmdwin::fl::write Beginning Operation ...    ------------------------- Flash Operation.  ... Device MC9S08QG8_FLASH     Programming ....Warning.  ...Operation timeout. Protect violation error. Error in command sequence. Device MC9S08QG8_FLASH is secured    Program Command Succeeded    Flash Operation. done 

 

Hm... a warning, and confusing "Device is secured" message.

 

Now comes the problem: If I click Program with Erase a second time, I get this:

 

fl::target -lc "8-kanals analog IO_MC9S08QG8_PnE U-MultiLink"fl::target -b 0x80 0x200fl::target -v off -l off -ie on -i "" -p MC9S08QG8cmdwin::fl::device -d "MC9S08QG8_FLASH" -o "8kx16x1" -a 0xe000 0xffffcmdwin::fl::image -f "Z:\\LOF_Fritid\\Min_kildekode\\workspace_CW\\8-kanals analog IO\\MC9S08QG8\\8-kanalsanalogIO.abs.s19" -t "Auto Detect" -re on -r 0xe000 0xffff -oe offcmdwin::fl::erase image Beginning Operation ...    ------------------------- Auto-detection is successful.     File is of type Motorola S-Record Format.    Initializing remote connection ...    Performing target initialization ...    Device MC9S08QG8_FLASH is secured    Can't autodetect flash clock divider. Set FCDIV register manually and use Active Debug Context for run configuration in target task.   Error:  Erase Command Failed.  Device is secured. Please unsecure or do a mass erase operation. An invalid preference was passed to the GDI protocol plugin(HC GDI Protocol AdapterError: command failed

 and during this step I was also asked to power cycle the device (Problems entering BKGD mode).

The same problem appears if I click on CW's bug symbol in the menu bar (to enter the Debugging mode).

 

Some more info:

- I can effortlessly program 9S08QD4 devices in this HW setup. (Works for CW 10.1 and CW classic.)

- For alle three device types (QD4, QG8 and QE8) I use 3.3 volts for Vdd.

- The PEmicro USM Mulitlink is brand new

- The LEDs on the Usb Mulitlink light up in blue and yellow, as they should.

- I searched the foum for simular problems, but found none.

 

All ideas on how I can debug/solve this issue are appreciated !

 

Thanks!

Outcomes