Programming MC9S12ZVL32 with USBDM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Programming MC9S12ZVL32 with USBDM

2,424 次查看
janbrázdil
Contributor I

Hello.

I'm working with MC9S12ZVL32 and trying programming with USBDM.

I have also Multilink and it works with it.

CW MCU v10.5 and i flashed HCS08/HCS12/CFV1 firmware into USBDM.

USBDM-JS16-0001

Software version 4.10

I checked s12z_devices.xml file and I think that my chip is not supported. I have same error message as Failed to resume target process. Downloading binary to target...

Console:

""

Starting 3rd party flash programming...

DiMemoryDownload() - DI_DNLD_TERMINATE - Programming memory image...

===========================================================

Programming target

  Device = '_DEFAULT'

  Trim, F=0, NVA@0000, clock@0000

  Ram[1000...17FF]

  Erase=EraseMass

  Security=unsecured

  Total bytes=110

  doRamWrites=T

Erase Time = 0.35 s, Speed = 0.35 kBytes/s, rc = 0

""

I can start flash programmer and erase device, or erase and program, but can't program it with Run -> Run, or Run -> Debug.

Any help, please?

Thank You :-).

0 项奖励
6 回复数

1,033 次查看
pgo
Senior Contributor V

Hi Jan,

No the device you mention is not supported by USBDM.  This is because of the usual reason - I don't have that chip to test with so it is hard to be confident that the programming algorithm will work.

Anyway, the MC9S12ZVL32 appears similar to the MC9S12ZVM family which is supported so I have made device entries based this device which I hope will work.

Please try replacing the s12z_devices.xml file with the one attached.  Please test this with Codewarrior and do NOT use the stand-alone programmer as the windows installer may restore the original file.


Please advise if it works and I will add the devices to the next version.


bye

1,033 次查看
janbrázdil
Contributor I

Hello.

