Both sides previous revisionPrevious revisionNext revision | Previous revision |
projects:jimbob:radiosonde [2018/08/22 08:59] – kevwal | projects:jimbob:radiosonde [2018/09/05 09:17] (current) – kevwal |
---|
Tom SP9UOB kindly gave some of us a RS41-SG Radiosonde at the UKHAS 2018 conference. | Tom SP9UOB kindly gave some of us a RS41-SG Radiosonde at the UKHAS 2018 conference. |
| |
Software options seem to be: | Software options that I can find: |
* https://github.com/yanosik/STM32_RTTY | * [[https://github.com/yanosik/STM32_RTTY]] - Original? |
* https://github.com/Qyon/STM32_RTTY | * [[https://github.com/Qyon/STM32_RTTY]] - Added APRS |
* https://github.com/df8oe/RS41HUP | * [[https://github.com/df8oe/RS41HUP]] - Make UKHAS format compatible |
* https://github.com/darksidelemm/RS41HUP | * [[https://github.com/darksidelemm/RS41HUP]] - Remove APRS, add 4FSK and other tidy-ups (Fix compile on Windows, by adding missing files - Projects window, right click, 'Add Files' - and add all missing files.) |
| * [[-]] - Toms software which is not publicly available yet. |
| |
Reprogramming needs a STM programmer like this [[https://www.aliexpress.com/item/FREE-SHIPPING-ST-Link-V2-stlink-mini-STM8STM32-STLINK-simulator-download-programming-With-Cover/1823628996.html|one]] using [[https://github.com/darksidelemm/RS41HUP/blob/master/docs/programming_header.md|this]] pinout. The Driver for the ST-link-V2 is here [[https://www.st.com/en/development-tools/stsw-link009.html]] | Download and install the CoIDE [[https://www.wyzbee.com/download/Utilities/Software/CoIDE-1.7.8.exe]] |
| |
| Download and install the GCC ARM compiler [[https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-win32.exe]] |
| |
Trying this software first: [[https://github.com/yanosik/STM32_RTTY]] | Open the project in CoIDE and setup the defaults in main.c or config.h (depends which software you are using), and then build: |
| |
Downloaded and installed the IDE [[https://www.wyzbee.com/download/Utilities/Software/CoIDE-1.7.8.exe]] | |
| |
Downloaded and installed the Compiler [[https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-win32.exe]] | |
| |
Open the project in CoIDE and setup the defaults in main.c, and then build: | |
| |
<code> | <code> |
[mkdir] Created dir: C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\rtty\Debug\obj | [mkdir] Created dir: C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\rtty\Debug\obj |
[cc] 17 total files to be compiled. | [cc] 17 total files to be compiled. |
[cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F100C8 -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -IC:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\inc -IC:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master -IC:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib -IC:\Users\WALTONK\Documents -IC:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\cmsis -IC:\Users\WALTONK\Documents\Electronics -IC:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\cmsis_boot C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_tim.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\fun.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\cmsis_boot\startup\startup_stm32f10x_md_vl.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\cmsis_boot\system_stm32f10x.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_pwr.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_gpio.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\init.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_rcc.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_adc.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_usart.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\f_rtty.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\syscalls\syscalls.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_flash.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_dma.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\misc.c C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\stm_lib\src\stm32f10x_spi.c | [cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F100C8 - |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\fun.c: In function 'srednia': | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\fun.c:139:13: warning: array subscript has type 'char' [-Wchar-subscripts] | [snip] |
[cc] srednia_u[i] = dana; | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\fun.c:144:10: warning: array subscript has type 'char' [-Wchar-subscripts] | |
[cc] srednia_u[nr_pom] = dana; | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\fun.c:151:19: warning: array subscript has type 'char' [-Wchar-subscripts] | |
[cc] sr += srednia_u[i]; | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c: In function 'main': | |
[cc] sprintf(buf_rtty,"%s*%04X\n",buf_rtty,CRC_rtty & 0xffff); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:344:20: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long int' [-Wformat=] | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:344:20: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long int' [-Wformat=] | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:355:9: warning: implicit declaration of function 'strncmp' [-Wimplicit-function-declaration] | |
[cc] if (strncmp(GPS_buf,"$GPRMC",6) == 0) | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:359:9: warning: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] | |
[cc] strcpy(czas,"000000"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:359:9: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:364:12: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] strcpy(kierunek,"0"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:364:12: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:368:8: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] strcpy(szerokosc,"0.00000"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:368:8: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:378:8: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:359:9: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] strcpy(dlugosc,"0.00000"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:378:8: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:389:10: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] strcpy(status,"-"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:389:10: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:398:13: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] strcpy(wysokosc,"0"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:398:13: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:402:13: warning: incompatible implicit declaration of built-in function 'strcpy' | |
[cc] strcpy(use_sat,"0"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:402:13: note: include '<string.h>' or provide a declaration of 'strcpy' | |
[cc] strcpy(predkosc,"0"); | |
[cc] ^ | |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:411:16: warning: incompatible implicit declaration of built-in function 'strcpy' | [cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:411:16: warning: incompatible implicit declaration of built-in function 'strcpy' |
[cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:411:16: note: include '<string.h>' or provide a declaration of 'strcpy' | [cc] C:\Users\WALTONK\Documents\Electronics\STM32_RTTY-master\main.c:411:16: note: include '<string.h>' or provide a declaration of 'strcpy' |
And with a few warnings it builds! | And with a few warnings it builds! |
| |
| Reprogramming needs a STM programmer like this [[https://www.aliexpress.com/item/FREE-SHIPPING-ST-Link-V2-stlink-mini-STM8STM32-STLINK-simulator-download-programming-With-Cover/1823628996.html|one from china]], or if you can't wait that long, [[https://www.amazon.co.uk/gp/product/B0722WMDFQ/|this one]] on Prime from Amazon. The driver for the ST-link-V2 programmer is here [[https://www.st.com/en/development-tools/stsw-link009.html]]. I used the ST-Link utility programming tool (which includes the driver) from [[https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.license=1533224576969.html|here]]. |
| |
| Pinout of the SG41 2mm connector is [[https://github.com/Qyon/STM32_RTTY/blob/master/docs/pinout_extension_port.txt|here]]. |
| Connections to the 2mm pitch RS41-SG connector I made were: |
| * Gnd to Gnd |
| * +VDD_MCU to +3.3v |
| * SWCLK to SWCLK |
| * SWDIO to SWDIO |
| * Rst to Rst |
| Be aware that some of the circuit diagrams around are for the OEM ST-Link V2 programmer which has many more pins than the cheap one I link to above. |
| |
| And we have a connection using the ST-Link utility. |
| |
| <code> |
| 11:51:09 : ST-LINK SN : 56FF6B064977535412210687 |
| 11:51:09 : ST-LINK Firmware version : V2J29S7 |
| 11:51:09 : Connected via SWD. |
| 11:51:09 : SWD Frequency = 4,0 MHz. |
| 11:51:09 : Connection mode : Normal. |
| 11:51:09 : Debug in Low Power mode enabled. |
| 11:51:09 : Device ID:0x420 |
| 11:51:09 : Device family :STM32F100xx Low/Medium density Value Line |
| 11:51:09 : Can not read memory! |
| Disable Read Out Protection and retry. |
| </code> |
| |
| I then tried for several hours to re-programme the chip, and kept failing, before discovering that I needed to turn off the 'Read Out Protection' that was turned on in the chip. I used the STM32 ST-Link utility to do that, connecting to the RS41 (Target -> Connect) and then editing the Options Bytes (Target -> Options Bytes) to disabled Read Out Protection and 'Unselect all' in the bottom 'Flash sectors protection' section. |
| |
| <code> |
| 15:51:19 : Option bytes updated successfully. |
| 15:51:31 : Flash memory erased. |
| 15:52:01 : Memory programmed in 6s and 812ms. |
| </code> |
| |
| Now both the ST-Link and the CooCox CoIDE tools will both flash the chip |
| |
The RS41 takes 2 x AA batteries - as you look at the battery holder vertically, with the aerial down and temperature sensor up, the right hand battery has + at the top, the left hand battery has + at the bottom. | The RS41 takes 2 x AA batteries - as you look at the battery holder vertically, with the aerial down and temperature sensor up, the right hand battery has + at the top, the left hand battery has + at the bottom. |
| |
| I have tried all of the software above, but currently am running darksidelemm's and getting packets transmitted: |
| |
| $$$$$G7PMO-RS41-1,18,17:03:20,N52.3227,W0.7062,93,0,4,2810,25*9511 |
| |
| Hopefully this is of use to others - any corrections please do let me know. |
| |
| Cheers, |
| Kevin |
| |
| |
| |
| |
| |
| |