2016-10-17 01:59 AM
Hi,
I am working on win10 using the STEVAL-IDW001V1 Evaluation module. Application development has been fine, but now I would like to update the firmware to the latest to use the extra features. I have tried both the UART bootloader method and the AT command OTA using Apache server and both have their own problems. I reverted to trying the UART method because I could not get the OTA method to work.OTA Method - I am not able to tell whether my module is *.11 or *.21
1. Connect module to Wifi network 2. Start Apache 2.4 server on PC (also connected to same network) 3. Confirm server running by opening browser 127.0.0.1 4. Place .ota file in htdocs folder of the server 5. Use AT+S.FWUPDATE=127.0.0.1,/SPWF01S-160129-c5bf5ce-RELEASE-main.ota What returns is: ERROR: connect() failed, aborting<CR><LF>
UART Method
1. Place J4 so BOOT 0 is high. 2. HW reset the module 3. Run the FW_update.bat 4. I make the on screen selection as follows, but it hangs here Any pointers on either method? Here are my AT&V and AT+S.STS♯ Dumping All Configuration Keys:<CR><LF> ♯ nv_manuf = ST<CR><LF> ♯ nv_model = SPWF01SA1<CR><LF> ♯ nv_serial = 3514D37752<CR><LF> ♯ nv_wifi_macaddr = 00:80:E1:B4:A4:F1<CR><LF> ♯ blink_led = 0<CR><LF> ♯ wind_off_low = 0x00000000<CR><LF> ♯ wind_off_medium = 0x00000000<CR><LF> ♯ wind_off_high = 0x00000000<CR><LF> ♯ user_desc = anonymous<CR><LF> ♯ escape_seq = at+s.<CR><LF> ♯ localecho1 = 0<CR><LF> ♯ console1_speed = 115200<CR><LF> ♯ console1_hwfc = 0<CR><LF> ♯ console1_enabled = 1<CR><LF> ♯ sleep_enabled = 0<CR><LF> ♯ standby_enabled = 0<CR><LF> ♯ standby_time = 10<CR><LF> ♯ wifi_tx_msdu_lifetime = 0<CR><LF> ♯ wifi_rx_msdu_lifetime = 0<CR><LF> ♯ wifi_operational_mode = 0x00000011<CR><LF> ♯ wifi_beacon_wakeup = 1<CR><LF> ♯ wifi_beacon_interval = 100<CR><LF> ♯ wifi_listen_interval = 0<CR><LF> ♯ wifi_rts_threshold = 3000<CR><LF> ♯ wifi_ssid = 42:54:48:75:62:33:2D:57:52:48:38:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00<CR><LF> ♯ wifi_ssid_len = 11<CR><LF> ♯ wifi_channelnum = 6<CR><LF> ♯ wifi_opr_rate_mask = 0x00003FCF<CR><LF> ♯ wifi_bas_rate_mask = 0x0000000F<CR><LF> ♯ wifi_mode = 1<CR><LF> ♯ wifi_auth_type = 0<CR><LF> ♯ wifi_atim_window = 0<CR><LF> ♯ wifi_powersave = 0<CR><LF> ♯ wifi_tx_power = 18<CR><LF> ♯ wifi_rssi_thresh = 0<CR><LF> ♯ wifi_rssi_hyst = 0<CR><LF> ♯ wifi_ap_idle_timeout = 120<CR><LF> ♯ wifi_beacon_loss_thresh = 10<CR><LF> ♯ wifi_priv_mode = 2<CR><LF> ♯ wifi_wep_keys[0] = 12:34:56:78:90:5C:40:00:00:00:00:00:00:00:00:00<CR><LF> ♯ wifi_wep_keys[1] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00<CR><LF> ♯ wifi_wep_keys[2] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00<CR><LF> ♯ wifi_wep_keys[3] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00<CR><LF> ♯ wifi_wep_key_lens = 05:00:00:00<CR><LF> ♯ wifi_wep_default_key = 0<CR><LF> ♯ wifi_wpa_psk_raw = XXXXXXXXX<CR><LF> ♯ wifi_wpa_psk_text = XXXXXXXXX<CR><LF> ♯ ip_use_dhcp = 1<CR><LF> ♯ ip_use_httpd = 1<CR><LF> ♯ ip_mtu = 1500<CR><LF> ♯ ip_hostname = embeddedbrd<CR><LF> ♯ ip_apdomainname = captiveportal.net<CR><LF> ♯ ip_ipaddr = 255.255.255.255<CR><LF> ♯ ip_netmask = 255.255.255.255<CR><LF> ♯ ip_gw = 255.255.255.255<CR><LF> ♯ ip_dns = 255.255.255.255<CR><LF> ♯ ip_http_get_recv_timeout = 3000<CR><LF> ♯ ip_dhcp_timeout = 20<CR><LF> ♯ ip_sockd_timeout = 250<CR><LF>♯ Status & Statistics:<CR><LF> ♯ version = 141106-0950875-SPWF01S <CR><LF> ♯ reset_reason = 0<CR><LF> ♯ conf_flag = 5<CR><LF> ♯ system_uptime = 3017<CR><LF> ♯ system_sleeptime = 0<CR><LF> ♯ gpio_enable = 0<CR><LF> ♯ captiveportal = 0<CR><LF> ♯ wifi_state = 10<CR><LF> ♯ wifi_bssid = 00:01:3B:9F:1A:82<CR><LF> ♯ wifi_aid = 2<CR><LF> ♯ wifi_channelnum = 11<CR><LF> ♯ wifi_sup_rate_mask = 0x003FFFCF<CR><LF> ♯ wifi_bas_rate_mask = 0x0000000F<CR><LF> ♯ wifi_chan_activity2 = 0x00003FFF<CR><LF> ♯ wifi_max_tx_power = 18<CR><LF> ♯ wifi_reg_country = GB <CR><LF> ♯ wifi_dtim_period = 3<CR><LF> ♯ wifi_sleeping = 1<CR><LF> ♯ wifi_num_assoc = 0<CR><LF> ♯ ip_ipaddr = 192.168.1.94<CR><LF> ♯ ip_netmask = 255.255.255.0<CR><LF> ♯ ip_gw = 192.168.1.254<CR><LF> ♯ ip_dns = 192.168.1.254<CR><LF> ♯ ip_sock_open = 0<CR><LF> ♯ ip_sockd_port = 0<CR><LF> ♯ free_heap = 20752<CR><LF> ♯ min_heap = 20008<CR><LF> ♯ current_time = 3017<CR><LF> #spwf01sa #ota
2016-10-17 06:31 AM
Tom,
The .11 module has the onboard flash that allows for OTA programming. Check which module you bought. The .21 module has 0.5MB flash as opposed to the 1.5MB for the .11 module.I didn't risk the UART method as I read that you can brick your module. I was (eventually) successful in updating via the OTA method. I followed the ''Lab 2a: FOTA update'' in the ST FW 3.5 WiFi Training - Hands On PDF. The issues I ran into were 1) running on our internal company server didn't work, as the firmware wouldn't download correctly.2) Setting up Apache on my local computer was painless, but it didn't work until I opened the port on the Windows Firewall.After those fixes the firmware update was fast and painless! Don't forget to reload factory defaults after the update. Also, I read that some people's hardware causes the update to hang because they don't properly set levels on certain pins. If you are using ST's demo board (STEVAL-IDW001V1), then this is not an issue.2016-10-18 01:24 PM
Hi,
UART method is safe if/when writing AFTER address 0x08002800.
- using batch script (inside firmware package), there is no way to brick the module (starting address is transparent)
- using STM32 Flasher, pay attention to starting address (MUST be set)
Regards
jerry
2017-02-15 12:24 PM
Hi
,it seems I just bricked my .21 module doing exactly that.
I was trying the batch script but it would just say 'COM10 no error'. So I then got the STM32flasher and applied the exact same commands from the batch file and it worked but hang at a few percent.
THEN I read here that the -s 0x08002800 is mandatory - why isn't that in the original upgrade script then? And why wouldn't the original flasher work?
Original flasher .bat content:
@echo off cls echo **************************************************** echo * FW update via UART * echo * To place the module in firmware download mode * echo * the BOOT0 pin needs to be pulled high (3.3v). * echo **************************************************** echo. @set /P VARIABLEA=TYPE THE FULL PATH WHERE .bin FILE IS LOCATED (i.e. C:/ , C:/Documents): echo. @set /P VARIABLEB=TYPE THE NUMBER OF THE COM PORT ALLOCATED (i.e. 9): echo. cd '%VARIABLEA%' 1203flash.exe -b 115200 -w SPWF01S-160129-c5bf5ce-RELEASE-main.bin COM%VARIABLEB% echo * echo * echo * Press a key to exit... pause>nul-> My used command line:
stm32flash -w SPWF01S-160129-c5bf5ce-RELEASE-main.bin -b 115200 COM10-> The error message of stm32flash:
stm32flash 0.5 http://stm32flash.sourceforge.net/ Using Parser : Raw BINARY Interface serial_w32: 115200 8E1 Version : 0x22 Option 1 : 0x00 Option 2 : 0x00 Device ID : 0x0414 (STM32F10xxx High-density) - RAM : 64KiB (512b reserved by bootloader) - Flash : 512KiB (size first sector: 2x2048) - Option RAM : 16b - System RAM : 2KiB Write to memory Erasing memory Failed to write memory at address 0x08000000And the error message of the first attempt using the original batch file:
**************************************************** * FW update via UART * * To place the module in firmware download mode * * the BOOT0 pin needs to be pulled high (3.3v). * **************************************************** stm32flash - http://stm32flash.googlecode.com/ Using Parser : Raw BINARY COM10: No error * * * Press a key to exit...Any ideas? It seems that the active bootloader is the default one in ROM, so I don't see why I cannot just write the .bin file in to flash.
If I try to dump flash contents, I get only 0xFF (512KB of it). But it works.
I attached the log of the actual bus communication @9600baud. Maybe that explains why I can't write?
________________ Attachments : spwf_error.xlsx : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyvM&d=%2Fa%2F0X0000000bDu%2F8HMwjDttlzwoXJxOXAv95UqZ60qZzgfx8Aht24PgybA&asPdf=false2017-02-16 02:11 AM
Hi,
SPWF01S-xxx.bin is for *.11 modules. You should use SPWF02S-xxx.bin for your *.21 module.
If we are lucky, module's bootloader is sane. Otherwise, contact ST office/distributor to get the bootloader application.
2017-02-16 02:51 PM
Oh that explains a lot. I only had looked at the bin and because the module is called SPWF01xxxx I figured it's the correct firmware. Bummer.
Anyway, re-downloaded the correct firmware and ran the updater but it cancelled again saying COM10: No error.
I guess I'd have to get the bootloader application. Would you maybe have a point of contact for me? I bought the module via RS components. Should I talk to them? Or could you maybe give me an email address of whom to talk to? Would be much appreciated.
-> Is it correct that I could flash the bootloader using stm32flash with starting address 0x08000000? So I would basically use this command:
stm32flash -b 57600 -w bootloader.bin COM10
Thanks!
2017-02-17 01:04 AM
Contact your distributor for bootloader (IMPORTANT FOR*.21 MODULES: flash 'recovery' image, otherwise MAC address il lost).
Starting addresses are 800.0000 for boot and 800.2800 for app.
I suggest ST Flasher (GUI based) at this stage.
2017-02-19 02:42 PM
Thanks for the hint with the ST Flasher - I didn't know about that tool. Nice.
I just contacted my distributor - unfortunately, they don't have access to that image file. They ended up sending me a replacement part for free. Very kind of them. Still bugs me as I'd really like to fix this module.
Could I maybe flash the app image into address 0x080000 and just ditch the bootloader? The .21 module can't do OTA upgrades anyway so I don't see what I'd need the bootloader for?
2017-02-20 02:53 AM
Send me a private message. I can give you a recovery/boot image.
I hope MAC address is not lost. It's stored @ 0x08002000 (between boot app and main app). Once module will be back to life, you'll found 00:80:E1:xx:xx:xx (good MAC) or 02:11:22:33:44:99 (default MAC).
2017-02-22 01:55 PM