https://bitwizard.nl/wiki/index.php?title=Firmware_upgrade_STM32Wifi&feed=atom&action=historyFirmware upgrade STM32Wifi - Revision history2024-03-29T10:42:07ZRevision history for this page on the wikiMediaWiki 1.27.0https://bitwizard.nl/wiki/index.php?title=Firmware_upgrade_STM32Wifi&diff=3038&oldid=prevRew: /* performing the upgrade */2015-01-19T09:29:20Z<p><span dir="auto"><span class="autocomment">performing the upgrade</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 09:29, 19 January 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l70" >Line 70:</td>
<td colspan="2" class="diff-lineno">Line 70:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  dfu-util -a 0 -d 0483:df11 -s 0x801fc00 -D config.bin</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  dfu-util -a 0 -d 0483:df11 -s 0x801fc00 -D config.bin</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>will flash it into permanent storage of the stm32wifi.  </div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>will flash it into permanent storage of the stm32wifi<ins class="diffchange diffchange-inline">.  Now you can move the jumper back and restart the device</ins>.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Note that if you change the wifi credentials, the device will continue to attempt to use the old wifi. Only when that fails will it switch to the new credentials.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Note that if you change the wifi credentials, the device will continue to attempt to use the old wifi. Only when that fails will it switch to the new credentials.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== future ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">In the future the device will support USB so using dfu-util to flash the config will no longer be necessary.</ins></div></td></tr>
</table>Rewhttps://bitwizard.nl/wiki/index.php?title=Firmware_upgrade_STM32Wifi&diff=3037&oldid=prevRew: Created page with "This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or exp..."2015-01-19T09:27:30Z<p>Created page with "This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or exp..."</p>
<p><b>New page</b></p><div>This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or expand this page. <br />
<br />
== tools required ==<br />
<br />
* A Linux PC. <br />
* dfu-util installed. <br />
* Optionally: A config file. <br />
<br />
=== Installing dfu-util ===<br />
<br />
dfu-util is part of the Ubuntu distribution: <br />
apt-get install dfu-util <br />
should do the job for users of recent ubuntu distributions. <br />
<br />
Otherwise, cloning the git repository and compiling that should work:<br />
git clone https://gitorious.org/dfu-util/dfu-util.git<br />
cd dfu-util<br />
./autogen.sh<br />
./configure<br />
make<br />
make install <br />
(I did this a while ago, this was typed from memory. If you do it, let me know if it works). <br />
<br />
== performing the upgrade ==<br />
<br />
You need a binary. It's currently called chwifi.bin. <br />
<br />
Put the device in DFU firmware upgrade mode: Move the jumper to the position towards the crystal. Then insert the USB cable. The device should enumerate as an STM-DFU device: "Product: STM32 BOOTLOADER".<br />
<br />
Then issue: <br />
dfu-util -a 0 -d 0483:df11 -s 0x8000000 -D chwifi.bin<br />
<br />
If you want to configure your stm32wifi over a ttl-level serial port, then you're done: move the jumper back and reboot the device (powercycle or hit the reset button). <br />
<br />
Otherwise you need to generate a config file:<br />
<br />
create the script makeconfigbin:<br />
<br />
#!/bin/sh<br />
if [ $# -ne 4 ] ; then<br />
echo usage $0 ssid password host url<br />
exit 1<br />
fi<br />
#makechar 255 255 255 255<br />
makeconfigstring 32 "$1"<br />
makeconfigstring 32 "$2"<br />
makeconfigstring 64 "$3"<br />
makeconfigstring 64 "$4"<br />
<br />
and makeconfigstring:<br />
<br />
#!/bin/sh<br />
len=$1<br />
str=$2<br />
tmp=`tempfile`<br />
#for i in `seq $len` ; do<br />
# makechar 255 >> $tmp<br />
#done<br />
dd if=/dev/zero bs=$len count=1 | tr '\0' '\377' > $tmp<br />
(echo -n $str ; dd if=/dev/zero bs=1 count=1 ) | dd of=$tmp conv=notrunc<br />
cat $tmp<br />
rm $tmp<br />
<br />
Now you can run the makeconfigbin script and provide it with your wifi credentials and the server host and URL: <br />
<br />
./makeconfigbin <wifissid> <wifipassword> www.bitwizard.nl /esp/logit.php\? > config.bin<br />
<br />
Put in your own wifi ssid and password. Then: <br />
<br />
dfu-util -a 0 -d 0483:df11 -s 0x801fc00 -D config.bin<br />
<br />
will flash it into permanent storage of the stm32wifi. <br />
<br />
Note that if you change the wifi credentials, the device will continue to attempt to use the old wifi. Only when that fails will it switch to the new credentials.</div>Rew