Fail to program FXTH87xx11 using USBDM

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

Fail to program FXTH87xx11 using USBDM

Jump to solution
10,832 Views
sunrme
Contributor III

Hi all,


I tried to use USBDM to program the FXTH87xx . But in the list of chips in Flash Programmer this MCU is absent. So, I insert this in the hcs08_devices.xml:

     <!ENTITY HCS08-alt-load-flash SYSTEM "HCS08/FXTH87xx11_Starter_Project_CW10.abs.s19">

     <flashProgram id="HCS08-alt-load-flash">

          &HCS08-alt-load-flash;

     </flashProgram>

     <device family="HCS08" name="FXTH87xx11">

          <memory type="ram">

               <memoryRange start="0x000090" end="0x00028F" />

          </memory>

          <memory registerAddress="0x1820" type="flash" securityAddress="0xFFB0">

               <securityEntryRef ref="HCS08-fnored-security"/>

               <memoryRange start="0x00C000" end="0x00DFBF" />

          </memory>

          <sdid value="0x002C" />

          <flashProgramRef ref="HCS08-alt-load-flash" />

     </device>

I'm not sure thay I use right values especially securityEntryRef section. But now flash Programmer detect my chip. But when I click Program Flash, on EraseMass status pop up error:

17375_17375.pngnew error 2.png

Hope someone can help me.

Regards

Labels (1)
Tags (3)
1 Solution
6,759 Views
pgo
Senior Contributor V

Hi Sunrme,

Could you change the end address in the XML file to 0xDFFF as it appears that there is a pseudo-vector table to be programmed as well.  Also remove the references to security - in other words use the following:

  <device family="HCS08" name="FXTH87xx11-Partial-Erase">
     <memory type="ram">
        <memoryRange start="0x000090" end="0x28F" />
     </memory>
        <memory registerAddress="0x1820" type="flash">
           <memoryRange start="0x00C000" end="0xDFFF" />
     </memory>
     <sdid value="0x002C" />
     <flashProgramRef ref="HCS08-alt-load-flash-program" />
     <note>Untested</note>
  </device>

Make sure you select EraseSelective when programming.

pastedImage_0.png

bye

View solution in original post

0 Kudos
47 Replies
4,051 Views
sumirjha
Contributor I

Hello,

I had another issue regarding programming of FXth8705D, The problem was that everytime I try to detect or Program the ic, It always throws some error like this,

CaptureError.PNG

Now, After Scratching my head all day started reading datasheet more carefully, and Then I came to this section of the datasheet.

Capture.PNG

In very first bullet it says, In order to enter into BDM, BKGD should hold down while powering up the FXTH87xx. and My Programmer doesn't have the software control over powering up the target.

What was I doing Wrong?

I inserted all four connector RST, GND, VCC, BKGD, simultaneously which somehow doesn't let FXTH87xx entering into BD mode. What I did was, I connected RST, GND, BKGD first then after that VCC. Which Ensured the First point in the bullet, in above image. and Voila.............I Succeed.

Hope It will help someone, and might save his day.

Thanks and Regards

Sumir Kumar Jha, India

0 Kudos
4,051 Views
pgo
Senior Contributor V

Hi Sushil,

I'm sorry but I haven't used a multi-link for quite a while - I'm unsure if there is a method for dumping the memory contents.

You might want to post on the 8-bit Microcontrollers​ group.

bye

0 Kudos
4,051 Views
gerardogarza
Contributor I

Hi pgo, I want to learn about TPMS, but I dont understand how it is programmed or what device should I use to do it. Can you guide me a little with this?
Thanks for your attention.

0 Kudos
4,051 Views
pgo
Senior Contributor V

Hi Razvan,

I don't actually use a multi-link so the following may be incorrect:

Open the launch configuration and select Edit under target connection:

pastedImage_1.png

Select Advanced Programming Options:

pastedImage_2.png

You can then protect ranges:

pastedImage_3.png

bye

0 Kudos
4,051 Views
sushilnikam
Contributor III

Hi pgo,

Im working on FXTH870502DT1, Im facing the same problem stated by all. I think internal flash of my chip got erased while programming. Will you please tell me the method of getting/reading flash from another chip. Im using universal multilink. Please tell me how to get image of chip firmware as Im having few another chips.

0 Kudos
4,051 Views
georgepeterson
Contributor II

That was my experience; after I erased all flash, the FXTH87 could no longer use the firmware functions and I could not re-program it. If this is indeed the issue, I believe there is a way to restore the flash back to factory settings but I don't know how to do that.

I'm using the P&E debugger. The settings I'm using are straight from the Codewarrior help file (CW v10.6). I searched the help file for "flash programmer" and clicked on the top  search result which walked me through the whole process.

0 Kudos
4,051 Views
georgepeterson
Contributor II

There appears to be some factory code in Flash that is needed, but unprotected.

I tried to reprogram my FXTH87 but before doing so I erased all of the user flash thinking this was safe. This effectively "bricked" the FXTH87 and made the TPMS functions unuseable. The problem seems to be that the erasing deleted NVOPT.

So I agree with only doing selective erase.

4,051 Views
sunrme
Contributor III

Hi George,

I am so surprised about this unprotected code in Flash memory. So I think that, I already "bricked" my only two samples :smileycry:. So I can't to reprogram this memory range?


Are you using USBDM for flash and debug? Could you show settings that you using for this in the hcs08_devices.xml or may be some additional changes and settings. It will be really helpful.