Unfortunately it is not working :-(.

I'm creating project with MC9S12ZVL32 and USBDM connection (C, Double optimized, Large memory model, no Processor expert).

Then I'm flashing generated project into MCU with Run -> Run:

DiMemoryDownload() - DI_DNLD_TERMINATE - Programming complete, rc = 7

Starting 3rd party flash programming...

DiMemoryDownload() - DI_DNLD_TERMINATE - Programming memory image...

===========================================================

Programming target

  Device = 'MC9S12ZVL32'

  Trim, F=0, NVA@0000, clock@0000

  Ram[1000...13FF]

  Erase=EraseAll

  Security=intelligent

  Total bytes=110

  doRamWrites=T

And again...

Failed to resume target process.

Downloading binary to target...

I can use flash programmer "Erase and program" button:

fl::target -lc "LC for Simple Flash"

fl::target -b 0x1000 0x400

fl::target -v off -l off

cmdwin::fl::device -d "MC9S12ZVL32_FLASH" -o "32Kx32x1" -a 0xff8000 0xffffff

cmdwin::fl::device -d -append "MC9S12ZVL32_EEPROM" -o "128x32x1" -a 0x100000 0x10007f

cmdwin::fl::protect all off

Beginning Operation ...   

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

Performing target initialization ...   

Device MC9S12ZVL32_EEPROM   

Flash Operation.  

Unprotecting ....  

Unprotecting .............  

Unprotect Command Succeeded.  

Device MC9S12ZVL32_EEPROM   

cmdwin::fl::device -d "MC9S12ZVL32_FLASH" -o "32Kx32x1" -a 0xff8000 0xffffff

cmdwin::fl::image -f "D:\\CW Projects\\bosch_program\\FLASH\\bosch_program.sx" -t "Auto Detect" -re on -r 0xff8000 0xffffff -oe off

cmdwin::fl::erase image

Beginning Operation ...   

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

Auto-detection is successful.  

  File is of type Motorola S-Record Format.  

Device MC9S12ZVL32_FLASH   

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

Erase Command Succeeded.  

Device MC9S12ZVL32_FLASH   

cmdwin::fl::write

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

Flash Operation.  ...

Auto-detection is successful.  

  File is of type Motorola S-Record Format.  

Device MC9S12ZVL32_FLASH   

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

Device MC9S12ZVL32_FLASH   

Program Command Succeeded   

Flash Operation. done  

cmdwin::fl::device -d "MC9S12ZVL32_EEPROM" -o "128x32x1" -a 0x100000 0x10007f

cmdwin::fl::image -f "D:\\CW Projects\\bosch_program\\FLASH\\bosch_program.sx" -t "Auto Detect" -re on -r 0x100000 0x10007f -oe off

cmdwin::fl::erase image

Beginning Operation ...   

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

Auto-detection is successful.  

  File is of type Motorola S-Record Format.  

Image size is 0 bytes, nothing to erase.  

Nothing to erase.  No sectors selected

Erase Command Succeeded.  

cmdwin::fl::write

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

Flash Operation.  ...

Auto-detection is successful.  

  File is of type Motorola S-Record Format.  

Device MC9S12ZVL32_EEPROM   

Programming ....

Programming warning.  Can't program 8 bytes to address 0xfffea8 because this range isn't included in the selected modules!

Programming warning.  Can't program 8 bytes to address 0xffff08 because this range isn't included in the selected modules!

Programming warning.  Can't program 8 bytes to address 0xffff80 because this range isn't included in the selected modules!

Programming warning.  Can't program 8 bytes to address 0xffff98 because this range isn't included in the selected modules!

Programming warning.  Can't program 8 bytes to address 0xffffc8 because this range isn't included in the selected modules!

Programming warning.  Can't program 8 bytes to address 0xfffff8 because this range isn't included in the selected modules!

Device MC9S12ZVL32_EEPROM   

Program Command Succeeded   

Flash Operation. done  

Any ideas?

0 项奖励

1,033 次查看
pgo
Senior Contributor V

Hi Jan,

It's difficult to diagnose from a distance. The device is not generally available so I can't get one for testing/

If you want to do more testing please try the following:

  • Enable debugging in the USBDM launch configuration

pastedImage_1.png

  • (select edit...)

pastedImage_2.png

  • Enable the debugging options:

pastedImage_7.png

  • Try programming again.
  • Post the log files from the usbdm directory: %appdata%/usbdm

pastedImage_12.png

  • This might give some idea what is going wrong.

You could also test the stand-alone programmer - but if doing this please use the debug version:

  • C:\Program Files (x86)\pgo\USBDM 4.10.6.xxx\S12Z_FlashProgrammer-debug.exe
  • The corresponding log files would be:
    • FlashProgrammer_S12Z.log & usbdm.log (gets updated again)

bye

1,033 次查看
janbrázdil
Contributor I

Hi.

I got a new computer, so i do fresh install of CW and your software (s12z_devices.xml is already modified in your package).

Here You can download two files, which You want: http://megaupload.cz/T6YhE/debugger.rar.html (Just write captha and click "Stahnout").

I also check FlashProgrammer and:flshprogrammer.png

I hope this will help.

Thanks :-)

EDIT: Ok... If i modified CHIPID (Line 269 in s12z_devices.xml to "<sdid value="0x04150000" />"), i can once program my chip with FlashProgrammer. Second programming leads to [No matching device] with chip id FFFFFFF. I must program chip with PE Micro and after this i can again program chip with USBDM once...

EDIT2: Ok, i can program device if is unsecured. If is device secured, i must use Multilink to unsecure device, USBDM can't do it. Also, FreeMaster v1.4 is not working. I will try v1.3.

EDIT3: I have one more question... Can I use USBDM API in Microsoft Visual Studio 2010 C#? I would like to flash code and do some test from one application with simple GUI. Thanks for help pgo, really :-)

0 项奖励

1,033 次查看
pgo
Senior Contributor V

Hi Jan,

I have found  a few issues with secured devices not being correctly detected and hence not handled correctly.  This program only appeared due to recent changes.

There is another issue specific to the Z12 programmer which means that it can't program to a secured state using mass erase.  This is a problem since you can't program a secured device unless you use mass erase.  This means that to reprogram a secured device it is necessary to program it to a unsecured state using mass erase and then program again to a secured state using selective or block  erase.

Both of these issues will be addressed in the next release probably in the coming week.

Please re-test then and let me know if there are any remaining issues.

The USBDM API as implemented in usbdm.dll is a standard Windows DLL but I have minimal experience in using it with Visual studio.   Note that the API is a very low-level one and does not include programming.

bye

0 项奖励

1,033 次查看
janbrázdil
Contributor I

Ok, I will test fix when You put it on web...

Thanks :-)

EDIT: If I use FlashProgrammer from console... There are no returned informations from application? If programming fail, or bad target is set... Or info about succesfull programming? I'm calling S12Z_FlashProgrammer.exe from standard windows cmd.exe.

0 项奖励