AnsweredAssumed Answered

Can not write into QG8 memory

Question asked by Guest on Jan 11, 2008
Latest reply on Feb 1, 2008 by Guest
Hi guys,
I have updated my BDM firmware and now I think the BDM is communicating with the QG8 but I can not be 100% sure, so may be someone can point me onto the right track. Here is what happens after I press debug

a window with title "HCS08 Open Source BDM Setup"

click OK

then there is a window with title "No Communication"
"There is currebtly no communication with the hardware.
Please try to connect before loading an executable file."

click OK

go menu> "Component" / "Set Connection..."

then a window with title "Set Connection" comes up

Processor:  "HCS08"

Connection "HCS08 Open Source BDM"

click OK

A window comes up with title "HCS08 Open Source BDM Setup"

click OK

===================================
(Message on the command window)
Loading Target ...
TARGET SECURED?  NO TARGET CONNECTED?
TARGET SECURED?  NO TARGET CONNECTED?
No Link To Target
====================================

(Then I try again)

menu: component / set connection...

click ok

===============================================
(Message on the command window)
Loading Target ...
TARGET SECURED?  NO TARGET CONNECTED?
TARGET SECURED?  NO TARGET CONNECTED?
No Link To Target
Loading Target ...
executing .\cmd\HCS08_OpenSourceBDM_startup.cmd

!// At startup the commands written below will be executed
Startup command file correctly executed.
Target Ready
done .\cmd\HCS08_OpenSourceBDM_startup.cmd

Startup command file correctly executed.
===============================================

The red led then starts to blink


The problem I have right now is I can not write to registers or memory using BDC commands, also I can not load into the flash.

menu > "HCS08 Open Source BDM" -> "Flash"

then a  window pops up with tilte "Non Volatile Memory Control"
Message:
"Error while loading diagnostics algorith to target system.
The chip may be secured, or the derivative selected may be wrong."

click OK

difernt window with the same title "Non Volatile Memory Control"
MCU speed:    --.--- MHz
select .fpp file to load

click OK

windoew pops up with title
"FPP file file MCUID is different from the target MCUID."

click OK

(Then I try again)
menu > "HCS08 Open Source BDM" -> "Flash"

window pops up with title "Non Volatile Memory Control"
Message:
"Error while loading diagnostics algorith to target system.
The chip may be secured, or the derivative selected may be wrong."

=====================================================
Message on command window

FP: FLASH parameters loaded for MC9S08QG8_V11(NVMIF2 rev 3) from E:\code_warrior_5_1\prog\fpp\Mcu1019.fpp
=====================================================




From the data sheet

4.6 Security
The MC9S08QG8/4 includes circuitry to prevent unauthorized access to the contents of FLASH andRAM
memory. When security is engaged, FLASH and RAM are considered secure resources.
Direct-page registers, high-page registers, and the background debug controller are considered unsecured resources. Programs executing within secure memory have normal access to any MCU memory locations and resources. Attempts to access a secure memory location with a program executing from an unsecured memory space or through the background debug interface are blocked (writes are ignored and reads return all 0s).
..................................................        ....................          .....           .
..........     .......    ...  .   .

"The on-chip debug module cannot be enabled while the MCU is secure. The separate background debug
controller can still be used for background memory access commands, but the MCU cannot enter active
background mode except by holding BKGD/MS low at the rising edge of reset."

Does anyone know if this is a security issue that I can not write to the memory of the QG8 using commands such as

WB 0x0003 0xFF
WB 0x0002 0xFF

I have tried these 3 steps on the DATA sheet page 50

Security can always be disengaged through the background debug interface by taking these steps:

1. Disable any block protections by writing FPROT. FPROT can be written only with background
debug commands, not from application software.
2. Mass erase FLASH if necessary.
3. Blank check FLASH. Provided FLASH is completely erased, security is disengaged until the next
reset.
To avoid returning to secure mode after the next reset, program NVOPT so SEC01:smileyfrustrated:EC00 = 1:0.

But

WB 0x0003 0xFF
WB 0x0002 0xFF

does not shows up on the memory map and I can not change the value on the memory map.

Can anyone suggest I should do to test if anything is working correctly?

Thank you.

Outcomes