Project

General

Profile

ProductionFlashingV13 » History » Version 3

tsaitgaist, 02/19/2016 10:49 PM
add picture and firmware

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