Error while attempting to program MC9S08GQ4 flash through CW TCL

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

Error while attempting to program MC9S08GQ4 flash through CW TCL

3,677 Views
barakmanos
Contributor III

While attempting to program MC9S08GQ4 flash through CW task (TCL), we are getting the following error:

 

fl::target -lc "MyTask"

fl::target -b 0x60 0x100

fl::target -v off -l off

cmdwin::fl::device -d "MC9S08QG4_FLASH" -o "4kx16x1" -a 0xf000 0xffff

cmdwin::fl::protect all off

Beginning Operation ...   

-------------------------

Performing target initialization ...   

Device MC9S08QG4_FLASH   

Detect frequence ...  

Frequence 4506.96 Khz  

Flash Operation.  

Error:  Erase sector failed.  Operation timeout.

UnProtecting .............

Error:  Protect Command Failed.  Operation timeout.Failed to erase sector data.

Device MC9S08QG4_FLASH   

 

When downloading (programming) it through the debugger, everything runs smoothly.

 

The task itself performs:

- Unprotect all sectors

- Erase all sectors

- Program image

 

As you can see, the 'unprotect' part fails on attempting to erase a sector (what is that supposed to mean anyway???).

 

The only reference I've found to this problem, is that the debugger trims the oscillator (not even sure what this means).

 

Any idea what could cause this problem?

 

Thanks

Labels (1)
0 Kudos
Reply
13 Replies

3,045 Views
barakmanos
Contributor III

Hi Jennie

Therre are a couple of different errors that we occasionally get (on top of the one initially mentioned).

Error Type 1:

fl::target -lc "ThimbleLeds"

fl::target -b 0x60 0x100

fl::target -v off -l off

cmdwin::fl::device -d "MC9S08QG4_FLASH" -o "4kx16x1" -a 0xf000 0xffff

cmdwin::fl::protect all off

Beginning Operation ...   

-------------------------

Performing target initialization ...   

Device MC9S08QG4_FLASH   

Detect frequence ...  

Error:  Detect frequence   Loop count suspended

Error:  Can't resume target  HC/RS/S12Z GDI Protocol Adapter : An error occurred while trying to write registers. The Debuggercan not write one register.

Flash Operation.  

Error:  Can't resume target  HC/RS/S12Z GDI Protocol Adapter : An error occurred while trying to write registers. The Debuggercan not write one register.

UnProtecting .............

Error:  Protect Command Failed.  HC/RS/S12Z GDI Protocol Adapter : An error occurred while trying to write registers. The Debugger can not write one register.Failed to erase sector data.

Device MC9S08QG4_FLASH is secured and protected  

Error Type 2:

fl::target -lc "ThimbleLeds"

fl::target -b 0x60 0x100

fl::target -v off -l off

cmdwin::fl::device -d "MC9S08QG4_FLASH" -o "4kx16x1" -a 0xf000 0xffff

cmdwin::fl::protect all off

Beginning Operation ...   

-------------------------

Performing target initialization ...   

Device MC9S08QG4_FLASH   

Detect frequence ...  

Frequence 4470.8 Khz  

Flash Operation.  

Error:  Erase sector failed.  Operation timeout. Security area should not be programmed with a value that leads to irreversible secure

. Protect violation error. Error in command sequence.

UnProtecting .............

Error:  Protect Command Failed.  Operation timeout. Security area should not be programmed with a value that leads to irreversible secure

. Protect violation error. Error in command sequence.Failed to erase sector data.

Device MC9S08QG4_FLASH is secured   

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

I just tested your ThimbleLeds.ttf from my side. It runs normally on my side.

in order to make it work, I create a dummy QG4 project, that generates a run configuration file and a s19 file for testing.

what I modified on your ThimbleLeds.ttf are:

1. becuase I don't have your s19 file, I use the s19 file generated by testqg4 project

2. set run configuration file generated from testqg4 project

pastedImage_0.png