0 Kudos
4,052 Views
sunrme
Contributor III

I attached log files, mb it will help

0 Kudos
4,052 Views
pgo
Senior Contributor V

Hi Sunrme,

The error message in the supplied log file is very strange and appears to have nothing to do with the device being programmed.  That is, the error should be impossible as it is complaining about a self check on the provided programming algorithm.

Could you please update to a more current version of USBDM as the one indicated in the log file is quite old.

http://sourceforge.net/projects/usbdm/files/Version%204.10.6/Software/

You will also need to update the BDM firmware.

And then try adding the following to the HCS08 config file and repost the logs please.  This is basically the same as you suggested.

<!--
====================================================================================
Experimental
-->
<device family="HCS08" name="FXTH87xx11">
<memory type="ram">
<memoryRange start="0x000090" size="0x28F" />
</memory>
<memory registerAddress="0x1820" type="flash" securityAddress="0xDFFB">
<securityEntryRef ref="HCS08-fnored-security" />
<memoryRange start="0x00C000" end="0x00DFFB" />
</memory>
<sdid value="0x0000" />
<flashProgramRef ref="HCS08-alt-load-flash-program" />
<note>Untested</note>
</device>
<!--
====================================================================================
Experimental
-->

0 Kudos
4,048 Views
王亚萍
Contributor I

Hi,pgo,

  I can download the pastedImage_0.png, but for another s19 file,it shows pastedImage_1.png

But  another person can download it .How does it happen?

0 Kudos
4,048 Views
pgo
Senior Contributor V

Hi Yaping,

Can you provide the image file and I will see if there is some obvious reason?

bye

0 Kudos
4,048 Views
王亚萍
Contributor I

I have solved it. Simply because of the low charge.

Thank you all the time!

0 Kudos
4,052 Views
sunrme
Contributor III

Hi pgo,

I updated firmware to Ver 4.10.6 and USBDM to 4.10.6.230. I added your configuration, but changed ssid from 0x0000 to 0x00C2, because after click detect chip, chip is not determined by the USBDM FLASH PROGRAMMER. And get the same issue, logs attached.

0 Kudos
4,052 Views
pgo
Senior Contributor V

Hi Sumne,

I mistyped - Could you change the RAM "size" to "end" as in you example.

<memoryRange start="0x000090"  end="0x28F" />

bye

4,052 Views
sunrme
Contributor III

Hi pgo,

I changed "size" to "end" and got this:

new issue.png

0 Kudos
4,052 Views
pgo
Senior Contributor V

Hi Sunme,

The log file indicates that you are trying to program the region  [0x00DFFC..0x00E00A] (at least) which is not inside the area of Flash that is meant to be usually modified which is limited to

[0xC000..0xDFFF].

Where is you image file coming from?  Does it contain the FXTH87xx on-chip routines as well as the new firmware you want to load?

If you wish to re-program the ENTIRE chip including overwritting the on-chip routine then the memory map would need to be modified.

If you can post the .sx file I can inspect it if you want.

PS. The above is based on my very limited understanding of the FXTH chip.

bye

.

Log file:

1.00:                          FlashProgrammer::doFlashBlock(): Exit ================
-0.00:                          FlashProgrammer::doFlashBlock(): Entry ===============
-0.00:                          FlashProgrammer::doFlashBlock(): op=OpBlankCheck, [0x00DFFC..0x00E00A]
-0.00:                          FlashProgrammer::doFlashBlock(): Checking RAM[0x000090..0x00028F]...
-0.00:                          FlashProgrammer::doFlashBlock():   ...Not in this region
-0.00:                          FlashProgrammer::doFlashBlock(): Checking FLASH[0x00C000..0x00DFFB]...
-0.00:                          FlashProgrammer::doFlashBlock():   ...Not in this region
-0.00:                          FlashProgrammer::doFlashBlock(): Block -|-[0x00DFFC...] is not within target memory.
4,052 Views
sunrme
Contributor III

Hi pgo,

I created an empty project, built it and try to flash. I don't have *.sx file, codeWarrior generated *.s19 file (attached).

0 Kudos
6,760 Views
pgo
Senior Contributor V

Hi Sunrme,

Could you change the end address in the XML file to 0xDFFF as it appears that there is a pseudo-vector table to be programmed as well.  Also remove the references to security - in other words use the following:

  <device family="HCS08" name="FXTH87xx11-Partial-Erase">
     <memory type="ram">
        <memoryRange start="0x000090" end="0x28F" />
     </memory>
        <memory registerAddress="0x1820" type="flash">
           <memoryRange start="0x00C000" end="0xDFFF" />
     </memory>
     <sdid value="0x002C" />
     <flashProgramRef ref="HCS08-alt-load-flash-program" />
     <note>Untested</note>
  </device>

Make sure you select EraseSelective when programming.

pastedImage_0.png

bye

0 Kudos
4,053 Views
sunrme
Contributor III

Hi pgo,

Thank you for your help, USBDM flashed FXTH87 finally. I changed hcs08_devices.xml, but don't change EraseMass to EraseSelective, because when selected EraseSelective, I got fail (I added logs).

And it relly be cool if I can to debug in codeWarrior this chip. And when I try to do this I got issue:

Error launching fxth87_empty FLASH

Bad arguments passed to function

If you will help me with this, I will be grateful. But I don't know where get logs, only what generated CW (attached)

0 Kudos