USBDM HCS12 flashing and mass erase not working on MC9S12UF32

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

USBDM HCS12 flashing and mass erase not working on MC9S12UF32

Jump to solution
5,629 Views
crosswick
Contributor I

Hi all. The context is: for a customer, I'm trying to repair the MIDI scanning electronics of a piano keyboard that was on the market for only a short while in the early 2000's. From contacting the original developer and doing some troubleshooting, the diagnosis became that the MC9S12UF32 was probably faulty.

I finally was able to obtain a couple of these MCUs (albeit -PB instead of -PBE, which I don't think should matter) and after desoldering and desoldering and connecting the board to a USBDM off of Amazon (this one), I found these observations:

  • in HCS12 programmer (version 4.12.1.280b, USBDM firmware also updated), the chip was successfully detected
  • when attempting to Program Flash with the relevant .s19 hex file, error: "Programming of the target flash failed! Reason: Unsupported operation or options for this chip"
  • then Mass Erase which worked - not sure what the Security setting was, I hadn't touched it so probably Unsecure?
  • then try again to Program Flash with a different hex file, error: "Target is secured. The Mass Erase option must be selected to program the device."
  • then Mass Erase again, which this time gives error: "Unsecuring the device failed. Reason: TCL script returned an error".
  • try to detect the chip again, error: "Failed to probe target. Reason: Target is secured."

After seeing this post I tried flashing with version 4.12.1.140, but that did not work either.

After seeing this post I've tried powering the target from a PSU and also doublechecked my connections - it seems like they are good; also because at first, the chip is detected properly.

Any advice well appreciated, thanks in advance.

20220523_233106

 

0 Kudos
1 Solution
5,481 Views
pgo
Senior Contributor V

Hi,

I was able to program the images you provided to a UF32.

It required updating the description of the UF32 memory regions in the USBDM device data.

The version uploaded to Scourceforge (USBDM_4_12_1_290_Win) has these changes (along with a number of others related to the UF32):

https://sourceforge.net/projects/usbdm/files/Version%204.12.1/Software/ 

bye

View solution in original post

0 Kudos
10 Replies
5,482 Views
pgo
Senior Contributor V

Hi,

I was able to program the images you provided to a UF32.

It required updating the description of the UF32 memory regions in the USBDM device data.

The version uploaded to Scourceforge (USBDM_4_12_1_290_Win) has these changes (along with a number of others related to the UF32):

https://sourceforge.net/projects/usbdm/files/Version%204.12.1/Software/ 

bye

0 Kudos
5,522 Views
crosswick
Contributor I

Alright I've just tried again with:

  • fresh UF32 soldered to the board
  • USBDM 4.12.1.285 (previous version uninstalled beforehand)
  • connect the board - Detect Chip works
  • Security set to Unsecure
  • Programming Erase Mode set to EraseMass
  • Load Hex File, select the "boot.abs.s19" file (there's also "R73.abs.s19" which the developer remembers as secondary)
  • press Program Flash, then a short progress bar and then the error:

Programming of the target flash failed!

Reason: Program data not within target Flash Memory

bit cautious to try anything else now without first consulting you, @pgo 

0 Kudos
5,506 Views
pgo
Senior Contributor V

Hi,

I don't blame you for being cautious.

The programmer expects memory images to be in paged format.  It is possible the image is linear.

Anyway, if you can provide the flash image I will check the format and advise.

This assumes the the image is not confidential.

Best to do this by Private Message.

bye

PS.

You can check for problems by doing a verify (with Security=Unsecure).  This should report the same error rather than reporting that it is secured!

You can do a rough check if it is a linear image by selecting Linear Image before loading the file and doing a verify.  It should report failure to verify rather than complaining about being out of range.

I rather hate the UF32.

bye

0 Kudos
5,566 Views
pgo
Senior Contributor V

Hi ,

I have uploaded a new version of USBDM that copes with UF32 better:

https://sourceforge.net/projects/usbdm/files/Version%204.12.1/Software/ 

Tested with a UF32 programming and mass erase.

(I now have only 1 UF32 that is not bricked. They are a pain!)

bye

0 Kudos
5,578 Views
pgo
Senior Contributor V

Hi,

I'll see if I can find a UF32 to test with.

Note that this particular chip has a errata that may be affecting the outcome:

https://www.nxp.com/docs/en/errata/MSE9S12UF32_1L47S.htm#xxMUCts01498

I suggest you check the mask version and if the above applies.

This chip should always be programmed without security.

Please also supply:

  • What Operating System?
  • What is the hardware reported as ?  I can tell nothing from the link provided. (Both because of language and I can't find anything an the page that identifies which USDBM it is).
  • What firmware version in the BDM.

The last two are reported by the programmer. Screen grab the Interface page of the programmer.

bye

 

PS. I have spent some time refreshing my memory on the UF32 and how the programmer handles it.

The first error your received Unsupported operation or options for this chip was because you were trying to program the chip with security enabled.  Because of the chip errata this option is not supported as the chip may not be programmable again unless special steps are taken beforehand (see errata).  This is a check built into the programmer early on.

Unfortunately this check is absent from the mass erase button which was added later.  Mass erasing a UF32 renders it unusable.  Note that mass erasing is not unsecuring the device - it simply erase the entire device.  For a non-UF32 device this would leave the chip partially unsecured and able to be programmed.  I will correct this in the next version but this is of little comfort for you!

I will do some more testing if I can find a UF32.

 

0 Kudos
5,559 Views
crosswick
Contributor I

Hi pgo,

The mask version is indeed 1L47S, so it applies.  

The OS is Windows 7, 64-bit edition, Service Pack 1.

The USBDM hardware is reported as: USBDM-JS16-SWD-0001

BDM firmware is 4.12.1

screenshot of the Interface page:

usbdm screenshot.png

So... seen as Mass Erase did work one time for me, this chip is bricked? I have a third and last one to solder on... perhaps there's something I could try to see if it's revivable...

 

0 Kudos
5,556 Views
pgo
Senior Contributor V

Yes - the mass erase using the previous version of the software would have triggered the bug in the chip and bricked it.

I know of no way of recovering a bricked chip.

 

The current version uses a different strategy for Mass Erase Now:

https://sourceforge.net/projects/usbdm/files/Version%204.12.1/Software/ 

  • It refuses to mass erase a secured UF32 as it is impossible.
  • If unsecured, it mass erases and immediately reprograms the flash to unsecured before resetting the device.

I believe the programming works in both versions provided unsecure is selected as the security option. Other choices are rejected. However I have not tested the previous version.

I recommend EraseMass as the Programming Erase Mode.

The current version has been tested with a UF32.

bye

0 Kudos
5,555 Views
crosswick
Contributor I

Alright, I see. I will solder on the third lucky candidate and use unsecure & EraseMass while programming with the new USBDM version. Fingers securely crossed...

0 Kudos
5,553 Views
pgo
Senior Contributor V

Please use the current version as it has been recently tested with UF32.

0 Kudos
5,547 Views
crosswick
Contributor I

Yes, forgot to add that just now.

0 Kudos