Firmware Update

From indie Semiconductor Wiki
Jump to navigation Jump to search

1 SiRad Easy® r4

To update or change the microcontroller firmware, the board has to be set in bootloader mode, using the button on the microcontroller main board.

  • Press BOOT button and hold
  • Press RESET button
  • Release RESET button
  • Release BOOT button

The firmware can be flashed after the device has been set to programming mode. Both of the below described methods can be used to flash the firmware.

1.1 Use STM32CubeProgrammer to flash the firmware

Connect to the device using the following UART settings:

  • COM port number of your device
  • 115200 baud
  • Parity: Even
  • Data bits: 8
  • Stop bits: 1.0
  • Flow control: Off

Switch to the Open file tab and chose the firmware file you want to flash. Then click the Download button to flash the firmware to the device. It should take some minutes. The flash progress can be observed with the green progress bar in the bottom of the tool. Just close the tool after the finished flash progress.

2 SiRad Simple®

Requirements:

2.1 Set device into programming mode

The device needs to be booted into the programming mode prior to flashing. Both of the below described methods can be used to set the device into the programming mode.

2.1.1 Use a terminal program to send the programming command

You can use any terminal program to achieve what is described below, however, we use Realterm as an example to describe the process.

Connect to the device using the following UART settings:

  • 230400 or 1000000 baud (depending on the flashed firmware)
  • COM port number of your device
  • Parity: None
  • Data bits: 8
  • Stop bits: 1
  • Flow control: None

Switch to the Port tab and chose the settings, then click on Open. You should see the communication of the device flowing over the UART. Now switch to the Send tab and put in !W\r\n into the first send line. Click Send ASCII to send the programming command to the device. The communication flow should stop and the LED should stop blinking. Do not power cycle the device now until the flash process was finished.

Important: Switch back to the Port tab and release the Open button to be able to connect with the flash tool.

Trouble shooting: If an error message appears in Realterm just click it away and try a few more times to click the button until it was released without an error message.

2.1.2 Use hardware switch SW1 to power cycle into programming mode

Disconnect the device from power and use a small screw driver to switch the MP switch of SW1 on the device to ON. Connect the UART lines and power to the device. It should not light up its LED now since it went into programming mode. Do not power cycle the device now until the flash process was finished.

2.2 Flash the firmware

The firmware can be flashed after the device has been set to programming mode. Both of the below described methods can be used to flash the firmware.

2.2.1 Use STM32CubeProgrammer to flash the firmware

Connect to the device using the following UART settings:

  • COM port number of your device
  • 115200 baud
  • Parity: Even
  • Data bits: 8
  • Stop bits: 1.0
  • Flow control: Off

Switch to the Open file tab and chose the firmware file you want to flash. Then click the Download button to flash the firmware to the device. It should take some minutes. The flash progress can be observed with the green progress bar in the bottom of the tool. Just close the tool after the finished flash progress.

Trouble shooting: If STM32CubeProgrammer does not want to connect to the device, please check that the port is closed in the terminal program.

Trouble shooting 2: If STM32CubeProgrammer does not want to flash, please check the baud rate setting as described above.

2.2.2 Use STM32Flash (Open Source) to flash the firmware

Requirements:

  • STM32Flash tool and flash script with settings for SiRad Simple
  • STM32Flash tool extracted to some folder on your harddisk
  • firmware and flash script placed in the same folder as STM32Flash tool
  • know the COM port number of your device

Open the flash script (*.bat file) for editing in a text editor. Check the name of the firmware (*.bin file) and change it to match the firmware that you want to flash. Check the COM port number and change it to match your devices COM port number. Do not change any of the other settings. Save and close the *.bat file. Now execute the *.bat file. A command line window should appear telling you the flash progress. It should take some minutes to flash the firmware. The window should close automatically when the flash process is finished. The LED of the device will start blinking as usual.

Trouble shooting: If the flash progress is not shown or the command line window opens only very shortly, the flash tool could not flash the device. Please check again the name and COM port in the *.bat file and make sure that no other tool still uses the COM port.


2.3 Microcontroller

