; --------------------------------------------------------------------------------
; @Title: Script to load a QNX flash image into the
; @Description: 
;   Flash of a 8260ADS board
;   NOTE: this may take up to 1.5 hours!
; @Keywords: 8260ads, qnx
; @Author: DIE
; @Board: 8260ADS
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: flash.cmm 6750 2014-04-07 21:27:07Z servera $


; init ICD
 SYStem.Down
 SYStem.Up
 
; set (processor's and debugger's) IMMR to 0x0f010000
 LOCAL &base
 &base=IOBASE()
 Data.Set &base|0x101a8 %Long 0x0f010000
 SYStem.Option BASE 0x0f010000
 &base=0x0f010000

; set OR0 and BR0 to access the flash at 0xfe000000
 ; or0
 Data.Set &base|10104 %Long 0fe000836
 ; br0
 Data.Set &base|10100 %Long 0fe001801

; declare flash layout to debugger
 FLASH.RESet
 FLASH.Create 1. 0xfe000000++0x7fffff 0x40000 I28F001B Long
 
; erase the whole flash
 FLASH.Erase ALL

; load image and program it into flash
 FLASH.Program ALL
 Data.LOAD.Binary flash_img D:0xfe000000 /Long
 FLASH.Program OFF
 
; verify flash content
 Data.LOAD.Binary flash_img D:0xfe000000 /ComPare

 
