0

I'm trying to write a PRACTICE script for loading the MCU MC9S12ZVML128 with pre-built (.elf format) application and start it for debugging. My general approach is based on the demo file, located in the: C:\T32\demo\m68hc12\flash\flash.cmm

I'm using BDM.

My script, basically goes something like this:

; select the ICD device prompt
B::
; clear all windows
WinCLEAR

// prepare target system
SYStem.RESet
SYStem.BdmClock AUTO

; select CPU
SYStem.CPU MCS12ZVML128
; bring out of reset
SYStem.Up

FLASH.Program ALL

// load application
Data.LOAD.Elf "~~~~/../../some_app_name.elf" ;/Verify

FLASH.Program off
PRINT "flash programming ready"

Register.RESet 

; start program execution
Go main

; open some windows
;WinCLEAR
Mode.Hll
WinPOS 0. 0. 110. 24.
List.auto

WinPOS 115. 0. 90. 8.
Frame.view /Locals /Caller

WinPOS 115. 15. 90. 25.
Var.Watch %SpotLight

WinPOS 0. 30.
per.view.~~/pers12zvm.per /SpotLight /DualPort

ENDDO

The script's execution fails during the load with "data alignment error". The elf is compiled with Free Scale's "s12lisa" compiler.

I guess my script lacks a proper memory configuration - some address mapping like this:

;Move the internal registers to 0x0800 by writing the INITRG register
Data.Set 0x11 0x08

So my questions are:

How to figure out the proper memory configuration? Have anybody seen more comprehensive demo PRACTICE script, conserning S12ZVML MCUs? Is my overall approach reasonable ... ?

Thank you.

Muncho
  • 1
  • 3
  • Have you tried to replace the dumb `FLASH.Program ALL` with the smarter `FLASH.ReProgram ALL` or `FLASH.AUTO ALL` ? – Holger Aug 07 '17 at 16:37
  • Thank you for the advice . Actually it worked. I changed the code as follows: removed SYStem.BdmClock AUTO changed `FLASH.Program ALL` to `FLASH.ReProgram ALL` changed `FLASH.Program OFF` to `FLASH.ReProgram OFF` Thanks once again! – Muncho Aug 08 '17 at 05:36

0 Answers0