Project

General

Profile

ProductionFlashingV13 » History » Version 1

laforge, 02/19/2016 10:48 PM

1 1 laforge
2
== Production Flashing v1.3 ==
3
4
Unfortunately, v1.3 has a bug in the design, which requires a specific PCB trace to be cut before it can be used.  The idea of that PCB trace was to
5
pull one formerly unised GPIO to GND, permitting software to detect it is running on a v1.3 harware (As opposed to v1.2 or earlier).
6
7
Instead, we need to store the hardware version in an OTP region of the SPI flash.
8
9
So After that trace has been cut, the following steps need to be performed:
10
11
1. put the rom loader into the flash, using the TEST jumper
12
1. use the sam7 utility to install the main_factory.samba file (containing sam7dfu and main_factory.bin)
13
{{{
14
$ sam7 -l /dev/ttyACM0 --exec set_clock --exec unlock_regions --exec "flash ./main_factory.samba"
15
Chip Version: 2
16
Embedded Processor: ARM7TDMI
17
NVRAM Region 1 Size: 128 K
18
NVRAM Region 2 Size: 0 K
19
SRAM Size: 32 K
20
Series: AT91SAM7Sxx
21
Page Size: 256 bytes
22
Lock Regions: 8
23
warning: magic read 0x00200000 != 0x13
24
warning: magic read 0x00200000 != 0x13
25
}}}
26
1. attach a serial cable to the board and press the reset button, generating the following output:
27
{{{
28
(C) 2006-2011 by Harald Welte <hwelte@hmw-consulting.de>
29
This software is FREE SOFTWARE licensed under GNU GPL
30
Version 0.5.7-6d5f-dirty compiled 20131117-202832 by laforge@radha.de.gnumonks.org
31
32
33
DEBUG Interface:
34
0) Set Pull-up 1) Clear Pull-up 2) Toggle LED1 3) Toggle LED2
35
9) Reset
36
RSTC_SR=0x00010000
37
                  Inititalizing usbcmd_gen_init
38
                                               udp_open(437): entering
39
spiflash_init
40
spi_transceive: enter(tx_len=4) leave(): 0x01 0x02 0x15 0x4d 
41
SPI ID: 01 02 15
42
}}}
43
1. entering the 'p' key to program the v1.3 into OTP
44
1. entering the 'P' key to verify / generate the following output:
45
{{{
46
spi_transceive: enter(tx_len=5) leave(): 0xce 0x5a 0x07 0x51 0x00 0x00 0x00 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x00 0x00 
47
OTP READ(0x114): ce 5a 07 51 00 00 00 00 00 03 01 00 00 00 00 00 
48
Version: 0x00010300
49
}}}
50
1. using dfu-util to overwrite main_factory with main_simtrace:
51
{{{
52
$ dfu-util -a 0 -D ./main_simtrace.bin -R
53
dfu-util 0.5
54
55
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
56
(C) 2010-2011 Tormod Volden (DfuSe support)
57
This program is Free Software and has ABSOLUTELY NO WARRANTY
58
59
dfu-util does currently only support DFU version 1.0
60
61
Opening DFU capable USB device... ID 16c0:0762
62
WARNING: Can not find cached DFU functional descriptor
63
Warning: Assuming DFU version 1.0
64
Run-time device DFU version 0100
65
Claiming USB DFU Runtime Interface...
66
Determining device status: state = appIDLE, status = 0
67
Device really in Runtime Mode, send DFU detach request...
68
Resetting USB...
69
Opening DFU USB Device...
70
Found DFU: [16c0:0762] devnum=0, cfg=1, intf=0, alt=0, name="SimTrace DFU Interface - Application Partition"
71
Claiming USB DFU Interface...
72
Setting Alternate Setting #0 ...
73
Determining device status: state = dfuIDLE, status = 0
74
dfuIDLE, continuing
75
DFU mode device DFU version 0100
76
Device returned transfer size 256
77
No valid DFU suffix signature
78
Warning: File has no DFU suffix
79
bytes_per_hash=415
80
Copying data from PC to DFU device
81
Starting download: [##################################################] finished!
82
state(7) = dfuMANIFEST, status(0) = No error condition is present
83
state(2) = dfuIDLE, status(0) = No error condition is present
84
Done!
85
can't detach
86
Resetting USB to switch back to runtime mode
87
}}}
88
1. observing the serial output of the regular firmware starting:
89
{{{
90
sam7dfu: switching to APP mode�
91
(C) 2006-2011 by Harald Welte <hwelte@hmw-consulting.de>
92
This software is FREE SOFTWARE licensed under GNU GPL
93
Version 0.5.6-bb28 compiled 20131117-201527 by laforge@radha.de.gnumonks.org
94
95
96
DEBUG Interface:
97
0) Set Pull-up 1) Clear Pull-up 2) Toggle LED1 3) Toggle LED2
98
9) Reset
99
RSTC_SR=0x00010300
100
                  Inititalizing usbcmd_gen_init
101
                                               udp_open(437): entering
102
USART Initializing
103
pio_irq_register(109): registering handler 00107538 for PIOA 7
104
RST
105
computed Fi(1) Di(1) ratio: 372
106
ISO_SW Initializing
107
pio_irq_register(109): registering handler 001079cc for PIOA 8
108
pio_irq_register(109): registering handler 001078c0 for PIOA 25
109
VCC_PHONE off
110
USART Entering Rx Mode
111
RST
112
computed Fi(1) Di(1) ratio: 372
113
MODE: SNIFFER
114
115
RST
116
computed Fi(1) Di(1) ratio: 372
117
main(76): entering main (idle) loop
118
}}}
Add picture from clipboard (Maximum size: 48.8 MB)