mikaelnousiainen / RS41ng

Custom firmware for Vaisala RS41 and Graw DFM-17 radiosondes with support for amateur radio use. Ideal for tracking high-altitude balloons. Supported modes include APRS, Horus 4FSK mode, CATS, morse code (CW) and additional digital modes like WSPR and FT8 via Si5351.
GNU General Public License v2.0
109 stars 28 forks source link

Add flash instructions for genuine ST-Link/V2 Flasher #89

Open MFeiler-RFA opened 2 months ago

MFeiler-RFA commented 2 months ago

I ran into some issues today trying to flash a RS41 with a genuine ST-Link/V2 programmer instead of the 3rd-party clones I have used before. When trying to flash using openOCD i got the following errors:

Error: target voltage may be too low for reliable debugging
Error: init mode failed (unable to connect to the target)

I found conflicting information online, about whether or not to connect the voltage supply pin (MCU switch 3.3V/Pin5) to the programmer, so I chose not to connect it. After connecting this pin I had no further issues.

As far as I understand (please correct me if I'm wrong) the corresponding pin on the ST-Links 20-pin header (MCU_VDD/Pin1 and Pin2) does not power the Radiosonde (so batteries or another power supply is still needed for flashing) but is needed to "ensure signal compatibility between the boards" (see User Manual Page 12). I don't know if this was obvious to other people, but it took me some time to figure out. Maybe consider adding this info to the README (for example like below)? Also might be a good idea to try to reproduce this issue, as I don't know if my programmer is behaving nominally.

Best regards.


Connect the RS41 radiosonde to the programmer

With 3rd Party ST-LINK Dongle:
  1. If your ST-LINK v2 programmer is capable of providing a voltage of 3.3V (as some third-party clones are), remove the batteries from the sonde. Otherwise, leave the batteries in and power on the sonde.
  2. Connect an ST-LINK v2 programmer dongle to the sonde via the following pins:
    • SWDIO -> Pin 9 (SWDIO)
    • SWCLK -> Pin 8 (SWCLK)
    • GND -> Pin 1 (GND)
    • 3.3V -> Pin 5 (MCU switch 3.3V) (only required when using the programmer to power the sonde)
With genuine ST-LINK Dongle:
  1. The programmer is not able to provide the sonde with power so you will need to leave the batteries in/provide another power source.
  2. Connect the Radiosonde to the 20-pin Connector of the programmer.
    • SWDIO -> Pin 9 (SWDIO)
    • SWCLK -> Pin 8 (SWCLK)
    • GND -> Pin 1 (GND)
    • MCU_VDD -> Pin 5 (MCU switch 3.3V) (only required when using the programmer to power the sonde)
rpratt20 commented 3 weeks ago

This may or may not be relevant to this issue. I have had several DFM-17 fail to program when powered by used batteries and the same error occurred. Replacing batteries to get better voltage may also fix the error.