|
1 // |
|
2 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 ////////////////////////////////////////////////////////////////////////////// |
|
17 // |
|
18 // NaviEngine NOR flash erasing script. |
|
19 // |
|
20 // Change History: |
|
21 // |
|
22 // 11/11/2008 1.0 : Initial version |
|
23 // 08/05/2009 1.1 : Tidied up in readiness for putting into Nokia's distribution system |
|
24 // |
|
25 ////////////////////////////////////////////////////////////////////////////// |
|
26 |
|
27 &scriptversion=1.1 |
|
28 |
|
29 print "=======================================================================" |
|
30 print "&Platform NOR flash erasing script &scriptversion" |
|
31 |
|
32 ; Stop all CPU cores on the board to prevent them interfering with the flashing |
|
33 do &PlatformsDir\&Platform\stopcpus.cmm |
|
34 |
|
35 ; Reset the Lauterbach flash configuration |
|
36 flash.reset |
|
37 |
|
38 ; Configure the flash to either use a helper executable on the machine (faster) or |
|
39 ; to use the Lauterbach (slower) to perform the writing |
|
40 if "&FlashOptionTarget"=="yes" |
|
41 ( |
|
42 ; Target controlled flashing requires a binary downloaded to the development board |
|
43 print "Using target assisted flashing" |
|
44 flash.create 1. &FlashStart--&FlashEnd &FlashBlockSize TARGET Word |
|
45 |
|
46 ; Determine where to store the target binary (and how big it is) |
|
47 flash.target &RamAddr &RamAddr+0x1000 0x1000 ../demo/arm/flash/&FlashWidth/&FlashType.bin |
|
48 ) |
|
49 else |
|
50 ( |
|
51 ; Emulator controlled flashing is controlled from the host and is a lot slower |
|
52 print "Using basic emulator flashing (slow)" |
|
53 flash.create 1. &FlashStart--&FlashEnd &FlashBlockSize &FlashType &FlashWidth |
|
54 ) |
|
55 |
|
56 print "Flash Configuration:" |
|
57 print "---------------------------------" |
|
58 print "Flash Start: &FlashStart" |
|
59 print "Flash Length: &FlashLength" |
|
60 print "Flash End: &FlashEnd" |
|
61 print "Flash Type: &FlashType" |
|
62 print "Flash Block Size: &FlashBlockSize" |
|
63 print "Flash Width: &FlashWidth" |
|
64 print "---------------------------------" |
|
65 |
|
66 flash.unlock &FlashStart++&FlashLength |
|
67 flash.erase &FlashStart++&FlashLength |
|
68 |
|
69 ; Programming done, relock the flash |
|
70 flash.program off |
|
71 flash.lock 1. |
|
72 |
|
73 ; On an error the script will abort before printing OK (and print the error) |
|
74 print "Flash programming completed OK" |
|
75 |
|
76 ; Disconnect the JTAG as the user is likely to power cycle the board and it might confuse us |
|
77 sys.down |
|
78 |
|
79 enddo |