-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnotes.txt
338 lines (239 loc) · 10.4 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
Project layout
--------------
..
└── git
├── libopencm3
└── SensoricNet-particle-meter
CPU used
--------
ARM STM32F072
GNU Arm Embedded Toolchain:
---------------------------
The GNU Arm Embedded toolchains are integrated and validated packages featuring the Arm Embedded GCC compiler,
libraries and other GNU tools necessary for bare-metal software development on devices based on the
Arm Cortex-M and Cortex-R processors.
* https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
Semihosting
-----------
Semihosting is a neat way to redirect STDOUT and STDIN from an embedded system to a debug window on a PC.
This allows you to output messages using printf functions without having to use/configure an RS232 or
USB Virtual COM Port, and can also read input from the PC's keyboard via scanf functions.
* http://www.keil.com/support/man/docs/armcc/armcc_pge1358787046598.htm
* http://bgamari.github.io/posts/2014-10-31-semihosting.html
* https://github.com/libopencm3/libopencm3-examples/tree/master/examples/stm32/l1/stm32l-discovery/usart-semihosting
* https://github.com/rowol/stm32_discovery_arm_gcc/tree/master/semihosting
* http://www.wolinlabs.com/blog/stm32f4.semihosting.html
* http://www.openstm32.org/forumthread164#threadId798
vypadá to, že to funguje. Po přeložení a flashnutí je pořeba znovu spustit openocd
openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f0x.cfg
a připojit se na port 4444
telnet localhost 4444
a tam zadat
arm semihosting enable
reset
určitě to půjde zautomatizovat v Makefile
POZOR! pokud se překládá s podporou semihosting (je to default), tak musí být připojený ST-LINK,
jinak ta binárka nepoběží!!! Překlad bez semihostingu je potřeba explicitně provést pomocí
make ENABLE_SEMIHOSTING=0 flash
Alternativa je retargeting (imho presmerovani USART2 do debug konzole)
* https://github.com/ChuckM/nucleo-retarget-example
GDB (GNU debuger)
-----------------
* https://mcuoneclipse.com/2015/03/25/command-line-programming-and-debugging-with-gdb/
* http://pandafruits.com/stm32_primer/stm32_primer_minimal.php
Hromadný deploying
------------------
Je potřeba si lokálně udržovat aktuální csv soubor s čidly (vzor je sensoricnet_lora_ids_example.csv).
Pak se kompilace provádí pomocí
cd ~/git/SensoricNet-particle-meter/firmware/snpm/
./make_lora.sh <your_sensor_dev_id>
////////////////////////////////
ukoly
Vyresit ID jednotlivych senzoru, tzn mozna HWID? Mozna funkci na zapis ID?
Benchmark gps?
Posilat vic zajimavych dat z quectelu. Posilat jako string, nevymyslet picoviny, easy to poslat.
Preruseni na usart, vyzkouset ale si neni jak? Jo je, ale jen pri up-linku.
//SPI connections:
GND
SCK
MOSI/SDI
MISO/SDO
SS
5V
GPS modul
---------
Sample input from module, USART2, baudrate 9600
$GPRMC,002911.261,V,,,,,0.00,0.00,060180,,,N*4C
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,002912.261,,,,,0,0,,,M,,M,,*45
$GPGLL,,,,,002912.261,V,N*77
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
Popis:
$GPRMC
Recommended minimum specific GPS/Transit data
eg1. $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62
eg2. $GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68
225446 Time of fix 22:54:46 UTC
A Navigation receiver warning A = OK, V = warning
4916.45,N Latitude 49 deg. 16.45 min North
12311.12,W Longitude 123 deg. 11.12 min West
000.5 Speed over ground, Knots
054.7 Course Made Good, True
191194 Date of fix 19 November 1994
020.3,E Magnetic variation 20.3 deg East
*68 mandatory checksum
eg3. $GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
1 2 3 4 5 6 7 8 9 10 11 12
1 220516 Time Stamp
2 A validity - A-ok, V-invalid
3 5133.82 current Latitude
4 N North/South
5 00042.24 current Longitude
6 W East/West
7 173.8 Speed in knots
8 231.8 True course
9 130694 Date Stamp
10 004.2 Variation
11 W East/West
12 *70 checksum
eg4. $GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh
1 = UTC of position fix
2 = Data status (V=navigation receiver warning)
3 = Latitude of fix
4 = N or S
5 = Longitude of fix
6 = E or W
7 = Speed over ground in knots
8 = Track made good in degrees True
9 = UT date
10 = Magnetic variation degrees (Easterly var. subtracts from true course)
11 = E or W
12 = Checksum
$GPVTG
Track Made Good and Ground Speed.
eg1. $GPVTG,360.0,T,348.7,M,000.0,N,000.0,K*43
eg2. $GPVTG,054.7,T,034.4,M,005.5,N,010.2,K
054.7,T True track made good
034.4,M Magnetic track made good
005.5,N Ground speed, knots
010.2,K Ground speed, Kilometers per hour
eg3. $GPVTG,t,T,,,s.ss,N,s.ss,K*hh
1 = Track made good
2 = Fixed text 'T' indicates that track made good is relative to true north
3 = not used
4 = not used
5 = Speed over ground in knots
6 = Fixed text 'N' indicates that speed over ground in in knots
7 = Speed over ground in kilometers/hour
8 = Fixed text 'K' indicates that speed over ground is in kilometers/hour
9 = Checksum
The actual track made good and speed relative to the ground.
$--VTG,x.x,T,x.x,M,x.x,N,x.x,K
x.x,T = Track, degrees True
x.x,M = Track, degrees Magnetic
x.x,N = Speed, knots
x.x,K = Speed, Km/hr
$GPGGA
Global Positioning System Fix Data
Name Example Data Description
Sentence Identifier $GPGGA Global Positioning System Fix Data
Time 170834 17:08:34 Z
Latitude 4124.8963, N 41d 24.8963' N or 41d 24' 54" N
Longitude 08151.6838, W 81d 51.6838' W or 81d 51' 41" W
Fix Quality:
- 0 = Invalid
- 1 = GPS fix
- 2 = DGPS fix 1 Data is from a GPS fix
Number of Satellites 05 5 Satellites are in view
Horizontal Dilution of Precision (HDOP) 1.5 Relative accuracy of horizontal position
Altitude 280.2, M 280.2 meters above mean sea level
Height of geoid above WGS84 ellipsoid -34.0, M -34.0 meters
Time since last DGPS update blank No last update
DGPS reference station id blank No station id
Checksum *75 Used by program to check for transmission errors
Global Positioning System Fix Data. Time, position and fix related data for a GPS receiver.
eg2. $--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx
hhmmss.ss = UTC of position
llll.ll = latitude of position
a = N or S
yyyyy.yy = Longitude of position
a = E or W
x = GPS Quality indicator (0=no fix, 1=GPS fix, 2=Dif. GPS fix)
xx = number of satellites in use
x.x = horizontal dilution of precision
x.x = Antenna altitude above mean-sea-level
M = units of antenna altitude, meters
x.x = Geoidal separation
M = units of geoidal separation, meters
x.x = Age of Differential GPS data (seconds)
xxxx = Differential reference station ID
eg3. $GPGGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh
1 = UTC of Position
2 = Latitude
3 = N or S
4 = Longitude
5 = E or W
6 = GPS quality indicator (0=invalid; 1=GPS fix; 2=Diff. GPS fix)
7 = Number of satellites in use [not those in view]
8 = Horizontal dilution of position
9 = Antenna altitude above/below mean sea level (geoid)
10 = Meters (Antenna height unit)
11 = Geoidal separation (Diff. between WGS-84 earth ellipsoid and
mean sea level. -=geoid is below WGS-84 ellipsoid)
12 = Meters (Units of geoidal separation)
13 = Age in seconds since last update from diff. reference station
14 = Diff. reference station ID#
15 = Checksum
$GPGLL
Geographic Position, Latitude / Longitude and time.
eg1. $GPGLL,3751.65,S,14507.36,E*77
eg2. $GPGLL,4916.45,N,12311.12,W,225444,A
4916.46,N Latitude 49 deg. 16.45 min. North
12311.12,W Longitude 123 deg. 11.12 min. West
225444 Fix taken at 22:54:44 UTC
A Data valid
eg3. $GPGLL,5133.81,N,00042.25,W*75
1 2 3 4 5
1 5133.81 Current latitude
2 N North/South
3 00042.25 Current longitude
4 W East/West
5 *75 checksum
$--GLL,lll.ll,a,yyyyy.yy,a,hhmmss.ss,A llll.ll = Latitude of position
a = N or S
yyyyy.yy = Longitude of position
a = E or W
hhmmss.ss = UTC of position
A = status: A = valid data
$GPGSA
GPS DOP and active satellites
eg1. $GPGSA,A,3,,,,,,16,18,,22,24,,,3.6,2.1,2.2*3C
eg2. $GPGSA,A,3,19,28,14,18,27,22,31,39,,,,,1.7,1.0,1.3*35
1 = Mode:
M=Manual, forced to operate in 2D or 3D
A=Automatic, 3D/2D
2 = Mode:
1=Fix not available
2=2D
3=3D
3-14 = IDs of SVs used in position fix (null for unused fields)
15 = PDOP
16 = HDOP
17 = VDOP
$GPGSV
GPS Satellites in view
eg. $GPGSV,3,1,11,03,03,111,00,04,15,270,00,06,01,010,00,13,06,292,00*74
$GPGSV,3,2,11,14,25,170,00,16,57,208,39,18,67,296,40,19,40,246,00*74
$GPGSV,3,3,11,22,42,067,42,24,14,311,43,27,05,244,00,,,,*4D
$GPGSV,1,1,13,02,02,213,,03,-3,000,,11,00,121,,14,13,172,05*67
1 = Total number of messages of this type in this cycle
2 = Message number
3 = Total number of SVs in view
4 = SV PRN number
5 = Elevation in degrees, 90 maximum
6 = Azimuth, degrees from true north, 000 to 359
7 = SNR, 00-99 dB (null when not tracking)
8-11 = Information about second SV, same as field 4-7
12-15= Information about third SV, same as field 4-7
16-19= Information about fourth SV, same as field 4-7