then click on run, it executes successfully.

I attached my testing video.

I downloaded the video I uploaded previously from another computer, it can be played with windows Media player. please try another video player for it.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Hi Jennie

Can you please explain how can I emulate CW operation from a command line?

In other words, I need the command-line equivalent for 'Run Configuration'.

Thank you.

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Barak,

Is this command line issue a new question? if yes, could you please create a new thread for it. Normally, a new thread can be replied very fast.\

Best Regards,

Jennie

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Hi Jennie.

I have posted this question in a new thread, at How can I emulate CW 'burn-image' operation from a command line? .

Thank you for your help :smileyhappy:

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

yes, I just replied there.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Hi Jennie.

I have posted a full description of the problem that I am experiencing, in great details:

Flash Programming: CW-Debugger vs. TCL vs. TTF

Would you be able to refer to it?

Thanks.

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Barak,

I just answered there.

Have a great day,

Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

---

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Hi Jennie.

No, we're still working on the exact same problem.

Using a flash-programming task, I must have missed something that is done when downloading the image via 'Run Configuration'.

So I would like to work-around this problem by doing the exact same thing that the 'Run Configuration' functionality does in order to program the image to flash.

I believe that the way to do it is via the Burner.exe utility that comes along with CW, but I am not so sure of that, and I haven't been able to make use of it, as it keeps telling me:

ERROR B1000: Could not open 'input file' 'E:\Projects\Thimble\ThimbleLeds\Bin\ThimbleLeds\ThimbleLeds.abs'

Thank you for your help :smileyhappy:

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Hi Jennie.

Thank you for your quick response.

I am unable to watch the movie (I'm pretty sure it's corrupted or something).

But I do know what "Flash File to Target" is, and no - I am not using this option.

I am using a predefined task, see enclosed ttf file and screenshot (see enclosed files).

In opposed to downloading (programming) through the debugger, which always runs smoothly, this task doesn't always complete successfully, as depicted in the original post (above).

When this task does complete successfully, the output in CW console is:

fl::target -lc "ThimbleLeds"

fl::target -b 0x60 0x100

fl::target -v off -l off

cmdwin::fl::device -d "MC9S08QG4_FLASH" -o "4kx16x1" -a 0xf000 0xffff

cmdwin::fl::protect all off

Beginning Operation ...  

-------------------------

Performing target initialization ...  

Device MC9S08QG4_FLASH  

Detect frequence ... 

Frequence 4282.39 Khz 

Flash Operation. 

UnProtecting ........

Unprotect Command Succeeded. 

Device MC9S08QG4_FLASH  

cmdwin::fl::erase all

Beginning Operation ...  

-------------------------

Device MC9S08QG4_FLASH  

Erasing .............

Erase Command Succeeded. 

Device MC9S08QG4_FLASH  

cmdwin::fl::image -f "E:\\Production\\ThimbleLeds\\Bin\\ThimbleLeds.s19" -t "Auto Detect" -re off -oe off

cmdwin::fl::write

Beginning Operation ...  

-------------------------

Flash Operation.  ...

Auto-detection is successful. 

  File is of type Motorola S-Record Format. 

Device MC9S08QG4_FLASH  

Programming .........................

Device MC9S08QG4_FLASH  

Program Command Succeeded  

Flash Operation. done 

But again, this doesn't always complete successfully, so I've figured I must be missing something which the CW debugger takes care of.

Thanks again for your kind help :smileyhappy:

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

unfortunately I couldn't download your ttf and screenshot. can you please upload it directly as attachment.

click on "Actions"->"Edit" you can find the attach button

pastedImage_0.png


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

3,045 Views
barakmanos
Contributor III

Done, thank you.

0 Kudos
Reply

3,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

do you use "Flash File to Target" to program the flash?

I don't have QG4 but I just tested it with QG8 it works fine from my side. see attached video.

can you please let me know how to reproduce your problem?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply