Add saving cnf in ROM, workink with leds

This commit is contained in:
2026-03-30 18:42:53 +03:00
parent 0b982e5d4d
commit d43458c770
82 changed files with 43899 additions and 41684 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
../SubGHz_Phy/App/config/config_defaults.c:5:6:Config_LoadDefaults 2

View File

@@ -0,0 +1,8 @@
SubGHz_Phy/App/config/config_defaults.o: \
../SubGHz_Phy/App/config/config_defaults.c \
../SubGHz_Phy/App/config/config_defaults.h \
../SubGHz_Phy/App/config/config_types.h \
../SubGHz_Phy/App/config/config_consts.h
../SubGHz_Phy/App/config/config_defaults.h:
../SubGHz_Phy/App/config/config_types.h:
../SubGHz_Phy/App/config/config_consts.h:

Binary file not shown.

View File

@@ -0,0 +1 @@
../SubGHz_Phy/App/config/config_defaults.c:5:6:Config_LoadDefaults 16 static

View File

@@ -0,0 +1,3 @@
../SubGHz_Phy/App/config/config_store.c:17:17:Config_CalcChecksum 2
../SubGHz_Phy/App/config/config_store.c:30:6:Config_Load 4
../SubGHz_Phy/App/config/config_store.c:58:6:Config_Save 5

View File

@@ -0,0 +1,84 @@
SubGHz_Phy/App/config/config_store.o: \
../SubGHz_Phy/App/config/config_store.c \
../SubGHz_Phy/App/config/config_store.h \
../SubGHz_Phy/App/config/config_types.h \
../SubGHz_Phy/App/config/config_consts.h \
../SubGHz_Phy/App/config/config_defaults.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal.h \
../Core/Inc/stm32wlxx_hal_conf.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_dma.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_def.h \
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wlxx.h \
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wl55xx.h \
../Drivers/CMSIS/Include/core_cm4.h \
../Drivers/CMSIS/Include/cmsis_version.h \
../Drivers/CMSIS/Include/cmsis_compiler.h \
../Drivers/CMSIS/Include/cmsis_gcc.h \
../Drivers/CMSIS/Include/mpu_armv7.h \
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/system_stm32wlxx.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_dma.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_dmamux.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_dma_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_cortex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_exti.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_flash.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_flash_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_gpio.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_gpio_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_pwr.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_pwr.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_pwr_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rcc.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_rcc.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_bus.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rcc_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_exti.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rtc.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rtc_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_subghz.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_spi.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_uart.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_uart_ex.h \
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_system.h
../SubGHz_Phy/App/config/config_store.h:
../SubGHz_Phy/App/config/config_types.h:
../SubGHz_Phy/App/config/config_consts.h:
../SubGHz_Phy/App/config/config_defaults.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal.h:
../Core/Inc/stm32wlxx_hal_conf.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_dma.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_def.h:
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wlxx.h:
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wl55xx.h:
../Drivers/CMSIS/Include/core_cm4.h:
../Drivers/CMSIS/Include/cmsis_version.h:
../Drivers/CMSIS/Include/cmsis_compiler.h:
../Drivers/CMSIS/Include/cmsis_gcc.h:
../Drivers/CMSIS/Include/mpu_armv7.h:
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/system_stm32wlxx.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_dma.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_dmamux.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_dma_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_cortex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_exti.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_flash.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_flash_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_gpio.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_gpio_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_pwr.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_pwr.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_pwr_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rcc.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_rcc.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_bus.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rcc_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_exti.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rtc.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_rtc_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_subghz.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_spi.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_uart.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal_uart_ex.h:
../Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_ll_system.h:

Binary file not shown.

View File

@@ -0,0 +1,3 @@
../SubGHz_Phy/App/config/config_store.c:17:17:Config_CalcChecksum 24 static
../SubGHz_Phy/App/config/config_store.c:30:6:Config_Load 24 static
../SubGHz_Phy/App/config/config_store.c:58:6:Config_Save 88 static

View File

@@ -0,0 +1,30 @@
################################################################################
# Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../SubGHz_Phy/App/config/config_defaults.c \
../SubGHz_Phy/App/config/config_store.c
OBJS += \
./SubGHz_Phy/App/config/config_defaults.o \
./SubGHz_Phy/App/config/config_store.o
C_DEPS += \
./SubGHz_Phy/App/config/config_defaults.d \
./SubGHz_Phy/App/config/config_store.d
# Each subdirectory must supply rules for building sources it contributes
SubGHz_Phy/App/config/%.o SubGHz_Phy/App/config/%.su SubGHz_Phy/App/config/%.cyclo: ../SubGHz_Phy/App/config/%.c SubGHz_Phy/App/config/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WL55xx -c -I../Core/Inc -I../SubGHz_Phy/App -I../SubGHz_Phy/Target -I../Utilities/trace/adv_trace -I../Drivers/STM32WLxx_HAL_Driver/Inc -I../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../Utilities/misc -I../Utilities/sequencer -I../Utilities/timer -I../Utilities/lpm/tiny_lpm -I../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../Middlewares/Third_Party/SubGHz_Phy -I../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../Drivers/CMSIS/Include -I../Drivers/BSP/STM32WLxx_Nucleo -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
clean: clean-SubGHz_Phy-2f-App-2f-config
clean-SubGHz_Phy-2f-App-2f-config:
-$(RM) ./SubGHz_Phy/App/config/config_defaults.cyclo ./SubGHz_Phy/App/config/config_defaults.d ./SubGHz_Phy/App/config/config_defaults.o ./SubGHz_Phy/App/config/config_defaults.su ./SubGHz_Phy/App/config/config_store.cyclo ./SubGHz_Phy/App/config/config_store.d ./SubGHz_Phy/App/config/config_store.o ./SubGHz_Phy/App/config/config_store.su
.PHONY: clean-SubGHz_Phy-2f-App-2f-config

View File

@@ -1,33 +1,38 @@
../SubGHz_Phy/App/subghz_phy_app.c:146:6:SubghzApp_Init 1 ../SubGHz_Phy/App/subghz_phy_app.c:125:6:SubghzApp_Init 2
../SubGHz_Phy/App/subghz_phy_app.c:165:6:SubghzApp_Process 1 ../SubGHz_Phy/App/subghz_phy_app.c:151:6:SubghzApp_Process 1
../SubGHz_Phy/App/subghz_phy_app.c:173:13:App_ProcessRadioEvents 10 ../SubGHz_Phy/App/subghz_phy_app.c:160:13:App_ProcessRadioEvents 10
../SubGHz_Phy/App/subghz_phy_app.c:221:13:App_ProcessUartPacketizer 5 ../SubGHz_Phy/App/subghz_phy_app.c:211:13:App_ProcessUartPacketizer 5
../SubGHz_Phy/App/subghz_phy_app.c:238:13:App_ProcessEscape 8 ../SubGHz_Phy/App/subghz_phy_app.c:228:13:App_ProcessEscape 8
../SubGHz_Phy/App/subghz_phy_app.c:267:13:App_StartNextTxIfPossible 4 ../SubGHz_Phy/App/subghz_phy_app.c:257:13:App_StartNextTxIfPossible 4
../SubGHz_Phy/App/subghz_phy_app.c:279:13:App_RadioApplyConfig 1 ../SubGHz_Phy/App/subghz_phy_app.c:269:13:App_ApplyConfig 2
../SubGHz_Phy/App/subghz_phy_app.c:285:13:App_RadioConfigureRx 2 ../SubGHz_Phy/App/subghz_phy_app.c:280:13:App_RadioApplyConfig 1
../SubGHz_Phy/App/subghz_phy_app.c:315:13:App_RadioConfigureTx 2 ../SubGHz_Phy/App/subghz_phy_app.c:286:13:App_RadioConfigureRx 2
../SubGHz_Phy/App/subghz_phy_app.c:341:13:App_RadioEnterRx 1 ../SubGHz_Phy/App/subghz_phy_app.c:316:13:App_RadioConfigureTx 2
../SubGHz_Phy/App/subghz_phy_app.c:347:13:App_EnterConfigMode 1 ../SubGHz_Phy/App/subghz_phy_app.c:342:13:App_RadioEnterRx 1
../SubGHz_Phy/App/subghz_phy_app.c:356:13:App_ExitConfigMode 1 ../SubGHz_Phy/App/subghz_phy_app.c:348:13:App_EnterConfigMode 2
../SubGHz_Phy/App/subghz_phy_app.c:365:13:App_ResetDataPath 1 ../SubGHz_Phy/App/subghz_phy_app.c:364:13:App_ExitConfigMode 1
../SubGHz_Phy/App/subghz_phy_app.c:375:13:App_DataModeFeedByte 3 ../SubGHz_Phy/App/subghz_phy_app.c:373:13:App_ResetDataPath 1
../SubGHz_Phy/App/subghz_phy_app.c:395:13:App_DataModeFlushBuilder 3 ../SubGHz_Phy/App/subghz_phy_app.c:383:13:App_DataModeFeedByte 3
../SubGHz_Phy/App/subghz_phy_app.c:409:16:App_QueuePush 4 ../SubGHz_Phy/App/subghz_phy_app.c:403:13:App_DataModeFlushBuilder 3
../SubGHz_Phy/App/subghz_phy_app.c:423:13:App_QueuePop 2 ../SubGHz_Phy/App/subghz_phy_app.c:417:16:App_QueuePush 4
../SubGHz_Phy/App/subghz_phy_app.c:434:13:UartRxByteCallback 13 ../SubGHz_Phy/App/subghz_phy_app.c:431:13:App_QueuePop 2
../SubGHz_Phy/App/subghz_phy_app.c:497:13:App_ConfigFeedByte 9 ../SubGHz_Phy/App/subghz_phy_app.c:442:13:UartRxByteCallback 13
../SubGHz_Phy/App/subghz_phy_app.c:529:13:App_ConfigExecuteLine 33 ../SubGHz_Phy/App/subghz_phy_app.c:505:13:App_ConfigFeedByte 9
../SubGHz_Phy/App/subghz_phy_app.c:704:13:App_PrintConfigPrompt 2 ../SubGHz_Phy/App/subghz_phy_app.c:537:13:App_ConfigExecuteLine 34
../SubGHz_Phy/App/subghz_phy_app.c:712:13:App_PrintHelp 1 ../SubGHz_Phy/App/subghz_phy_app.c:699:13:App_PrintConfigPrompt 2
../SubGHz_Phy/App/subghz_phy_app.c:730:13:App_PrintStatus 2 ../SubGHz_Phy/App/subghz_phy_app.c:707:13:App_PrintHelp 1
../SubGHz_Phy/App/subghz_phy_app.c:752:13:App_Printf 3 ../SubGHz_Phy/App/subghz_phy_app.c:726:13:App_PrintStatus 2
../SubGHz_Phy/App/subghz_phy_app.c:775:13:App_Write 3 ../SubGHz_Phy/App/subghz_phy_app.c:748:13:App_Printf 3
../SubGHz_Phy/App/subghz_phy_app.c:785:13:App_ReconfigureUart 5 ../SubGHz_Phy/App/subghz_phy_app.c:771:13:App_Write 3
../SubGHz_Phy/App/subghz_phy_app.c:811:16:App_ParseHexSyncWord 11 ../SubGHz_Phy/App/subghz_phy_app.c:781:13:App_ReconfigureUart 5
../SubGHz_Phy/App/subghz_phy_app.c:859:14:App_SkipSpaces 4 ../SubGHz_Phy/App/subghz_phy_app.c:807:16:App_ParseHexSyncWord 11
../SubGHz_Phy/App/subghz_phy_app.c:868:13:OnTxDone 1 ../SubGHz_Phy/App/subghz_phy_app.c:855:14:App_SkipSpaces 4
../SubGHz_Phy/App/subghz_phy_app.c:873:13:OnRxDone 2 ../SubGHz_Phy/App/subghz_phy_app.c:864:13:App_LedTxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:888:13:OnTxTimeout 1 ../SubGHz_Phy/App/subghz_phy_app.c:871:13:App_LedRxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:893:13:OnRxTimeout 1 ../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedErrPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:898:13:OnRxError 1 ../SubGHz_Phy/App/subghz_phy_app.c:885:13:App_ProcessLeds 7
../SubGHz_Phy/App/subghz_phy_app.c:909:13:OnTxDone 1
../SubGHz_Phy/App/subghz_phy_app.c:914:13:OnRxDone 2
../SubGHz_Phy/App/subghz_phy_app.c:929:13:OnTxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:934:13:OnRxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:939:13:OnRxError 1

View File

@@ -52,7 +52,13 @@ SubGHz_Phy/App/subghz_phy_app.o: ../SubGHz_Phy/App/subghz_phy_app.c \
../Core/Inc/utilities_conf.h ../Drivers/CMSIS/Include/cmsis_compiler.h \ ../Core/Inc/utilities_conf.h ../Drivers/CMSIS/Include/cmsis_compiler.h \
../Utilities/misc/stm32_mem.h ../Utilities/misc/stm32_tiny_vsnprintf.h \ ../Utilities/misc/stm32_mem.h ../Utilities/misc/stm32_tiny_vsnprintf.h \
../Core/Inc/utilities_def.h ../Core/Inc/usart.h ../Core/Inc/dma.h \ ../Core/Inc/utilities_def.h ../Core/Inc/usart.h ../Core/Inc/dma.h \
../Core/Inc/usart.h ../Core/Inc/main.h ../Core/Inc/usart.h ../Core/Inc/main.h \
../SubGHz_Phy/App/config/config_consts.h \
../SubGHz_Phy/App/config/config_types.h \
../SubGHz_Phy/App/config/config_consts.h \
../SubGHz_Phy/App/config/config_defaults.h \
../SubGHz_Phy/App/config/config_types.h \
../SubGHz_Phy/App/config/config_store.h
../Core/Inc/platform.h: ../Core/Inc/platform.h:
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wlxx.h: ../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wlxx.h:
../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wl55xx.h: ../Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wl55xx.h:
@@ -113,3 +119,9 @@ SubGHz_Phy/App/subghz_phy_app.o: ../SubGHz_Phy/App/subghz_phy_app.c \
../Core/Inc/dma.h: ../Core/Inc/dma.h:
../Core/Inc/usart.h: ../Core/Inc/usart.h:
../Core/Inc/main.h: ../Core/Inc/main.h:
../SubGHz_Phy/App/config/config_consts.h:
../SubGHz_Phy/App/config/config_types.h:
../SubGHz_Phy/App/config/config_consts.h:
../SubGHz_Phy/App/config/config_defaults.h:
../SubGHz_Phy/App/config/config_types.h:
../SubGHz_Phy/App/config/config_store.h:

View File

@@ -1,33 +1,38 @@
../SubGHz_Phy/App/subghz_phy_app.c:146:6:SubghzApp_Init 8 static ../SubGHz_Phy/App/subghz_phy_app.c:125:6:SubghzApp_Init 8 static
../SubGHz_Phy/App/subghz_phy_app.c:165:6:SubghzApp_Process 8 static ../SubGHz_Phy/App/subghz_phy_app.c:151:6:SubghzApp_Process 8 static
../SubGHz_Phy/App/subghz_phy_app.c:173:13:App_ProcessRadioEvents 8 static ../SubGHz_Phy/App/subghz_phy_app.c:160:13:App_ProcessRadioEvents 8 static
../SubGHz_Phy/App/subghz_phy_app.c:221:13:App_ProcessUartPacketizer 16 static ../SubGHz_Phy/App/subghz_phy_app.c:211:13:App_ProcessUartPacketizer 16 static
../SubGHz_Phy/App/subghz_phy_app.c:238:13:App_ProcessEscape 16 static ../SubGHz_Phy/App/subghz_phy_app.c:228:13:App_ProcessEscape 16 static
../SubGHz_Phy/App/subghz_phy_app.c:267:13:App_StartNextTxIfPossible 16 static ../SubGHz_Phy/App/subghz_phy_app.c:257:13:App_StartNextTxIfPossible 16 static
../SubGHz_Phy/App/subghz_phy_app.c:279:13:App_RadioApplyConfig 8 static ../SubGHz_Phy/App/subghz_phy_app.c:269:13:App_ApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:285:13:App_RadioConfigureRx 72 static ../SubGHz_Phy/App/subghz_phy_app.c:280:13:App_RadioApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:315:13:App_RadioConfigureTx 48 static ../SubGHz_Phy/App/subghz_phy_app.c:286:13:App_RadioConfigureRx 72 static
../SubGHz_Phy/App/subghz_phy_app.c:341:13:App_RadioEnterRx 8 static ../SubGHz_Phy/App/subghz_phy_app.c:316:13:App_RadioConfigureTx 48 static
../SubGHz_Phy/App/subghz_phy_app.c:347:13:App_EnterConfigMode 8 static ../SubGHz_Phy/App/subghz_phy_app.c:342:13:App_RadioEnterRx 8 static
../SubGHz_Phy/App/subghz_phy_app.c:356:13:App_ExitConfigMode 8 static ../SubGHz_Phy/App/subghz_phy_app.c:348:13:App_EnterConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:365:13:App_ResetDataPath 4 static ../SubGHz_Phy/App/subghz_phy_app.c:364:13:App_ExitConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:375:13:App_DataModeFeedByte 16 static ../SubGHz_Phy/App/subghz_phy_app.c:373:13:App_ResetDataPath 4 static
../SubGHz_Phy/App/subghz_phy_app.c:395:13:App_DataModeFlushBuilder 8 static ../SubGHz_Phy/App/subghz_phy_app.c:383:13:App_DataModeFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:409:16:App_QueuePush 16 static ../SubGHz_Phy/App/subghz_phy_app.c:403:13:App_DataModeFlushBuilder 8 static
../SubGHz_Phy/App/subghz_phy_app.c:423:13:App_QueuePop 4 static ../SubGHz_Phy/App/subghz_phy_app.c:417:16:App_QueuePush 16 static
../SubGHz_Phy/App/subghz_phy_app.c:434:13:UartRxByteCallback 24 static ../SubGHz_Phy/App/subghz_phy_app.c:431:13:App_QueuePop 4 static
../SubGHz_Phy/App/subghz_phy_app.c:497:13:App_ConfigFeedByte 16 static ../SubGHz_Phy/App/subghz_phy_app.c:442:13:UartRxByteCallback 24 static
../SubGHz_Phy/App/subghz_phy_app.c:529:13:App_ConfigExecuteLine 32 static ../SubGHz_Phy/App/subghz_phy_app.c:505:13:App_ConfigFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:704:13:App_PrintConfigPrompt 8 static ../SubGHz_Phy/App/subghz_phy_app.c:537:13:App_ConfigExecuteLine 32 static
../SubGHz_Phy/App/subghz_phy_app.c:712:13:App_PrintHelp 8 static ../SubGHz_Phy/App/subghz_phy_app.c:699:13:App_PrintConfigPrompt 8 static
../SubGHz_Phy/App/subghz_phy_app.c:730:13:App_PrintStatus 8 static ../SubGHz_Phy/App/subghz_phy_app.c:707:13:App_PrintHelp 8 static
../SubGHz_Phy/App/subghz_phy_app.c:752:13:App_Printf 208 static ../SubGHz_Phy/App/subghz_phy_app.c:726:13:App_PrintStatus 8 static
../SubGHz_Phy/App/subghz_phy_app.c:775:13:App_Write 16 static ../SubGHz_Phy/App/subghz_phy_app.c:748:13:App_Printf 208 static
../SubGHz_Phy/App/subghz_phy_app.c:785:13:App_ReconfigureUart 16 static ../SubGHz_Phy/App/subghz_phy_app.c:771:13:App_Write 16 static
../SubGHz_Phy/App/subghz_phy_app.c:811:16:App_ParseHexSyncWord 40 static ../SubGHz_Phy/App/subghz_phy_app.c:781:13:App_ReconfigureUart 16 static
../SubGHz_Phy/App/subghz_phy_app.c:859:14:App_SkipSpaces 16 static ../SubGHz_Phy/App/subghz_phy_app.c:807:16:App_ParseHexSyncWord 40 static
../SubGHz_Phy/App/subghz_phy_app.c:868:13:OnTxDone 4 static ../SubGHz_Phy/App/subghz_phy_app.c:855:14:App_SkipSpaces 16 static
../SubGHz_Phy/App/subghz_phy_app.c:873:13:OnRxDone 24 static ../SubGHz_Phy/App/subghz_phy_app.c:864:13:App_LedTxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:888:13:OnTxTimeout 4 static ../SubGHz_Phy/App/subghz_phy_app.c:871:13:App_LedRxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:893:13:OnRxTimeout 4 static ../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedErrPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:898:13:OnRxError 4 static ../SubGHz_Phy/App/subghz_phy_app.c:885:13:App_ProcessLeds 16 static
../SubGHz_Phy/App/subghz_phy_app.c:909:13:OnTxDone 4 static
../SubGHz_Phy/App/subghz_phy_app.c:914:13:OnRxDone 24 static
../SubGHz_Phy/App/subghz_phy_app.c:929:13:OnTxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:934:13:OnRxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:939:13:OnRxError 4 static

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,6 +15,7 @@ RM := rm -rf
-include Utilities/misc/subdir.mk -include Utilities/misc/subdir.mk
-include Utilities/lpm/tiny_lpm/subdir.mk -include Utilities/lpm/tiny_lpm/subdir.mk
-include SubGHz_Phy/Target/subdir.mk -include SubGHz_Phy/Target/subdir.mk
-include SubGHz_Phy/App/config/subdir.mk
-include SubGHz_Phy/App/subdir.mk -include SubGHz_Phy/App/subdir.mk
-include Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/subdir.mk -include Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/subdir.mk
-include Drivers/STM32WLxx_HAL_Driver/Src/subdir.mk -include Drivers/STM32WLxx_HAL_Driver/Src/subdir.mk
@@ -43,34 +44,34 @@ $(wildcard ../makefile.init) \
$(wildcard ../makefile.targets) \ $(wildcard ../makefile.targets) \
BUILD_ARTIFACT_NAME := SubGHz_Phy_Per_My_Test BUILD_ARTIFACT_NAME := suffix
BUILD_ARTIFACT_EXTENSION := elf BUILD_ARTIFACT_EXTENSION := elf
BUILD_ARTIFACT_PREFIX := BUILD_ARTIFACT_PREFIX :=
BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables
EXECUTABLES += \ EXECUTABLES += \
SubGHz_Phy_Per_My_Test.elf \ suffix.elf \
MAP_FILES += \ MAP_FILES += \
SubGHz_Phy_Per_My_Test.map \ suffix.map \
SIZE_OUTPUT += \ SIZE_OUTPUT += \
default.size.stdout \ default.size.stdout \
OBJDUMP_LIST += \ OBJDUMP_LIST += \
SubGHz_Phy_Per_My_Test.list \ suffix.list \
# All Target # All Target
all: main-build all: main-build
# Main-build Target # Main-build Target
main-build: SubGHz_Phy_Per_My_Test.elf secondary-outputs main-build: suffix.elf secondary-outputs
# Tool invocations # Tool invocations
SubGHz_Phy_Per_My_Test.elf SubGHz_Phy_Per_My_Test.map: $(OBJS) $(USER_OBJS) /soft/stm32/projects/SubGHz_Phy_Per_My_Test/STM32WL55JCIX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS) suffix.elf suffix.map: $(OBJS) $(USER_OBJS) /soft/stm32/projects/suffix/STM32WL55JCIX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-gcc -o "SubGHz_Phy_Per_My_Test.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"/soft/stm32/projects/SubGHz_Phy_Per_My_Test/STM32WL55JCIX_FLASH.ld" --specs=nosys.specs -Wl,-Map="SubGHz_Phy_Per_My_Test.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group arm-none-eabi-gcc -o "suffix.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"/soft/stm32/projects/suffix/STM32WL55JCIX_FLASH.ld" --specs=nosys.specs -Wl,-Map="suffix.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
@echo 'Finished building target: $@' @echo 'Finished building target: $@'
@echo ' ' @echo ' '
@@ -79,14 +80,14 @@ default.size.stdout: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
@echo 'Finished building: $@' @echo 'Finished building: $@'
@echo ' ' @echo ' '
SubGHz_Phy_Per_My_Test.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS) suffix.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-objdump -h -S $(EXECUTABLES) > "SubGHz_Phy_Per_My_Test.list" arm-none-eabi-objdump -h -S $(EXECUTABLES) > "suffix.list"
@echo 'Finished building: $@' @echo 'Finished building: $@'
@echo ' ' @echo ' '
# Other Targets # Other Targets
clean: clean:
-$(RM) SubGHz_Phy_Per_My_Test.elf SubGHz_Phy_Per_My_Test.list SubGHz_Phy_Per_My_Test.map default.size.stdout -$(RM) default.size.stdout suffix.elf suffix.list suffix.map
-@echo ' ' -@echo ' '
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST)