To update or change the microcontroller firmware, the board has to be set in bootloader mode, as shown in Figure 36. This is done by switching the DIP switch called MP to the ON position. Then connect the module to the PC via a USB to UART cable using the external header. Please read Section 2.1.1 about the external header connection. Connect cable TX to MR (microcontroller RX) and cable RX to MT (microcontroller TX). Make sure to use a cable with 3.3V TTL levels! Find and install the flash tool stm32flash in the Firmware folder of the provided Install Package. Copy the desired firmware from the ‘Firmware\SiRad_Simple’ folder of the Install Package into the stm32flash folder. Edit the batch file stm32flash.bat and replace the COM port with the COM port of your USB to UART cable and the firmware name with the desired firmware, marked here:

                                                             stm32flash.exe -b 115200 -w <date>_SiRad_Simple_L8_<version>.bin -v -g 0x0 COMx

Run the batch file and the microcontroller gets programmed. After about 30 seconds the programming is finished. Switch the DIP switch MP back to the OFF position and do a power cycle to reset the module. You can find the firmware <date>_SiRad_Simple_L8_<version>.bin in the provided Install Package in the folder ‘Firmware\SiRad_Simple’.

2.4 WiFi Module

Connect the sensor using a USB to UART cable like shown in Figure 37 using the external header. Please read Section 2.1.1 about the external header connection. Switch the DIP switch called WP to the ON position. Then connect cable TX to WR (WiFi RX) and cable RX to WT (WiFi TX). Make sure to use a cable with 3.3V TTL levels! Now connect the power Jumper J2 to enable the supply voltage for the WiFi module.

Figure 36: Firmware update configuration
Figure 37: WiFi module update configuration


Find and install the esptool in the Firmware folder of the provided Install Package. Copy the firmware from the ‘Firmware\WiFi_Module\websocket_mini’ folder of the Install Package into the esptool folder. Edit the batch file esptool.bat and replace the COM port with the COM port of your USB to UART cable and the firmware name with the desired firmware, marked here:

                                                                      esptool -bz 1M -cp COMx -cf websocket_mini.ino.generic.bin

Run the batch file and the WiFi module gets programmed, indicated by a flashing blue LED. After about 40 seconds programming is finished. Switch the DIP switch called WP back to the OFF position and connect a jumper between MT and WR and MR and WT.

2.5 Power cycle the device

The device now needs to be power cycled to get back into standard operation mode. Disconnect the device from power. If you used the hardware switch to boot into programming mode, you should now set the MP switch of SW1 back to OFF. Connect the power to the device. You can now use the device as usual.

3 SiRad Easy®

3.1 Microcontroller Board

To update or change the microcontroller firmware, the board has to be connected to the PC via the USB port. It opens a new mass storage device called NODE_F303RE. Just drag and drop the .bin file you want to flash on that device. LD1 on the board starts flashing red and green. As soon as the flashing stops, the board is programmed and after a reset the new firmware should be running. Alternatively, you can use the ST-LINK Utility (STSW-LINK009) to flash the firmware on the microcontroller board. You can find the firmware in the folder ‘Firmware\SiRad_Easy’ of the provided Install Package:

  • <date>_SiRad_Easy_L7_<version>.bin for the kit bought after 10/2016,
  • <date>_SiRad_Easy_L8_<version>.bin for the kit bought before 11/2016.

If you are unsure, which firmware version is appropriate for your hardware, please contact us.

3.2 WiFi Module

Connect the SiRad Easy® using a USB to UART cable like shown in Figure 39 using the external header. Please read Section 2.1.2 about the external header connection. Then connect cable TX to WR (WiFi RX) and cable RX to WT (WiFi TX). Make sure to use a cable with 3.3V TTL levels! Switch SW1 to the PROG position.

Figure 38: WiFi module update configuration


Figure 39: WiFi module select switch SW1

Find and install the esptool in the Firmware folder of the provided Install Package. Copy the firmware from the ‘Firmware\WiFi_Module\websocket_mini’ folder of the Install Package into the esptool folder. Edit the batch file esptool.bat and replace the COM port with the COM port of your USB to UART cable and the firmware name with the desired firmware, marked here:

                                                               esptool -bz 1M -cp COMx -cf websocket_mini.ino.generic.bin

Run the batch file and the WiFi module gets programmed, indicated by a flashing blue LED. After about 40 seconds programming is finished. Switch SW1 back to the ON position and connect a jumper between MT and WR and MR and WT.

3.3 USB Controller Firmware

Download and extract the ST-LINK firmware update tool (STSW-LINK007) from the ST Microelectronics website. Go into the ‘AllPlatforms’ folder and start the .jar file. Connect the SiRad Easy®, click ‘Refresh device list’ and then ‘Open in update mode’ to see the current USB controller firmware. Click ‘Upgrade’ to flash it to the latest version.