examples/gene_SYNC_HCS12/trace32_flash_programmer.cmm
author etisserant
Fri, 21 Sep 2007 08:04:00 +0200
changeset 278 9d41c53dadac
parent 0 4472ee7c6c3e
permissions -rw-r--r--
Typo in configure
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
; Programmation de la mémoire flash
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
; Réinitialisation
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
SYS.d
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
; Effacer l'écran
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
WinCLEAR
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
; Vitesse de transmission : 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
SYStem.BdmClock 8.0MHZ
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
; Choix du microcontrôleur cible
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
SYStem.CPU MCS12DP256
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
; Flash page 0X3E accessible entre 0X4000 et 0X7FFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
; cf Motorola, registre MISC
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
system.option ROMHM ON
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
; Enlever tous les points d'arrêt
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
b.res
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
; Utiliser les points d'arrêts onchip
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
map.bonchip
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
; Connexion à la carte CS12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
system.up
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
flash.reset
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
; Effacement de la flash
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
PRINT "Effacement de la flash"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
FLASH.Erase all
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
; Passage en mode programmation de la flash
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
print "Programmation de la flash non paginée (48KO) 1 "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
FLASH.Program 0x4000--0x7FFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
;print "Chargement du programme en flash 1"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
DATA.LOAD.ELF geneSYNC.elf 0x4000--0x7FFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
FLASH.Program off
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
print "Flash programmée 1"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
; Passage en mode programmation de la flash
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
print "Programmation de la flash non paginée (48KO) 2"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
FLASH.Program 0x308000--0x30BFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
;print "Chargement du programme en flash 2"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
DATA.LOAD.ELF geneSYNC.elf 0x8000--0xBFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
FLASH.Program off
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
print "Flash programmée 2"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
; Passage en mode programmation de la flash
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
print "Programmation de la flash non paginée (48KO) 3"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
FLASH.Program 0xC000--0xFFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
;print "Chargement du programme en flash 3"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
DATA.LOAD.ELF geneSYNC.elf 0xC000--0xFFFF
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
FLASH.Program off
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
print "Flash programmée 3"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
;Reset du HCS12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
system.up
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
;Reset de trace32
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
SYS.d
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
ENDDO
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94