View File

@@ -41,6 +41,8 @@
"./Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/wl_lr_fhss.o" "./Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/wl_lr_fhss.o"
"./SubGHz_Phy/App/app_subghz_phy.o" "./SubGHz_Phy/App/app_subghz_phy.o"
"./SubGHz_Phy/App/subghz_phy_app.o" "./SubGHz_Phy/App/subghz_phy_app.o"
"./SubGHz_Phy/App/config/config_defaults.o"
"./SubGHz_Phy/App/config/config_store.o"
"./SubGHz_Phy/Target/radio_board_if.o" "./SubGHz_Phy/Target/radio_board_if.o"
"./Utilities/lpm/tiny_lpm/stm32_lpm.o" "./Utilities/lpm/tiny_lpm/stm32_lpm.o"
"./Utilities/misc/stm32_mem.o" "./Utilities/misc/stm32_mem.o"

View File

@@ -28,6 +28,7 @@ Drivers/BSP/STM32WLxx_Nucleo \
Drivers/STM32WLxx_HAL_Driver/Src \ Drivers/STM32WLxx_HAL_Driver/Src \
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver \ Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver \
SubGHz_Phy/App \ SubGHz_Phy/App \
SubGHz_Phy/App/config \
SubGHz_Phy/Target \ SubGHz_Phy/Target \
Utilities/lpm/tiny_lpm \ Utilities/lpm/tiny_lpm \
Utilities/misc \ Utilities/misc \

BIN
Debug/suffix.elf Executable file

Binary file not shown.

41714
Debug/suffix.list Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@ MEMORY
{ {
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 254K
} }
/* Sections */ /* Sections */

View File

@@ -0,0 +1,46 @@
#ifndef CONFIG_CONSTS_H
#define CONFIG_CONSTS_H
#define RX_TIMEOUT_VALUE_MS 0U
#define TX_TIMEOUT_VALUE_MS 3000U
#define RX_CONTINUOUS_ON 1U
#define RADIO_SYNCWORD_LEN 3U
#define RADIO_WHITENING_SEED 0x01FFU
#define RADIO_CRC_POLY 0x8005U
#define RADIO_CRC_SEED 0xFFFFU
#define UART_DATA_BUFFER_SIZE 220U
#define RADIO_MAX_PAYLOAD_SIZE 220U
#define TX_QUEUE_DEPTH 4U
#define CONFIG_LINE_SIZE 96U
#define CONFIG_ESCAPE_GUARD_MS 800U
// Reserved addresses for configuration
#define FLASH_BASE_ADDR 0x08000000U
#define FLASH_TOTAL_SIZE 0x00040000U // 256 KB
#define FLASH_PAGE_SIZE 0x00000800U // 2 KB
#define CONFIG_FLASH_ADDR (FLASH_BASE_ADDR + FLASH_TOTAL_SIZE - FLASH_PAGE_SIZE)
#define CONFIG_MAGIC 0x43464731UL // "CFG1"
#define LED_PULSE_MS 50U
// Default config values
#define DEFAULT_RF_FREQUENCY 433100000UL
#define DEFAULT_TX_OUTPUT_POWER 14
#define DEFAULT_FSK_FDEV 25000UL
#define DEFAULT_FSK_BITRATE 50000UL
#define DEFAULT_FSK_BANDWIDTH 50000UL
#define DEFAULT_FSK_PREAMBLE_LENGTH 4U
#define DEFAULT_UART_PACKET_TIMEOUT_MS 20U
#define DEFAULT_UART_BAUDRATE 115200U
#define DEFAULT_SYNCWORD {0x91, 0xC4, 0x91}
#endif

View File

@@ -0,0 +1,21 @@
#include "config_defaults.h"
#include <string.h>
void Config_LoadDefaults(BridgeConfig_t *cfg)
{
if (cfg == 0)
{
return;
}
cfg->rf_frequency = DEFAULT_RF_FREQUENCY;
cfg->tx_power = DEFAULT_TX_OUTPUT_POWER;
cfg->fsk_bitrate = DEFAULT_FSK_BITRATE;
cfg->fsk_bandwidth = DEFAULT_FSK_BANDWIDTH;
cfg->fsk_fdev = DEFAULT_FSK_FDEV;
cfg->fsk_preamble_len = DEFAULT_FSK_PREAMBLE_LENGTH;
static const uint8_t default_syncword[3] = DEFAULT_SYNCWORD;
memcpy(cfg->syncword, default_syncword, sizeof(cfg->syncword));
cfg->uart_packet_timeout_ms = DEFAULT_UART_PACKET_TIMEOUT_MS;
cfg->uart_baudrate = DEFAULT_UART_BAUDRATE;
}

View File

@@ -0,0 +1,9 @@
#ifndef CONFIG_DEFAULTS_H
#define CONFIG_DEFAULTS_H
#include "config_types.h"
#include "config_consts.h"
void Config_LoadDefaults(BridgeConfig_t *cfg);
#endif

View File

