Show last authors
1 **Table of** **Contents:**
2
3 {{toc/}}
4
5
6
7
8 = 1. Introduction =
9
10
11 This instruction shows how to upgrade firmware for Dragino products base on STM32 solution. The upgrade can use 2 hardware connections: (% style="color:blue" %)**UART upgrade**(%%) or (% style="color:blue" %)**ST Link v2 upgrade**(%%). Some models supports both methods and some only one of them.
12
13
14 = 2. Hardware Upgrade Method Support List =
15
16
17 (% border="1" style="background-color:#f2f2f2; width:891.222px" %)
18 |=(% colspan="3" style="width: 888px;background-color:#D9E2F3;color:#0070C0" %)Dragino STM32 base hardware Upgrade Methods
19 |(% style="color:#0070c0; width:284px" %)**Model**|(% style="color:#0070c0; width:409px" %)**UART Connection**|(% style="color:#0070c0; width:204px" %)**ST-Link Connection**
20 |(% style="width:284px" %)[[LSN50 v1>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/128-lsn50.html]], [[LoRa ST>>url:http://www.dragino.com/products/lora/item/127-lora-st.html]],|(% style="width:409px" %)Hardware Connect Photo|(% style="width:204px" %)Hardware Connect Photo
21 |(% style="width:284px" %)[[LGT92>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/142-lgt-92.html]], [[LBT1>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/165-lbt1.html]]|(% style="width:409px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>||anchor="H4.1.2LGT922FLBT1ST-Linkv2Connection"]]
22 |(% style="width:284px" %)[[LT-33222-L>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/138-lt-33222-l.html]], [[LT-22222>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/156-lt-22222-l.html]]|(% style="width:409px" %)Hardware Connect Photo|(% style="width:204px" %)×
23 |(% style="width:284px" %)[[LHT65>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/151-lht65.html]]|(% style="width:409px" %)×|(% style="width:204px" %)Hardware Connect Photo
24 |(% style="width:284px" %)[[RS485-LN>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/154-rs485-ln.html]]|(% style="width:409px" %)Hardware Connect Photo|(% style="width:204px" %)×
25 |(% style="width:284px" %)[[LSN50v2>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/155-lsn50-v2.html]], [[NBSN95>>url:http://www.dragino.com/products/nb-iot/item/163-nbsn95.html]],[[LSE01>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/159-lse01.html]],[[LDDS20>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/164-ldds20.html]], [[LDS03A>>https://www.dragino.com/products/lorawan-nb-iot-door-sensor-water-leak/item/196-lds03a.html]],[[LDDS75>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/161-ldds75.html]]|(% style="width:409px" %)[[Hardware Connect Photo>>||anchor="H3.1.2LSN50v22FLSN50v2-D222FLSN50v2-D23"]]|(% style="width:204px" %)[[Hardware Connect Photo>>||anchor="H4.1.1LSN50v22FLSN50v2-D222FLSN50v2-D23Type"]]
26 |(% style="width:284px" %)[[LAQ4>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/174-laq4.html]]|(% style="width:409px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>||anchor="H4.1.3LAQ4ST-Linkv2Connection"]]
27 |(% style="width:284px" %)(((
28 [[RS485-BL>>url:https://www.dragino.com/products/lora-lorawan-end-node/item/167-rs485-bl.html]],
29
30 [[LDDS75>>https://www.dragino.com/products/distance-level-sensor/item/161-ldds75.html]],[[LLDS12>>url:https://www.dragino.com/products/distance-level-sensor/item/185-llds12.html]],[[LDDS20>>https://www.dragino.com/products/distance-level-sensor/item/164-ldds20.html]],[[LSE01>>https://www.dragino.com/products/agriculture-weather-station/item/159-lse01.html]],
31
32 [[WSC1-L>>https://www.dragino.com/products/agriculture-weather-station/item/206-wsc1-l.html]],[[GroPoint Air>>https://www.dragino.com/products/agriculture-weather-station/item/227-gropoint-air.html]]
33 )))|(% style="width:409px" %)[[Hardware Connection Photo>>||anchor="H3.1.3RS485-BL2FLDDS752FLDDS202FLSE01"]]|(% style="width:204px" %)[[Hardware Connect Photo>>||anchor="H4.1.4RS485-BL2FLDDS752FLDDS202FLSE01"]]
34 |(% style="width:284px" %)[[LTC2>>url:https://www.dragino.com/products/temperature-humidity-sensor/item/170-ltc2.html]]|(% style="width:409px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>||anchor="H4.1.5LTC2"]]
35
36
37
38 = 3. UART Upgrade Guide =
39
40 == 3.1 Hardware Connection ==
41
42 === 3.1.1 LSN50 v1 ===
43
44
45 [[image:image-20220526173641-1.png]]
46
47 Connection for LSN50 v1
48
49
50 === 3.1.2 LSN50 v2/LSN50v2-D22/LSN50v2-D23 ===
51
52
53 [[image:image-20220526173751-3.png||height="467" width="966"]]
54
55 Connection for LSN50 Type V2
56
57
58 === 3.1.3 RS485-BL/LDDS75/LDDS20/LSE01 ===
59
60
61 [[image:image-20220526174856-17.png||height="629" width="976"]]
62
63 Connection for RS485-BL base mother board
64
65
66 (% style="color:#4472c4" %) **For UART Update, need:**
67
68 * **Connect USB-TTL TXD  <~-~-> Device UART_RX**
69
70 * **Connect USB-TTL RXD  <~-~-> Device UART_TX**
71
72 * **Connect USB-TTL GND <~-~-> Device GND**
73
74 * **Put Switch SW1 to ISP position**
75
76 * **Connect JP2 jumper (Yellow one), so device is power on.**
77
78
79
80 == 3.2 Upgrade Steps ==
81
82
83 (((
84 (% style="color:blue" %)**Step 1:**(%%) Download [[Flash Loader>>url:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html]].
85 )))
86
87 (((
88 (% style="color:blue" %)**Step 2:**(%%) Download the Image files, which can be found in the product user manual.
89 )))
90
91 (((
92 (% style="color:blue" %)**Step 3:**(%%) Open Flashloader; choose the correct COM port to update, Please notice that the serial setting must follow below photos.
93 )))
94
95 (((
96 (% style="color:blue" %)**Step 4: **(%%)Set The device into (% style="color:#037691" %)**ISP Mode**(%%). Then Press the (% style="color:#037691" %)**Reset Button**(%%), In the Flash tool, click next and the tool will detect the board type.
97
98
99 (% style="color:red" %)**Note:** ** ISP Mode can be a switch or a button, depends on the product. The device only need to be in ISP mode when press the reset button for UART Upgrade. So if the device is of a button type ISP mode, user can release the ISP button after press the reset button.**
100
101
102 )))
103
104 [[image:image-20220526174302-11.png]]
105
106 UART Upgrade
107
108
109 [[image:image-20220526174231-10.png]]
110
111 UART Upgrade
112
113
114 [[image:image-20220526174202-9.png]]
115
116 (((
117 UART Upgrade
118
119
120 )))
121
122 (((
123 (% style="color:blue" %)**Step 5:**(%%) For switch type ISP Mode, After upgrade,please remember to switch back to Flash mode and press RESET Button to run the firmware.
124 )))
125
126 (((
127 (% style="color:blue" %)**Step 6:**(%%) Always run AT+FDR after update firmware. This is to reset the device to factory settings of the new firmware.
128 )))
129
130
131 == 3.3 Trouble shooting ==
132
133 === 3.3.1 General Check List ===
134
135
136 ~1. Double check if follow up exactly the steps as manual.
137
138 2. Check if hardware works fine:
139
140 * check if AT command works, in both TX/RX
141 * check if the device are in upgrade mode, see product manual for upgrade mode indicator.
142 * check if reset button works
143
144 3. If you use Windows10 system. Please change the flash loader to run in Windows7 compatibility mode.
145
146 4. We see a case the FT232 USB TTL adapter has reliability issue with the PC USB chipset(Intel). In this case, even above, it still has serious reliability issue for uploading. If this happen, change a PC or change a USB to TTL adapter will solve.
147
148
149 == 3.4 Flash Loader ~-~- Unable to Load data from this file ==
150
151
152 [[image:image-20220526174137-8.png]]
153
154 (((
155 Unable to Load data from this file
156
157
158 )))
159
160 (((
161 The previous LSN50 firmware file is stored in github. If user use right click ~-~-> Save As to get the hex file. This error will happen. Now the LSN50 firmware file has been moved to [[LSN50 Firmware>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/Firmware/]] to avoid this happen.
162 )))
163
164
165 == 3.5 Alternative method to flash via UART ==
166
167
168 [[Alternative method to flash STM32 via UART.pdf>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/Utility/&file=Alternative%20method%20to%20flash%20STM32%20via%20UART.pdf]]
169
170
171 = 4. ST-Link v2 Upgrade =
172
173 == 4.1 Hardware Connections ==
174
175 === 4.1.1 LSN50 v2/LSN50v2-D22/LSN50v2-D23 Type ===
176
177
178 [[image:image-20220526174450-12.png||height="570" width="1162"]]
179
180 ST-Link Connections for LSn50 V2/LSN50v2-D22/LSN50v2-D23 Type
181
182
183 === 4.1.2 LGT92/LBT1 ST-Link v2 Connection ===
184
185
186 [[image:image-20220526174518-13.png]]
187
188
189 **Connection to (% style="color:blue" %)LGT92(%%)**
190
191 * **ST-LINK v2 5.0v  <~-~->  Dupont Cable red pin**
192
193 * **ST-LINK v2 GND  <~-~->  Dupont Cable black pin**
194
195 * **ST-LINK v2 SWCLK  <~-~->  Dupont Cable green pin**
196
197 * **ST-LINK v2 SWDIO  <~-~->  Dupont Cable white pin**
198
199
200
201 === 4.1.3 LAQ4 ST-Link v2 Connection ===
202
203
204 [[image:image-20220526174602-14.png||height="506" width="922"]]
205
206 Connection to LAQ4
207
208
209 === 4.1.4 RS485-BL/LDDS75/LDDS20/LSE01 ===
210
211
212 [[image:image-20230306115123-4.png]]
213
214 Connection for RS485-BL base mother board
215
216
217 **When use (% style="color:blue" %)ST-Link v2(%%) to update, need:**
218
219 * **ST-LINK v2 RESET  <~-~->  NRST**
220
221 * **ST-LINK v2 GND  <~-~->  GND**
222
223 * **ST-LINK v2 SWCLK  <~-~->  SWCLK**
224
225 * **ST-LINK v2 SWDIO  <~-~->  SWDIO**
226
227 * **ST-LINK (VDD 3.3v,pin19)  <~-~->  ST-LINK (TVCC ,pin1) a wire to connect two pins of ST-Link together.**
228
229
230
231 === 4.1.5 LTC2 ===
232
233
234 [[image:image-20230306112740-2.png]]
235
236 Connection for LTC2 base mother board
237
238
239 **Connection:**
240
241 * **ST-LINK v2 GND  <~-~->  LTC2 GND**
242
243 * **ST-LINK v2 RESET  <~-~->  LTC2 NRST**
244
245 * **ST-LINK v2 SWCLK  <~-~->  LTC2 SWCLK**
246
247 * **ST-LINK v2 SWDIO  <~-~->  LTC2 SWDIO**
248
249 * **ST-LINK (VDD 3.3v,pin19)  <~-~->  ST-LINK (TVCC ,pin1) a wire to connect two pins of ST-Link together.**
250
251
252
253 = 4.2. Firmware upgrade using STM32 Cubeprogramer =
254
255
256 (% style="color:blue" %)**Step1:**(%%) Enter the download interface
257
258 [[image:image-20230222160658-1.png||height="479" width="827"]]
259
260
261 (% style="color:blue" %)**Step2:**(%%) Connect serial port correctly and select UART/ST-LINK
262
263 [[image:image-20230222160847-2.png||height="481" width="830"]]
264
265
266 (% style="color:blue" %)**Step3: **(%%)Select the file to download
267
268 [[image:image-20230222160947-3.png||height="473" width="818"]]
269
270
271 (% style="color:blue" %)**Step4: **(%%)Click to start programming, and wait for it to download to 100%, pop up a successful download box
272
273 [[image:image-20230222161119-4.png||height="476" width="821"]]
274
275
276 == 4.3 Trouble Shootings ==
277
278 === 4.3.1 ST-Link v2 can not detect the hardware ===
279
280
281 (% style="color:#4f81bd" %)**Possible Issue 1:**
282
283 1. Make sure see the LED blink on the ST-Link and release the reset button during blinking.
284
285 (% style="color:#4f81bd" %)**Possible Issue 2:**
286
287 1. There are different version ST-Link v2. The white one as below is the most stable and recommended one.
288
289 1. The white version ST-Link v2 such as below photo has different hardware version. The original one doesn't have 3.3v on pin 1/2 and the clone one has 3.3v on pin 1/2. User has to short pin19 (VDD 3.3v) and pin 1/2 (TVCC) for the original one so pin 1/2 has 3.3v power. Otherwise, the original one might have problem to upload firmware to End Node.
290
291 [[image:image-20220526175418-21.png]]
292
293 ST-Link upload issue
294
295
296 (% style="color:#4f81bd" %)**Possible Issue 3:**
297
298 1. The ST-Link adapter has issue in the RESET pin. this happens for the LHT65 model where the update request use the reset pin of ST-Link.We see this issue happen in below ST-LINK.
299
300 [[image:image-20220526175708-22.png]]
301
302 (((
303 RESET pin not function
304 )))
305
306
307 (((
308 User can try to mannual reset when use this type of ST-Link, touch the reset pin to GND pin and click the global icon in the ST Utility, If the other 3 wire connection is fine, the ST-LInk adapter LED will blink. and then release the reset. The IC should be detected.
309 )))
310
311 (((
312 For LHT65 we recommend to use the white one show in possible issue 2.
313 )))
314
315 (((
316 For LGT92, if user use this type of ST-Link, please also connect the 5v to USB port of LGT92.
317 )))
318
319
320 === 4.3.2 ST-Link v2 detect the hardware but disconnect after click OK ===
321
322
323 [[image:image-20230329155923-2.png]]
324
325 Do not click OK, click Cancel
326
327
328 === 4.3.3 Old ST-LINK firmware/ST-LINK already use and USB communication error ===
329
330
331 (((
332 It may be that your stlink firmware is too old.
333 )))
334
335 (((
336 You can try these steps:
337 )))
338
339 (((
340 You unplug the stlink, and then plug in the stlink again.
341 )))
342
343 (((
344 You click **ST-LINK  ->  Firmware update.**
345 )))
346
347 [[image:image-20220526175855-24.png]]
348
349 (% style="color:blue" %)**step1: **(%%) click Device connect.
350
351
352
353 [[image:image-20220526175954-25.png]]
354
355 [[image:image-20220526180013-26.png]]
356
357 (% style="color:blue" %)**step2: **(%%) Click yes to upgrade successfully.
358
359
360 == 5. Other Method ==
361
362
363 ST-Link v2 Upgrade Guide
364
365
366 (((
367 (% style="color:blue" %)**Step 1:**(%%) Install [[ST-LINK driver>>url:https://www.stmicroelectronics.com.cn/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-utilities/stsw-link009.html]] first and then install [[ST-LINK Utility>>url:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html]]
368 )))
369
370 (((
371 (% style="color:blue" %)**Step 2: **(%%)Download the Image files, firmware download link can be found on the product user manual.
372 )))
373
374 (((
375 (% style="color:blue" %)**Step 3:**(%%) Open ST-LINK utility, file ~-~-> open file to select the image to be upgraded.
376 )))
377
378 (((
379 (% style="color:blue" %)**Step 4:**
380 )))
381
382 * Case 1: If your board has the **Reset pin** connect to St-Link ((for example: LSN50v2, LHT65, LAQ4), click the blue global “settings” button on ST-LINK.
383
384 * Case 2: If your board doesn't have reset pin connect to ST-Link, but has a reset button (for example: LGT92). Keep pushing the small reset button on LGT92 and then click the blue global “settings” button on ST-Link utility.
385
386 [[image:image-20220526175243-19.png]]
387
388 Click Global Icon
389
390
391 (% style="color:blue" %)**Step 5**(%%)**:** **Please select the mode as Connect under reset. **After click the Global ICon in Step4, The led on the ST-LINK v2 adapter will now blinks, if you use hand to press the reset button , you need to release the reset button when see the LED blinks, and the ST-Link will detect the STM32 hardware as below. Click cancel to enter next step. Please check hardware connection if ST-Link v2 LED doesn't blink.
392
393
394 [[image:image-20230329155929-3.png]]
395
396 Do not click OK, click Cancel
397
398
399 (% style="color:blue" %)**Step 6:**(%%)** **Click verify/upgrade firmware. The ST-Link utility will pop up a download window. Click the start button to download the image to Device.
400
401 [[image:image-20220701171857-1.png]]
402
403 ST-Link v2 Upgrade
404
405
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0