Version 3.2 by Xiaoling on 2022/05/11 16:38

Show last authors
1 Contents:
2
3 {{toc/}}
4
5 = 1. Introduction =
6
7 This instruction shows how to upgrade firmware for Dragino products base on STM32 solution. The upgrade can use 2 hardware connections: **UART upgrade** or **ST Link v2 upgrade**. Some models supports both methods and some only one of them.
8
9 = 2. Hardware Upgrade Method Support List =
10
11 (% border="1" style="background-color:#ffffcc; color:green; width:891.222px" %)
12 |=(% colspan="3" style="width: 888px;" %)Dragino STM32 base hardware Upgrade Methods
13 |(% style="width:444px" %)**Model**|(% style="width:239px" %)**UART Connection**|(% style="width:204px" %)**ST-Link Connection**
14 |(% style="width:444px" %)[[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:239px" %)Hardware Connect Photo|(% style="width:204px" %)Hardware Connect Photo
15 |(% style="width:444px" %)[[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:239px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#LGT92.2FLBT1_ST-Link_v2_Connection]]
16 |(% style="width:444px" %)[[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:239px" %)Hardware Connect Photo|(% style="width:204px" %)×
17 |(% style="width:444px" %)[[LHT65>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/151-lht65.html]]|(% style="width:239px" %)×|(% style="width:204px" %)Hardware Connect Photo
18 |(% style="width:444px" %)[[RS485-LN>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/154-rs485-ln.html]]|(% style="width:239px" %)Hardware Connect Photo|(% style="width:204px" %)×
19 |(% style="width:444px" %)[[LSN50 v2>>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(((
20 [[LDDS75>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/161-ldds75.html]]
21 )))|(% style="width:239px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#LSN50_v2.2FLSN50v2-D22.2FLSN50v2-D23]]|(% style="width:204px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#LSN50_v2.2FLSN50v2-D22.2FLSN50v2-D23_Type]]
22 |(% style="width:444px" %)[[LAQ4>>url:http://www.dragino.com/products/lora-lorawan-end-node/item/174-laq4.html]]|(% style="width:239px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#LAQ4_ST-Link_v2_Connection]]
23 |(% style="width:444px" %)[[RS485-BL>>url:https://www.dragino.com/products/lora-lorawan-end-node/item/167-rs485-bl.html]], LDDS75,[[LLDS12>>url:https://www.dragino.com/products/distance-level-sensor/item/185-llds12.html]],LDDS20,[[LSE01>>https://www.dragino.com/products/agriculture-weather-station/item/159-lse01.html]],WSC1-L,GroPoint Air|(% style="width:239px" %)[[Hardware Connection Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Trouble_Shooting#RS485-BL.2FLDDS75.2FLDDS20.2FLSE01]]|(% style="width:204px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#RS485-BL.2FLDDS75.2FLDDS20.2FLSE01_2]]
24 |(% style="width:444px" %)[[LTC2>>url:https://www.dragino.com/products/temperature-humidity-sensor/item/170-ltc2.html]]|(% style="width:239px" %)×|(% style="width:204px" %)[[Hardware Connect Photo>>url:https://wiki.dragino.com/index.php/Firmware_Upgrade_Instruction_for_STM32_base_products#LTC2]]
25
26
27 = 3. UART Upgrade Guide =
28
29 == 3.1 Hardware Connection ==
30
31 === 3.1.1 LSN50 v1 ===
32
33 [[image:image-20220511163746-2.png]]
34
35 Connection for LSN50 v1
36
37 === 3.1.2 LSN50 v2/LSN50v2-D22/LSN50v2-D23 ===
38
39 [[image:https://wiki.dragino.com/images/thumb/f/f8/STM32_UART_Upgrade_2.png/600px-STM32_UART_Upgrade_2.png||height="291" width="600"]]
40
41 Connection for LSN50 Type V2
42
43 === 3.1.3 RS485-BL/LDDS75/LDDS20/LSE01 ===
44
45 [[image:https://wiki.dragino.com/images/thumb/b/ba/STM32_UART_Upgrade_RS485-BL.jpg/600px-STM32_UART_Upgrade_RS485-BL.jpg||height="412" width="600"]]
46
47 Connection for RS485-BL base mother board
48
49 For UART Update, need:
50
51 * Connect USB-TTL TXD <~-~-> Device UART_RX
52 * Connect USB-TTL RXD <~-~-> Device UART_TX
53 * Connect USB-TTL GND <~-~-> Device GND
54 * Put Switch SW1 to ISP position
55 * Connect JP2 jumper (Yellow one), so device is power on.
56
57
58 == 3.2 Upgrade Steps ==
59
60 (((
61 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]].
62 )))
63
64 (((
65 Step 2: Download the Image files, which can be found in the product user manual.
66 )))
67
68 (((
69 Step 3: Open Flashloader; choose the correct COM port to update, Please notice that the serial setting must follow below photos.
70 )))
71
72 (((
73 Step 4: Set The device into **ISP Mode**. Then Press the **Reset Button**, In the Flash tool, click next and the tool will detect the board type.
74 )))
75
76 (% class="box warningmessage" %)
77 (((
78 **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.
79 )))
80
81 [[image:https://wiki.dragino.com/images/thumb/0/0e/STM32_UART_Upgrade_3.png/600px-STM32_UART_Upgrade_3.png||height="361" width="600"]]
82
83 UART Upgrade
84
85 [[image:https://wiki.dragino.com/images/thumb/4/49/STM32_UART_Upgrade_4.png/600px-STM32_UART_Upgrade_4.png||height="359" width="600"]]
86
87 UART Upgrade
88
89 [[image:https://wiki.dragino.com/images/thumb/0/09/STM32_UART_Upgrade_5.png/600px-STM32_UART_Upgrade_5.png||height="385" width="600"]]
90
91 UART Upgrade
92
93 (((
94 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.
95 )))
96
97 (((
98 Step 6: Always run AT+FDR after update firmware. This is to reset the device to factory settings of the new firmware.
99
100 )))
101
102 == 3.3 Trouble shooting ==
103
104 === 3.3.1 General Check List ===
105
106 1. Double check if follow up exactly the steps as manual.
107 1. Check if hardware works fine:
108 1*. check if AT command works, in both TX/RX
109 1*. check if the device are in upgrade mode, see product manual for upgrade mode indicator.
110 1*. check if reset button works
111 1. If you use Windows10 system. Please change the flash loader to run in Windows7 compatibility mode.
112 1. 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.
113
114
115 == 3.4 Flash Loader ~-~- Unable to Load data from this file ==
116
117 [[image:https://wiki.dragino.com/images/9/96/FlashLoader-troube_1.png||height="521" width="399"]]
118
119 Unable to Load data from this file
120
121 (((
122 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.
123 )))
124
125 == 3.5 Alternative method to flash via UART ==
126
127 [[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]]
128
129
130 = 4. ST-Link v2 Upgrade =
131
132 == 4.1 Hardware Connections ==
133
134 === 4.1.1 LSN50 v2/LSN50v2-D22/LSN50v2-D23 Type ===
135
136 [[image:https://wiki.dragino.com/images/thumb/3/38/STM32_STLINK_1.jpg/600px-STM32_STLINK_1.jpg||height="270" width="600"]]
137
138 ST-Link Connections for LSn50 V2/LSN50v2-D22/LSN50v2-D23 Type
139
140
141 === 4.1.2 LGT92/LBT1 ST-Link v2 Connection ===
142
143 [[image:https://wiki.dragino.com/images/thumb/a/a5/STM32_STLINK_Upgrade_1.png/600px-STM32_STLINK_Upgrade_1.png||height="388" width="600"]]
144
145 Connection to LGT92
146
147 * ST-LINK v2 5.0v <~-~-> Dupont red pin
148 * ST-LINK v2 GND <~-~-> Dupont black pin
149 * ST-LINK v2 SWCLK <~-~-> Dupont green pin
150 * ST-LINK v2 SWDIO <~-~-> Dupont white pin
151
152
153 === 4.1.3 LAQ4 ST-Link v2 Connection ===
154
155 [[image:https://wiki.dragino.com/images/thumb/0/03/STM32_STLINK_Upgrade_LAQ4.png/600px-STM32_STLINK_Upgrade_LAQ4.png||height="331" width="600"]]
156
157 Connection to LAQ4
158
159
160 === 4.1.4 RS485-BL/LDDS75/LDDS20/LSE01 ===
161
162 [[image:https://wiki.dragino.com/images/thumb/b/ba/STM32_UART_Upgrade_RS485-BL.jpg/600px-STM32_UART_Upgrade_RS485-BL.jpg||height="412" width="600"]]
163
164 Connection for RS485-BL base mother board
165
166 When use ST-Link v2 to update, need:
167
168 * ST-LINK v2 RESET <~-~-> NRST
169 * ST-LINK v2 GND <~-~-> GND
170 * ST-LINK v2 SWCLK <~-~-> SWCLK
171 * ST-LINK v2 SWDIO <~-~-> SWDIO
172 * ST-LINK (VDD 3.3v,pin19) <~-~-> ST-LINK (TVCC ,pin1) a wire to connect two pins of ST-Link together.
173
174 === 4.1.5 LTC2 ===
175
176 [[image:https://wiki.dragino.com/images/thumb/e/ea/LTC2-1.jpg/600px-LTC2-1.jpg||height="420" width="600"]]
177
178 Connection for LTC2 base mother board
179
180 Connection:
181
182 * ST-LINK v2 GND <~-~-> LTC2 GND
183 * ST-LINK v2 RESET <~-~-> LTC2 NRST
184 * ST-LINK v2 SWCLK <~-~-> LTC2 SWCLK
185 * ST-LINK v2 SWDIO <~-~-> LTC2 SWDIO
186
187
188 == 4.2 ST-Link Upgrade Guide ==
189
190 (((
191 **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]]
192 )))
193
194 (((
195 **Step 2**: Download the Image files, firmware download link can be found on the product user manual.
196 )))
197
198 (((
199 **Step 3**: Open ST-LINK utility, file ~-~-> open file to select the image to be upgraded.
200 )))
201
202 (((
203 **Step 4**:
204 )))
205
206 * 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.
207 * 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.
208
209 [[image:https://wiki.dragino.com/images/thumb/a/ae/STM32_ST-Link_Upgrade_2-1.png/600px-STM32_ST-Link_Upgrade_2-1.png||height="136" width="600"]]
210
211 Click Global Icon
212
213
214 **Step 5**: 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
215
216 [[image:https://wiki.dragino.com/images/thumb/2/20/ST-LINK-troube_2.png/600px-ST-LINK-troube_2.png||height="366" width="600"]]
217
218 Do not click OK, click Cancel
219
220 **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.
221
222 [[image:https://wiki.dragino.com/images/thumb/9/9a/STM32_ST-Link_Upgrade_3.png/600px-STM32_ST-Link_Upgrade_3.png||height="389" width="600"]]
223
224 ST-Link v2 Upgrade
225
226
227 == 4.3 Trouble Shootings ==
228
229 === 4.3.1 ST-Link v2 can not detect the hardware ===
230
231 Possible Issue 1:
232
233 1. Make sure see the LED blink on the ST-Link and release the reset button during blinking.
234
235
236 Possible Issue 2:
237
238 1. There are different version ST-Link v2. The white one as below is the most stable and recommended one.
239 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.
240
241 [[image:https://wiki.dragino.com/images/thumb/e/e4/ST-Link_upload_issue111.jpg/600px-ST-Link_upload_issue111.jpg||height="450" width="600"]]
242
243 ST-Link upload issue
244
245
246 Possible Issue 3:
247
248 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.
249
250 [[image:https://wiki.dragino.com/images/a/a3/ST-LINK-troube_4.png||height="337" width="406"]]
251
252 RESET pin not function
253
254 (((
255 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.
256 )))
257
258 For LHT65 we recommend to use the white one show in possible issue 2.
259
260 For LGT92, if user use this type of ST-Link, please also connect the 5v to USB port of LGT92
261
262
263 === 4.3.2 ST-Link v2 detect the hardware but disconnect after click OK ===
264
265 [[image:https://wiki.dragino.com/images/thumb/2/20/ST-LINK-troube_2.png/600px-ST-LINK-troube_2.png||height="366" width="600"]]
266
267 Do not click OK, click Cancel
268
269 === 4.3.3 Old ST-LINK firmware/ST-LINK already use and USB communication error ===
270
271 (((
272 It may be that your stlink firmware is too old.
273 )))
274
275 (((
276 You can try these steps:
277 )))
278
279 (((
280 You unplug the stlink, and then plug in the stlink again.
281 )))
282
283 (((
284 You click ST-LINK->Firmware update.
285 )))
286
287 [[image:https://wiki.dragino.com/images/thumb/f/f4/Stlink22.png/600px-Stlink22.png||height="401" width="600"]]
288
289 **step1**:click Device connect.
290
291 [[image:https://wiki.dragino.com/images/1/12/Stlink23.png||height="238" width="486"]]
292
293 **step2:**Click yes to upgrade successfully.
294
295 [[image:https://wiki.dragino.com/images/a/a2/Stlink24.png||height="128" width="230"]]
296
297 **step3:**