@@ -0,0 +1,110 @@
#include "config_store.h"
#include "config_defaults.h"
#include "stm32wlxx_hal.h"
#include <string.h>
#include <stdint.h>
typedef struct
{
uint32_t magic;
uint32_t checksum;
BridgeConfig_t cfg;
} FlashConfig_t;
static uint32_t Config_CalcChecksum(const uint8_t *data, uint32_t len)
{
uint32_t sum = 0;
uint32_t i;
for (i = 0; i < len; i++)
{
sum += data[i];
}
return sum;
}
bool Config_Load(BridgeConfig_t *cfg)
{
const FlashConfig_t *stored;
uint32_t calc;
if (cfg == 0)
{
return false;
}
stored = (const FlashConfig_t *)CONFIG_FLASH_ADDR;
if (stored->magic != CONFIG_MAGIC)
{
return false;
}
calc = Config_CalcChecksum((const uint8_t *)&stored->cfg, sizeof(BridgeConfig_t));
if (calc != stored->checksum)
{
return false;
}
memcpy(cfg, &stored->cfg, sizeof(BridgeConfig_t));
return true;
}
bool Config_Save(const BridgeConfig_t *cfg)
{
FlashConfig_t temp;
FLASH_EraseInitTypeDef erase;
uint32_t page_error = 0;
uint32_t addr;
uint32_t i;
const uint64_t *src64;
uint32_t words64_count;
if (cfg == 0)
{
return false;
}
memset(&temp, 0xFF, sizeof(temp));
temp.magic = CONFIG_MAGIC;
memcpy(&temp.cfg, cfg, sizeof(BridgeConfig_t));
temp.checksum = Config_CalcChecksum((const uint8_t *)&temp.cfg, sizeof(BridgeConfig_t));
HAL_FLASH_Unlock();
memset(&erase, 0, sizeof(erase));
erase.TypeErase = FLASH_TYPEERASE_PAGES;
erase.Page = (CONFIG_FLASH_ADDR - FLASH_BASE_ADDR) / FLASH_PAGE_SIZE;
erase.NbPages = 1;
if (HAL_FLASHEx_Erase(&erase, &page_error) != HAL_OK)
{
HAL_FLASH_Lock();
return false;
}
addr = CONFIG_FLASH_ADDR;
src64 = (const uint64_t *)&temp;
words64_count = (sizeof(FlashConfig_t) + 7U) / 8U;
for (i = 0; i < words64_count; i++)
{
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, addr, src64[i]) != HAL_OK)
{
HAL_FLASH_Lock();
return false;
}
addr += 8U;
}
HAL_FLASH_Lock();
return true;
}

View File

@@ -0,0 +1,21 @@
#ifndef CONFIG_STORE_H
#define CONFIG_STORE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "config_types.h"
#include "config_consts.h"
#include <stdbool.h>
bool Config_Load(BridgeConfig_t *cfg);
bool Config_Save(const BridgeConfig_t *cfg);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
#ifndef CONFIG_TYPES_H
#define CONFIG_TYPES_H
#include "config_consts.h"
#include <stdint.h>
typedef struct
{
uint32_t rf_frequency;
int8_t tx_power;
uint32_t fsk_bitrate;
uint32_t fsk_bandwidth;
uint32_t fsk_fdev;
uint16_t fsk_preamble_len;
uint8_t syncword[RADIO_SYNCWORD_LEN];
uint16_t uart_packet_timeout_ms;
uint32_t uart_baudrate;
} BridgeConfig_t;
#endif

View File

@@ -5,6 +5,11 @@
#include "usart.h" #include "usart.h"
#include "main.h" #include "main.h"
#include "config/config_consts.h"
#include "config/config_types.h"
#include "config/config_defaults.h"
#include "config/config_store.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@@ -12,20 +17,6 @@
#include <ctype.h> #include <ctype.h>
#include <stdbool.h> #include <stdbool.h>
#define RX_TIMEOUT_VALUE_MS 0U
#define TX_TIMEOUT_VALUE_MS 3000U
#define RX_CONTINUOUS_ON 1U
#define RADIO_SYNCWORD_LEN 3U
#define RADIO_WHITENING_SEED 0x01FFU
#define RADIO_CRC_POLY 0x8005U
#define RADIO_CRC_SEED 0xFFFFU
#define UART_DATA_BUFFER_SIZE 220U
#define RADIO_MAX_PAYLOAD_SIZE 220U
#define TX_QUEUE_DEPTH 4U
#define CONFIG_LINE_SIZE 96U
#define CONFIG_ESCAPE_GUARD_MS 800U
#define DEFAULT_UART_PACKET_TIMEOUT_MS 20U
typedef enum typedef enum
{ {
@@ -33,19 +24,6 @@ typedef enum
APP_MODE_CONFIG APP_MODE_CONFIG
} AppMode_t; } AppMode_t;
typedef struct
{
uint32_t rf_frequency;
int8_t tx_power;
uint32_t fsk_bitrate;
uint32_t fsk_bandwidth;
uint32_t fsk_fdev;
uint16_t fsk_preamble_len;
uint8_t syncword[RADIO_SYNCWORD_LEN];
uint16_t uart_packet_timeout_ms;
uint32_t uart_baudrate;
} BridgeConfig_t;
typedef struct typedef struct
{ {
uint8_t data[RADIO_MAX_PAYLOAD_SIZE]; uint8_t data[RADIO_MAX_PAYLOAD_SIZE];
@@ -62,19 +40,7 @@ typedef struct
} EscapeDetector_t; } EscapeDetector_t;
static RadioEvents_t RadioEvents; static RadioEvents_t RadioEvents;
static BridgeConfig_t g_cfg = static BridgeConfig_t g_cfg;
{
.rf_frequency = RF_FREQUENCY_DEFAULT,
.tx_power = TX_OUTPUT_POWER_DEFAULT,
.fsk_bitrate = FSK_DATARATE_DEFAULT,
.fsk_bandwidth = FSK_BANDWIDTH_DEFAULT,
.fsk_fdev = FSK_FDEV_DEFAULT,
.fsk_preamble_len = FSK_PREAMBLE_LENGTH_DEFAULT,
.syncword = {0xC1, 0x94, 0xC1},
.uart_packet_timeout_ms = DEFAULT_UART_PACKET_TIMEOUT_MS,
.uart_baudrate = 115200UL,
};
static volatile uint8_t g_radio_tx_done = 0; static volatile uint8_t g_radio_tx_done = 0;
static volatile uint8_t g_radio_tx_timeout = 0; static volatile uint8_t g_radio_tx_timeout = 0;
static volatile uint8_t g_radio_rx_done = 0; static volatile uint8_t g_radio_rx_done = 0;
@@ -83,6 +49,10 @@ static volatile uint8_t g_radio_rx_error = 0;
static volatile int16_t g_last_rx_rssi = 0; static volatile int16_t g_last_rx_rssi = 0;
static volatile int8_t g_last_rx_cfo = 0; static volatile int8_t g_last_rx_cfo = 0;
static volatile uint8_t g_led_tx_ticks = 0U;
static volatile uint8_t g_led_rx_ticks = 0U;
static volatile uint8_t g_led_err_ticks = 0U;
static volatile uint8_t g_radio_busy = 0; static volatile uint8_t g_radio_busy = 0;
static volatile uint8_t g_radio_needs_rx_restart = 0; static volatile uint8_t g_radio_needs_rx_restart = 0;
@@ -116,6 +86,10 @@ static void OnTxTimeout(void);
static void OnRxTimeout(void); static void OnRxTimeout(void);
static void OnRxError(void); static void OnRxError(void);
static void App_LedTxPulse(void);
static void App_LedRxPulse(void);
static void App_LedErrPulse(void);
static void UartRxByteCallback(uint8_t *rxChar, uint16_t size, uint8_t error); static void UartRxByteCallback(uint8_t *rxChar, uint16_t size, uint8_t error);
static void App_ProcessRadioEvents(void); static void App_ProcessRadioEvents(void);
static void App_ProcessUartPacketizer(void); static void App_ProcessUartPacketizer(void);
@@ -145,6 +119,11 @@ static char *App_SkipSpaces(char *s);
void SubghzApp_Init(void) void SubghzApp_Init(void)
{ {
if (!Config_Load(&g_cfg))
{
Config_LoadDefaults(&g_cfg);
}
RadioEvents.TxDone = OnTxDone; RadioEvents.TxDone = OnTxDone;
RadioEvents.RxDone = OnRxDone; RadioEvents.RxDone = OnRxDone;
RadioEvents.TxTimeout = OnTxTimeout; RadioEvents.TxTimeout = OnTxTimeout;
@@ -152,9 +131,19 @@ void SubghzApp_Init(void)
RadioEvents.RxError = OnRxError; RadioEvents.RxError = OnRxError;
Radio.Init(&RadioEvents); Radio.Init(&RadioEvents);
App_RadioApplyConfig(); App_RadioApplyConfig();
App_ReconfigureUart(g_cfg.uart_baudrate);
App_RadioEnterRx(); App_RadioEnterRx();
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
g_led_tx_ticks = 0U;
g_led_rx_ticks = 0U;
g_led_err_ticks = 0U;
g_uart_last_data_tick = HAL_GetTick(); g_uart_last_data_tick = HAL_GetTick();
(void)vcom_ReceiveInit(UartRxByteCallback); (void)vcom_ReceiveInit(UartRxByteCallback);
@@ -185,6 +174,7 @@ static void App_ProcessRadioEvents(void)
{ {
g_radio_tx_timeout = 0U; g_radio_tx_timeout = 0U;
g_radio_busy = 0U; g_radio_busy = 0U;
App_LedErrPulse();
App_QueuePop(); App_QueuePop();
App_Printf("\r\n[WARN] radio tx timeout\r\n"); App_Printf("\r\n[WARN] radio tx timeout\r\n");
g_radio_needs_rx_restart = 1U; g_radio_needs_rx_restart = 1U;
@@ -193,6 +183,7 @@ static void App_ProcessRadioEvents(void)
if (g_radio_rx_done != 0U) if (g_radio_rx_done != 0U)
{ {
g_radio_rx_done = 0U; g_radio_rx_done = 0U;
App_LedRxPulse();
g_stat_radio_packets_rx++; g_stat_radio_packets_rx++;
g_stat_radio_bytes_rx += g_rx_payload_len; g_stat_radio_bytes_rx += g_rx_payload_len;
@@ -208,6 +199,7 @@ static void App_ProcessRadioEvents(void)
{ {
g_radio_rx_timeout = 0U; g_radio_rx_timeout = 0U;
g_radio_rx_error = 0U; g_radio_rx_error = 0U;
App_LedErrPulse();
g_radio_needs_rx_restart = 1U; g_radio_needs_rx_restart = 1U;
} }
@@ -273,8 +265,19 @@ static void App_StartNextTxIfPossible(void)
App_RadioConfigureTx(); App_RadioConfigureTx();
g_radio_busy = 1U; g_radio_busy = 1U;
App_LedTxPulse();
(void)Radio.Send(g_tx_queue[g_tx_q_head].data, g_tx_queue[g_tx_q_head].len); (void)Radio.Send(g_tx_queue[g_tx_q_head].data, g_tx_queue[g_tx_q_head].len);
} }
static void App_ApplyConfig(void)
{
App_RadioApplyConfig();
App_RadioConfigureRx();
App_RadioConfigureTx();
if (!Config_Save(&g_cfg)) {
App_Printf("Error while saving cnf\r\n");
}
}
static void App_RadioApplyConfig(void) static void App_RadioApplyConfig(void)
{ {
@@ -350,6 +353,13 @@ static void App_EnterConfigMode(void)
g_mode = APP_MODE_CONFIG; g_mode = APP_MODE_CONFIG;
App_Printf("\r\n\r\n[CONFIG MODE]\r\n"); App_Printf("\r\n\r\n[CONFIG MODE]\r\n");
App_Printf("type 'help' for commands\r\n"); App_Printf("type 'help' for commands\r\n");
if (!Config_Load(&g_cfg))
{
App_Printf("Error while loading cnf\r\n");
App_Printf("Cnf was reset to defaults\r\n");
Config_LoadDefaults(&g_cfg);
}
App_PrintConfigPrompt(); App_PrintConfigPrompt();
} }
@@ -555,20 +565,14 @@ static void App_ConfigExecuteLine(char *line)
App_ExitConfigMode(); App_ExitConfigMode();
return; return;
} }
if (strcmp(line, "save") == 0)
{
App_ApplyConfig();
return;
}
if (strcmp(line, "defaults") == 0) if (strcmp(line, "defaults") == 0)
{ {
g_cfg.rf_frequency = RF_FREQUENCY_DEFAULT; Config_LoadDefaults(&g_cfg);
g_cfg.tx_power = TX_OUTPUT_POWER_DEFAULT;
g_cfg.fsk_bitrate = FSK_DATARATE_DEFAULT;
g_cfg.fsk_bandwidth = FSK_BANDWIDTH_DEFAULT;
g_cfg.fsk_fdev = FSK_FDEV_DEFAULT;
g_cfg.fsk_preamble_len = FSK_PREAMBLE_LENGTH_DEFAULT;
g_cfg.syncword[0] = 0xC1U;
g_cfg.syncword[1] = 0x94U;
g_cfg.syncword[2] = 0xC1U;
g_cfg.uart_packet_timeout_ms = DEFAULT_UART_PACKET_TIMEOUT_MS;
App_RadioApplyConfig();
App_Printf("defaults restored\r\n"); App_Printf("defaults restored\r\n");
return; return;
} }
@@ -582,7 +586,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.rf_frequency = u32; g_cfg.rf_frequency = u32;
App_RadioApplyConfig();
App_Printf("freq=%lu\r\n", (unsigned long)g_cfg.rf_frequency); App_Printf("freq=%lu\r\n", (unsigned long)g_cfg.rf_frequency);
return; return;
} }
@@ -596,7 +599,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.tx_power = (int8_t)pwr; g_cfg.tx_power = (int8_t)pwr;
App_RadioApplyConfig();
App_Printf("power=%d\r\n", g_cfg.tx_power); App_Printf("power=%d\r\n", g_cfg.tx_power);
return; return;
} }
@@ -610,7 +612,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.fsk_bitrate = u32; g_cfg.fsk_bitrate = u32;
App_RadioApplyConfig();
App_Printf("bitrate=%lu\r\n", (unsigned long)g_cfg.fsk_bitrate); App_Printf("bitrate=%lu\r\n", (unsigned long)g_cfg.fsk_bitrate);
return; return;
} }
@@ -624,7 +625,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.fsk_bandwidth = u32; g_cfg.fsk_bandwidth = u32;
App_RadioApplyConfig();
App_Printf("bandwidth=%lu\r\n", (unsigned long)g_cfg.fsk_bandwidth); App_Printf("bandwidth=%lu\r\n", (unsigned long)g_cfg.fsk_bandwidth);
return; return;
} }
@@ -638,7 +638,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.fsk_fdev = u32; g_cfg.fsk_fdev = u32;
App_RadioApplyConfig();
App_Printf("fdev=%lu\r\n", (unsigned long)g_cfg.fsk_fdev); App_Printf("fdev=%lu\r\n", (unsigned long)g_cfg.fsk_fdev);
return; return;
} }
@@ -652,7 +651,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
g_cfg.fsk_preamble_len = (uint16_t)u32; g_cfg.fsk_preamble_len = (uint16_t)u32;
App_RadioApplyConfig();
App_Printf("preamble=%u\r\n", g_cfg.fsk_preamble_len); App_Printf("preamble=%u\r\n", g_cfg.fsk_preamble_len);
return; return;
} }
@@ -693,7 +691,6 @@ static void App_ConfigExecuteLine(char *line)
return; return;
} }
memcpy(g_cfg.syncword, sync, sizeof(sync)); memcpy(g_cfg.syncword, sync, sizeof(sync));
App_RadioApplyConfig();
App_Printf("sync=%02X%02X%02X\r\n", g_cfg.syncword[0], g_cfg.syncword[1], g_cfg.syncword[2]); App_Printf("sync=%02X%02X%02X\r\n", g_cfg.syncword[0], g_cfg.syncword[1], g_cfg.syncword[2]);
return; return;
} }
@@ -722,7 +719,8 @@ static void App_PrintHelp(void)
App_Printf(" preamble <bytes> - fsk preamble length\r\n"); App_Printf(" preamble <bytes> - fsk preamble length\r\n");
App_Printf(" sync <hex6> - 3-byte syncword, example C194C1\r\n"); App_Printf(" sync <hex6> - 3-byte syncword, example C194C1\r\n");
App_Printf(" timeout <ms> - uart silence before rf packet send\r\n"); App_Printf(" timeout <ms> - uart silence before rf packet send\r\n");
App_Printf(" uart <baud> - change uart baudrate immediately\r\n"); App_Printf(" uart <baud> - change uart baudrate\r\n");
App_Printf(" save - save and apply changes\r\n");
App_Printf(" defaults - restore default config\r\n"); App_Printf(" defaults - restore default config\r\n");
App_Printf(" exit - return to transparent bridge mode\r\n"); App_Printf(" exit - return to transparent bridge mode\r\n");
} }
@@ -864,6 +862,61 @@ static char *App_SkipSpaces(char *s)
} }
return s; return s;
} }
void SubghzApp_Timer1msIrq(void)
{
if (g_led_tx_ticks > 0U)
{
g_led_tx_ticks--;
if (g_led_tx_ticks == 0U)
{
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
}
}
if (g_led_rx_ticks > 0U)
{
g_led_rx_ticks--;
if (g_led_rx_ticks == 0U)
{
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
}
}
if (g_led_err_ticks > 0U)
{
g_led_err_ticks--;
if (g_led_err_ticks == 0U)
{
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
}
}
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if (htim->Instance == TIM2) // замени на свой таймер
{
SubghzApp_Timer1msIrq();
}
}
static void App_LedTxPulse(void)
{
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
g_led_tx_ticks = LED_PULSE_MS;
}
static void App_LedRxPulse(void)
{
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
g_led_rx_ticks = LED_PULSE_MS;
}
static void App_LedErrPulse(void)
{
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
g_led_err_ticks = LED_PULSE_MS;
}
static void OnTxDone(void) static void OnTxDone(void)
{ {

View File

@@ -7,18 +7,14 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#define RF_FREQUENCY_DEFAULT 433100000UL
#define TX_OUTPUT_POWER_DEFAULT 14
#define FSK_FDEV_DEFAULT 25000UL
#define FSK_DATARATE_DEFAULT 50000UL
#define FSK_BANDWIDTH_DEFAULT 50000UL
#define FSK_PREAMBLE_LENGTH_DEFAULT 4U
void SubghzApp_Init(void); void SubghzApp_Init(void);
void SubghzApp_Process(void); void SubghzApp_Process(void);
/* вызывать из IRQ таймера 1 раз в 1 мс */
void SubghzApp_Timer1msIrq(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SUBGHZ_PHY_APP_H__ */ #endif /* __SUBGHZ_PHY_APP_H__ */

88
suffix.launch Normal file
View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.cubeprog_external_loaders" value="[]"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth__pwd_enable" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_certif_path" value=""/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_check_enable" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_key_path" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_permission" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_pwd_file" value=""/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.incremental_flashing" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;Debug/suffix.elf&quot;,&quot;fProjectName&quot;:&quot;suffix&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.mode" value="0"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.port" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.semihosting" value="Disabled"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="48000000"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_signal_halt" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="/soft/stm32/projects/suffix/Debug/st-link_gdbserver_log.txt"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverPort" value="cortex_m0"/>
<intAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyPort" value="60000"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/suffix.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="suffix"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1194481459"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/suffix"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="process_factory_id" value="com.st.stm32cube.ide.mcu.debug.launch.HardwareDebugProcessFactory"/>
</launchConfiguration>