Porównaj commity

..

26 Commity
EB02 ... master

Autor SHA1 Wiadomość Data
Mateusz Lubecki bd209d630a nvm events, function to find oldest and newest event 2024-05-30 21:43:24 +02:00
Mateusz Lubecki a520b6913c nvm events, function to find oldest and newest event 2024-05-30 21:43:08 +02:00
Mateusz Lubecki 9a407cdbae nvm event logger and security access 2024-05-26 21:03:16 +02:00
Mateusz Lubecki 4db4883204 backport to ParaTNC 2024-05-26 08:05:56 +02:00
Mateusz Lubecki 168749a2c5 kiss_communication_transport refactor 2024-05-24 21:34:51 +02:00
Mateusz Lubecki 6a1ec93ab5 remapping application completely to make a room for bootloader. doubling vector table to 0x08000000 to be able to run app without flashed bootloader 2024-05-23 19:48:13 +02:00
Mateusz Lubecki 548c3fd649 remapping RTE to RAM2 2024-05-22 22:35:26 +02:00
Mateusz Lubecki df6195cdb9 increased stack size and refactoring main_gsm_pool_handler 2024-05-22 13:14:24 +02:00
Mateusz Lubecki cf7e3642b5 sending nrc when unknown service id has been requested across APRS message KISS encapsulation, sending REGISTER_RESET_CHECK_FAIL on login 2024-05-21 22:02:55 +02:00
Mateusz Lubecki 9235ac5894 first integration of kiss diagnostics across aprs message 2024-05-18 16:18:20 +02:00
Mateusz Lubecki f93c4e553e KISS diagnostics: decoding hex-encoded kiss request from aprs request and passing this to diagnotics engine 2024-05-17 22:21:37 +02:00
Mateusz Lubecki 6a0766e22c decoding and encoding kiss diagnostic messages as aprs messages 2024-05-07 21:26:13 +02:00
Mateusz Lubecki 73ab9cac33 storing message counter as a string of character to support situation when it may contain a string of character, not hex of dec base number 2024-05-05 20:07:14 +02:00
Mateusz Lubecki 012e2b3557 integrating aprs-is message decoder, sending ACK to messages, string to int converter for messages 2024-04-25 22:14:25 +02:00
Mateusz Lubecki 428f6a2360 aprs message decoding 2024-04-22 05:34:41 +02:00
Mateusz Lubecki 15829704be break windspeed validation check if it set to zero 2024-04-20 14:50:33 +02:00
Mateusz Lubecki 9b52612eec counting restarts caused by verification failure 2024-04-18 22:15:54 +02:00
Mateusz Lubecki d5614dbf53 watchdog reenabled 2024-04-15 18:29:58 +02:00
Mateusz Lubecki ef26fd94e7 bugfix in read DID response handler 2023-11-26 09:06:57 +01:00
Mateusz Lubecki f62de2051a internal watchdog enabled once again. bugfix in sending telemetry channel descritpions 2023-11-19 14:21:35 +01:00
SP8EBC 4ced3c5b39
Update README.md 2023-11-17 07:52:32 +01:00
Mateusz Lubecki 733dbfa13b dallas temperature sensor: different handling of measurement results depends on quality factor, set qf to degraded if temperature is below or above set treshold. removed modbus rtu status message completely 2023-11-17 06:57:30 +01:00
Mateusz Lubecki 654540fcf3 missing makefiles for subdirs 2023-11-16 22:54:16 +01:00
Mateusz Lubecki 228a64e5b7 stack analysis stuff 2023-11-16 22:48:31 +01:00
Mateusz Lubecki b642c3c540 kiss communication. did: bugfix in lengh of response, get_version: bugfix in overwriting first byte of a response 2023-11-12 11:09:11 +01:00
Mateusz Lubecki ee541a54dc kiss did: few bugfixes here and there. warninggit add * internal watchdig is disabledgit add *! 2023-11-05 22:28:38 +01:00
108 zmienionych plików z 4325 dodań i 465 usunięć

Wyświetl plik

@ -89,6 +89,7 @@
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef.1745924307" name="Undefined symbols (-U)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="PARAMETEO"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.172153996" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="-fstack-usage -fdump-rtl-dfinish" valueType="string"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.726748309" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.204317376" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
@ -112,6 +113,7 @@
<listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.otherwarnings.2014375249" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wunused-function" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other.1066008529" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other" value="-fstack-usage -fdump-rtl-dfinish" valueType="string"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.90169505" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.2078057424" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
@ -352,6 +354,7 @@
<listOptionValue builtIn="false" value="PARATNC_HWREV_B"/>
<listOptionValue builtIn="false" value="PARATNC_HWREV_C"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.994195951" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="-fstack-usage -fdump-rtl-dfinish" valueType="string"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.29354374" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1656265940" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
@ -415,7 +418,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.useprintffloat.1654419641" name="Use float with nano printf (-u _printf_float)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.useprintffloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref.1892757950" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnosys.1858899549" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnosys" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap.826060236" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap" value="false" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap.826060236" name="Print link map (-Xlinker --print-map)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printmap" value="false" valueType="boolean"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.1803255576" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
@ -493,7 +496,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.useprintffloat.1403039114" name="Use float with nano printf (-u _printf_float)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.useprintffloat" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.139846170" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnosys.1761390492" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnosys" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printmap.1092992084" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printmap" value="false" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printmap.1092992084" name="Print link map (-Xlinker --print-map)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printmap" value="false" valueType="boolean"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1243003593" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.233822233"/>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.2101502496" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.753718364"/>

Wyświetl plik

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="842559031985696342" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="805998401176637466" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="813754081161391399" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="819814870235430554" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

16
.vscode/c_cpp_properties.json vendored 100644
Wyświetl plik

@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": ["PARAMETEO", "STM32L471xx"],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}

28
.vscode/launch.json vendored 100644
Wyświetl plik

@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Debug STM32L476_ParaMETEO",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/STM32L476_ParaMETEO/ParaTNC.elf",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

12
.vscode/settings.json vendored 100644
Wyświetl plik

@ -0,0 +1,12 @@
{
"files.associations": {
"ax25_t.h": "c",
"*.tcc": "c",
"variant.h": "c",
"sim800c_tcpip.h": "c",
"rte_main.h": "c",
"config_data.h": "c",
"random": "c",
"message.h": "c"
}
}

35
.vscode/tasks.json vendored 100644
Wyświetl plik

@ -0,0 +1,35 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make STM32L476_ParaMETEO",
"type": "shell",
"command": "make",
"args": [
"all"
],
"options": {
"cwd": "${workspaceFolder}/STM32L476_ParaMETEO"
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "clean STM32L476_ParaMETEO",
"type": "shell",
"command": "make",
"args": [
"clean"
],
"options": {
"cwd": "${workspaceFolder}/STM32L476_ParaMETEO"
},
"problemMatcher": [
"$gcc"
]
}
]
}

Wyświetl plik

@ -218,6 +218,7 @@ This is done by invoking a command:
'sudo echo "options usb-storage quirks=483:3744:i" >> /etc/modprobe.d/stlink_v1.conf'
What will create a new file called 'stlink_v1.conf' in modprobe directory. After the system reboot changes should
be applied and the programmer should be free to go. The kernel log should looks somehow like this below
[90639.895886] usb 2-1.1: new full-speed USB device number 13 using ehci-pci
[90639.990288] usb 2-1.1: New USB device found, idVendor=0483, idProduct=3744
[90639.990294] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
@ -229,11 +230,59 @@ be applied and the programmer should be free to go. The kernel log should looks
The next step is to install texane-stlink which supports the ST-Link/V1 programmer and can be used to read an write
the flash memory. Installation is quite straight forward
'git clone git://github.com/texane/stlink.git'
'cd stlink.git'
'make'
'cd build/Relase'
'sudo cp st-* /usr/bin'
'git clone git://github.com/texane/stlink.git'
'cd stlink.git'
'make'
'cd build/Relase'
'sudo cp st-* /usr/bin'
At the end the HEX file can be loaded into the microcontroler by typing a command
'sudo st-flash --format ihex write /dev/sr0 ParaTNC.hex'
'sudo st-flash --format ihex write /dev/sr0 ParaTNC.hex'
#### LOADING THE HEX FILE INTO ParaTNC or ParaMETEO TARGET USING STLINK/V2
mateusz@mateusz-ThinkCentre-M720q:~/Documents/___STM32/ParaTNC/STM32L476_ParaMETEO$ st-flash erase
st-flash 1.7.0-120-gbeffed4
/usr/local/stlink/chips: No such file or directory
2023-11-17T07:43:18 INFO common.c: L47x/L48x: 96 KiB SRAM, 1024 KiB flash in at least 2 KiB pages.
Mass erasing
and then programming itself
mateusz@mateusz-ThinkCentre-M720q:~/Documents/___STM32/ParaTNC/STM32L476_ParaMETEO$ st-flash --format ihex write ParaTNC.hex
st-flash 1.7.0-120-gbeffed4
/usr/local/stlink/chips: No such file or directory
2023-11-17T07:44:47 INFO common.c: L47x/L48x: 96 KiB SRAM, 1024 KiB flash in at least 2 KiB pages.
2023-11-17T07:44:47 INFO common.c: Attempting to write 111504 (0x1b390) bytes to stm32 address: 134217728 (0x8000000)
2023-11-17T07:44:48 INFO common.c: Finished erasing 55 pages of 2048 (0x800) bytes
2023-11-17T07:44:48 INFO common.c: Starting Flash write for F2/F4/F7/L4
2023-11-17T07:44:48 INFO flash_loader.c: Successfully loaded flash loader in sram
2023-11-17T07:44:48 INFO flash_loader.c: Clear DFSR
2023-11-17T07:44:48 INFO flash_loader.c: Clear CFSR
2023-11-17T07:44:48 INFO flash_loader.c: Clear HFSR
2023-11-17T07:44:51 INFO common.c: Starting verification of write complete
2023-11-17T07:44:52 INFO common.c: Flash written and verified! jolly good!
#### LOADING THE HEX FILE INTO ParaTNC or ParaMETEO TARGET USING ROM BOOTLOADER AND STM32FLASH software
Examples:
Get device information:
stm32flash /dev/ttyS0
or:
stm32flash /dev/i2c-0
Write with verify and then start execution:
stm32flash -w filename -v -g 0x0 /dev/ttyS0
Read flash to file:
stm32flash -r filename /dev/ttyS0
Read 100 bytes of flash from 0x1000 to stdout:
stm32flash -r - -S 0x1000:100 /dev/ttyS0
Start execution:
stm32flash -g 0x0 /dev/ttyS0

Wyświetl plik

@ -8,9 +8,11 @@ C_SRCS += \
../src/PathConfig.c \
../src/TimerConfig.c \
../src/_write.c \
../src/backup_registers.c \
../src/button_paratnc.c \
../src/delay.c \
../src/dummy.c \
../src/event_log.c \
../src/io.c \
../src/it_handlers.c \
../src/main.c \
@ -21,6 +23,7 @@ C_SRCS += \
../src/rte_rtu.c \
../src/rte_wx.c \
../src/software_version.c \
../src/variant_parameteo.c \
../src/wx_handler.c \
../src/wx_handler_humidity.c \
../src/wx_handler_pressure.c \
@ -32,9 +35,11 @@ OBJS += \
./src/PathConfig.o \
./src/TimerConfig.o \
./src/_write.o \
./src/backup_registers.o \
./src/button_paratnc.o \
./src/delay.o \
./src/dummy.o \
./src/event_log.o \
./src/io.o \
./src/it_handlers.o \
./src/main.o \
@ -45,6 +50,7 @@ OBJS += \
./src/rte_rtu.o \
./src/rte_wx.o \
./src/software_version.o \
./src/variant_parameteo.o \
./src/wx_handler.o \
./src/wx_handler_humidity.o \
./src/wx_handler_pressure.o \
@ -56,9 +62,11 @@ C_DEPS += \
./src/PathConfig.d \
./src/TimerConfig.d \
./src/_write.d \
./src/backup_registers.d \
./src/button_paratnc.d \
./src/delay.d \
./src/dummy.d \
./src/event_log.d \
./src/io.d \
./src/it_handlers.d \
./src/main.d \
@ -69,6 +77,7 @@ C_DEPS += \
./src/rte_rtu.d \
./src/rte_wx.d \
./src/software_version.d \
./src/variant_parameteo.d \
./src/wx_handler.d \
./src/wx_handler_humidity.d \
./src/wx_handler_pressure.d \
@ -80,7 +89,7 @@ C_DEPS += \
src/%.o: ../src/%.c src/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -12,6 +12,7 @@ C_SRCS += \
../system/src/aprs/crc.c \
../system/src/aprs/dac.c \
../system/src/aprs/digi.c \
../system/src/aprs/message.c \
../system/src/aprs/status.c \
../system/src/aprs/telemetry.c \
../system/src/aprs/wx.c
@ -25,6 +26,7 @@ OBJS += \
./system/src/aprs/crc.o \
./system/src/aprs/dac.o \
./system/src/aprs/digi.o \
./system/src/aprs/message.o \
./system/src/aprs/status.o \
./system/src/aprs/telemetry.o \
./system/src/aprs/wx.o
@ -38,6 +40,7 @@ C_DEPS += \
./system/src/aprs/crc.d \
./system/src/aprs/dac.d \
./system/src/aprs/digi.d \
./system/src/aprs/message.d \
./system/src/aprs/status.d \
./system/src/aprs/telemetry.d \
./system/src/aprs/wx.d
@ -47,7 +50,7 @@ C_DEPS += \
system/src/aprs/%.o: ../system/src/aprs/%.c system/src/aprs/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -20,7 +20,7 @@ C_DEPS += \
system/src/cmsis/%.o: ../system/src/cmsis/%.c system/src/cmsis/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -23,7 +23,7 @@ C_DEPS += \
system/src/cortexm/%.o: ../system/src/cortexm/%.c system/src/cortexm/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -20,7 +20,7 @@ C_DEPS += \
system/src/davis_vantage/%.o: ../system/src/davis_vantage/%.c system/src/davis_vantage/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -20,7 +20,7 @@ C_DEPS += \
system/src/diag/%.o: ../system/src/diag/%.c system/src/diag/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -26,7 +26,7 @@ C_DEPS += \
system/src/drivers/f1/%.o: ../system/src/drivers/f1/%.c system/src/drivers/f1/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -29,7 +29,7 @@ C_DEPS += \
system/src/drivers/%.o: ../system/src/drivers/%.c system/src/drivers/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -26,7 +26,7 @@ C_DEPS += \
system/src/modbus_rtu/%.o: ../system/src/modbus_rtu/%.c system/src/modbus_rtu/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -36,14 +36,14 @@ CPP_DEPS += \
system/src/newlib/%.o: ../system/src/newlib/%.cpp system/src/newlib/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C++ Compiler'
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../include/etc" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -Wunused-function -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../include/etc" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -Wunused-function -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
system/src/newlib/%.o: ../system/src/newlib/%.c system/src/newlib/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -53,7 +53,7 @@ C_DEPS += \
system/src/stm32f1-stdperiph/%.o: ../system/src/stm32f1-stdperiph/%.c system/src/stm32f1-stdperiph/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -26,7 +26,7 @@ C_DEPS += \
system/src/umb_master/%.o: ../system/src/umb_master/%.c system/src/umb_master/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -17,7 +17,7 @@ C_DEPS += \
system/src/ve_direct_protocol/%.o: ../system/src/ve_direct_protocol/%.c system/src/ve_direct_protocol/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DPARATNC -DTRACE -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -UPARAMETEO -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,430 @@
# pylint: disable = invalid-name, too-few-public-methods
import re
import pprint
import os
import sys
from typing import List, Tuple, Dict, Any
from subprocess import check_output
# Constants
rtl_ext_end = ".dfinish"
su_ext = '.su'
obj_ext = '.o'
manual_ext = '.msu'
read_elf_path = os.getenv("CROSS_COMPILE", "") + "readelf"
stdout_encoding = "utf-8" # System dependant
class Printable:
def __repr__(self) -> str:
return "<" + type(self).__name__ + "> " + pprint.pformat(vars(self), indent=4, width=1)
class Symbol(Printable):
# value: int = -1
# size: int = -1
type: str = "uninitialized"
binding: str = "uninitialized"
name: str = "uninitialized"
CallNode = Dict[str, Any]
def calc_wcs(fxn_dict2: CallNode, parents: List[CallNode]) -> None:
"""
Calculates the worst case stack for a fxn that is declared (or called from) in a given file.
:param parents: This function gets called recursively through the call graph. If a function has recursion the
tuple file, fxn will be in the parents stack and everything between the top of the stack and the matching entry
has recursion.
:return:
"""
# If the wcs is already known, then nothing to do
if 'wcs' in fxn_dict2:
return
# Check for pointer calls
if fxn_dict2['has_ptr_call']:
fxn_dict2['wcs'] = 'unbounded'
return
# Check for recursion
if fxn_dict2 in parents:
fxn_dict2['wcs'] = 'unbounded'
return
# Calculate WCS
call_max = 0
for call_dict in fxn_dict2['r_calls']:
# Calculate the WCS for the called function
calc_wcs(call_dict, parents + [fxn_dict2])
# If the called function is unbounded, so is this function
if call_dict['wcs'] == 'unbounded':
fxn_dict2['wcs'] = 'unbounded'
return
# Keep track of the call with the largest stack use
call_max = max(call_max, call_dict['wcs'])
# Propagate Unresolved Calls
for unresolved_call in call_dict['unresolved_calls']:
fxn_dict2['unresolved_calls'].add(unresolved_call)
fxn_dict2['wcs'] = call_max + fxn_dict2['local_stack']
class CallGraph:
globals: Dict[str, CallNode] = {}
locals: Dict[str, Dict[str, CallNode]] = {}
weak: Dict[str, CallNode] = {}
def read_obj(self, tu: str) -> None:
"""
Reads the file tu.o and gets the binding (global or local) for each function
:param self: a object used to store information about each function, results go here
:param tu: name of the translation unit (e.g. for main.c, this would be 'main')
"""
for s in read_symbols(tu[0:tu.rindex(".")] + obj_ext):
if s.type == 'FUNC':
if s.binding == 'GLOBAL':
# Check for multiple declarations
if s.name in self.globals or s.name in self.locals:
raise Exception(f'Multiple declarations of {s.name}')
self.globals[s.name] = {'tu': tu, 'name': s.name, 'binding': s.binding}
elif s.binding == 'LOCAL':
# Check for multiple declarations
if s.name in self.locals and tu in self.locals[s.name]:
raise Exception(f'Multiple declarations of {s.name}')
if s.name not in self.locals:
self.locals[s.name] = {}
self.locals[s.name][tu] = {'tu': tu, 'name': s.name, 'binding': s.binding}
elif s.binding == 'WEAK':
if s.name in self.weak:
raise Exception(f'Multiple declarations of {s.name}')
self.weak[s.name] = {'tu': tu, 'name': s.name, 'binding': s.binding}
else:
raise Exception(f'Error Unknown Binding "{s.binding}" for symbol: {s.name}')
def find_fxn(self, tu: str, fxn: str):
"""
Looks up the dictionary associated with the function.
:param self: a object used to store information about each function
:param tu: The translation unit in which to look for locals functions
:param fxn: The function name
:return: the dictionary for the given function or None
"""
if fxn in self.globals:
return self.globals[fxn]
try:
return self.locals[fxn][tu]
except KeyError:
return None
def find_demangled_fxn(self, tu: str, fxn: str):
"""
Looks up the dictionary associated with the function.
:param self: a object used to store information about each function
:param tu: The translation unit in which to look for locals functions
:param fxn: The function name
:return: the dictionary for the given function or None
"""
for f in self.globals.values():
if 'demangledName' in f:
if f['demangledName'] == fxn:
return f
for f in self.locals.values():
if tu in f:
if 'demangledName' in f[tu]:
if f[tu]['demangledName'] == fxn:
return f[tu]
return None
def read_rtl(self, tu: str, rtl_ext: str) -> None:
"""
Read an RTL file and finds callees for each function and if there are calls via function pointer.
:param self: a object used to store information about each function, results go here
:param tu: the translation unit
"""
# Construct A Call Graph
function = re.compile(r'^;; Function (.*) \((\S+), funcdef_no=\d+(, [a-z_]+=\d+)*\)( \([a-z ]+\))?$')
static_call = re.compile(r'^.*\(call.*"(.*)".*$')
other_call = re.compile(r'^.*call .*$')
with open(tu + rtl_ext, "rt", encoding="latin_1") as file_:
for line_ in file_:
m = function.match(line_)
if m:
fxn_name = m.group(2)
fxn_dict2 = self.find_fxn(tu, fxn_name)
if not fxn_dict2:
pprint.pprint(self)
raise Exception(f"Error locating function {fxn_name} in {tu}")
fxn_dict2['demangledName'] = m.group(1)
fxn_dict2['calls'] = set()
fxn_dict2['has_ptr_call'] = False
continue
m = static_call.match(line_)
if m:
fxn_dict2['calls'].add(m.group(1))
# print("Call: {0} -> {1}".format(current_fxn, m.group(1)))
continue
m = other_call.match(line_)
if m:
fxn_dict2['has_ptr_call'] = True
continue
def read_su(self, tu: str) -> None:
"""
Reads the 'local_stack' for each function. Local stack ignores stack used by callees.
:param self: a object used to store information about each function, results go here
:param tu: the translation unit
:return:
"""
# Needs to be able to handle both cases, i.e.:
# c:\\userlibs\\gcc\\arm-none-eabi\\include\\assert.h:41:6:__assert_func 16 static
# main.c:113:6:vAssertCalled 8 static
# Now Matches six groups https://regex101.com/r/Imi0sq/1
su_line = re.compile(r'^(.+):(\d+):(\d+):(.+)\t(\d+)\t(\S+)$')
i = 1
with open(tu[0:tu.rindex(".")] + su_ext, "rt", encoding="latin_1") as file_:
for line in file_:
m = su_line.match(line)
if m:
fxn = m.group(4)
fxn_dict2 = self.find_demangled_fxn(tu, fxn)
fxn_dict2['local_stack'] = int(m.group(5))
else:
print(f"error parsing line {i} in file {tu}")
i += 1
def read_manual(self, file: str) -> None:
"""
reads the manual stack useage files.
:param self: a object used to store information about each function, results go here
:param file: the file name
"""
with open(file, "rt", encoding="latin_1") as file_:
for line in file_:
fxn, stack_sz = line.split()
if fxn in self.globals:
raise Exception(f"Redeclared Function {fxn}")
self.globals[fxn] = {'wcs': int(stack_sz),
'calls': set(),
'has_ptr_call': False,
'local_stack': int(stack_sz),
'is_manual': True,
'name': fxn,
'demangledName': fxn,
'tu': '#MANUAL',
'binding': 'GLOBAL'}
def validate_all_data(self) -> None:
"""
Check that every entry in the call graph has the following fields:
.calls, .has_ptr_call, .local_stack, .scope, .src_line
"""
def validate_dict(d):
if not ('calls' in d and 'has_ptr_call' in d and 'local_stack' in d
and 'name' in d and 'tu' in d):
print(f"Error data is missing in fxn dictionary {d}")
# Loop through every global and local function
# and resolve each call, save results in r_calls
for fxn_dict2 in self.globals.values():
validate_dict(fxn_dict2)
for l_dict in self.locals.values():
for fxn_dict2 in l_dict.values():
validate_dict(fxn_dict2)
def resolve_all_calls(self) -> None:
def resolve_calls(fxn_dict2: CallNode) -> None:
fxn_dict2['r_calls'] = []
fxn_dict2['unresolved_calls'] = set()
for call in fxn_dict2['calls']:
call_dict = self.find_fxn(fxn_dict2['tu'], call)
if call_dict:
fxn_dict2['r_calls'].append(call_dict)
else:
fxn_dict2['unresolved_calls'].add(call)
# Loop through every global and local function
# and resolve each call, save results in r_calls
for fxn_dict in self.globals.values():
resolve_calls(fxn_dict)
for l_dict in self.locals.values():
for fxn_dict in l_dict.values():
resolve_calls(fxn_dict)
def calc_all_wcs(self) -> None:
# Loop through every global and local function
# and resolve each call, save results in r_calls
for fxn_dict in self.globals.values():
calc_wcs(fxn_dict, [])
for l_dict in self.locals.values():
for fxn_dict in l_dict.values():
calc_wcs(fxn_dict, [])
def print_all_fxns(self) -> None:
def print_fxn(row_format: str, fxn_dict2: CallNode) -> None:
unresolved = fxn_dict2['unresolved_calls']
stack = str(fxn_dict2['wcs'])
if unresolved:
unresolved_str = f"({' ,'.join(unresolved)})"
if stack != 'unbounded':
stack = "unbounded:" + stack
else:
unresolved_str = ''
print(row_format.format(fxn_dict2['tu'], fxn_dict2['demangledName'], stack, unresolved_str))
def get_order(val) -> int:
return 1 if val == 'unbounded' else -val
# Loop through every global and local function
# and resolve each call, save results in r_calls
d_list = []
for fxn_dict in self.globals.values():
d_list.append(fxn_dict)
for l_dict in self.locals.values():
for fxn_dict in l_dict.values():
d_list.append(fxn_dict)
d_list.sort(key=lambda item: get_order(item['wcs']))
# Calculate table width
tu_width = max(max(len(d['tu']) for d in d_list), 16)
name_width = max(max(len(d['name']) for d in d_list), 13)
row_format = "{:<" + str(tu_width + 2) + "} {:<" + str(name_width + 2) + "} {:>14} {:<17}"
# Print out the table
print("")
print(row_format.format('Translation Unit', 'Function Name', 'Stack', 'Unresolved Dependencies'))
for d in d_list:
print_fxn(row_format, d)
def read_symbols(file: str) -> List[Symbol]:
def to_symbol(read_elf_line: str) -> Symbol:
v = read_elf_line.split()
s2 = Symbol()
# s2.value = int(v[1], 16)
# if ('x' in v[2]):
# #raise Exception(f'Mixed symbol sizes in \'{v}\' ')
# s2.size=int(v[2].split('x')[1],16)
# else:
# s2.size = int(v[2])
s2.type = v[3]
s2.binding = v[4]
s2.name = v[7] if len(v) >= 8 else ""
return s2
output = check_output([read_elf_path, "-s", "-W", file]).decode(stdout_encoding)
lines = output.splitlines()[3:]
return [to_symbol(line) for line in lines]
def find_rtl_ext() -> str:
# Find the rtl_extension
for _, _, filenames in os.walk('.'):
for f in filenames:
if f.endswith(rtl_ext_end):
rtl_ext = f[f[:-len(rtl_ext_end)].rindex("."):]
print("rtl_ext = " + rtl_ext)
return rtl_ext
print("Could not find any files ending with '.dfinish'. Check that the script is being run from the correct "
"directory. Check that the code was compiled with the correct flags")
sys.exit(-1)
def find_files(rtl_ext: str) -> Tuple[List[str], List[str]]:
tu: List[str] = []
manual: List[str] = []
all_files: List[str] = []
for root, _, filenames in os.walk('.'):
for filename in filenames:
all_files.append(os.path.join(root, filename))
for f in [f for f in all_files if os.path.isfile(f) and f.endswith(rtl_ext)]:
base = f[0:-len(rtl_ext)]
short_base = base[0:base.rindex(".")]
if short_base + su_ext in all_files and short_base + obj_ext in all_files:
tu.append(base)
print(f'Reading: {base}{rtl_ext}, {short_base}{su_ext}, {short_base}{obj_ext}')
for f in [f for f in all_files if os.path.isfile(f) and f.endswith(manual_ext)]:
manual.append(f)
print(f'Reading: {f}')
# Print some diagnostic messages
if not tu:
print("Could not find any translation units to analyse")
sys.exit(-1)
return tu, manual
def main() -> None:
# Find the appropriate RTL extension
rtl_ext = find_rtl_ext()
# Find all input files
call_graph: CallGraph = CallGraph()
tu_list, manual_list = find_files(rtl_ext)
# Read the input files
for tu in tu_list:
call_graph.read_obj(tu) # This must be first
for fxn in call_graph.weak.values():
if fxn['name'] not in call_graph.globals:
call_graph.globals[fxn['name']] = fxn
for tu in tu_list:
call_graph.read_rtl(tu, rtl_ext)
for tu in tu_list:
call_graph.read_su(tu)
# Read manual files
for m in manual_list:
call_graph.read_manual(m)
# Validate Data
call_graph.validate_all_data()
# Resolve All Function Calls
call_graph.resolve_all_calls()
# Calculate Worst Case Stack For Each Function
call_graph.calc_all_wcs()
# Print A Nice Message With Each Function and the WCS
call_graph.print_all_fxns()
main()

Wyświetl plik

@ -0,0 +1,251 @@
#!/usr/bin/perl -w
# avstack.pl: AVR stack checker
# Copyright (C) 2013 Daniel Beer <dlbeer@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# Usage
# -----
#
# This script requires that you compile your code with -fstack-usage.
# This results in GCC generating a .su file for each .o file. Once you
# have these, do:
#
# ./avstack.pl <object files>
#
# This will disassemble .o files to construct a call graph, and read
# frame size information from .su. The call graph is traced to find, for
# each function:
#
# - Call height: the maximum call height of any callee, plus 1
# (defined to be 1 for any function which has no callees).
#
# - Inherited frame: the maximum *inherited* frame of any callee, plus
# the GCC-calculated frame size of the function in question.
#
# Using these two pieces of information, we calculate a cost (estimated
# peak stack usage) for calling the function. Functions are then listed
# on stdout in decreasing order of cost.
#
# Functions which are recursive are marked with an 'R' to the left of
# them. Their cost is calculated for a single level of recursion.
#
# The peak stack usage of your entire program can usually be estimated
# as the stack cost of "main", plus the maximum stack cost of any
# interrupt handler which might execute.
use strict;
# Configuration: set these as appropriate for your architecture/project.
my $objdump = "/usr/local/bin/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-objdump";
my $call_cost = 32;
# First, we need to read all object and corresponding .su files. We're
# gathering a mapping of functions to callees and functions to frame
# sizes. We're just parsing at this stage -- callee name resolution
# comes later.
my %frame_size; # "func@file" -> size
my %call_graph; # "func@file" -> {callees}
my %addresses; # "addr@file" -> "func@file"
my %global_name; # "func" -> "func@file"
my %ambiguous; # "func" -> 1
foreach (@ARGV) {
# Disassemble this object file to obtain a callees. Sources in the
# call graph are named "func@file". Targets in the call graph are
# named either "offset@file" or "funcname". We also keep a list of
# the addresses and names of each function we encounter.
my $objfile = $_;
my $source;
open(DISASSEMBLY, "$objdump -dr $objfile|") ||
die "Can't disassemble $objfile";
while (<DISASSEMBLY>) {
chomp;
if (/^([0-9a-fA-F]+) <(.*)>:/) {
my $a = $1;
my $name = $2;
$source = "$name\@$objfile";
$call_graph{$source} = {};
$ambiguous{$name} = 1 if defined($global_name{$name});
$global_name{$name} = "$name\@$objfile";
$a =~ s/^0*//;
$addresses{"$a\@$objfile"} = "$name\@$objfile";
}
if (/: R_[A-Za-z0-9_]+_CALL[ \t]+(.*)/) {
my $t = $1;
if ($t eq ".text") {
$t = "\@$objfile";
} elsif ($t =~ /^\.text\+0x(.*)$/) {
$t = "$1\@$objfile";
}
$call_graph{$source}->{$t} = 1;
}
}
close(DISASSEMBLY);
# Extract frame sizes from the corresponding .su file.
if ($objfile =~ /^(.*).o$/) {
my $sufile = "$1.su";
open(SUFILE, "<$sufile") || die "Can't open $sufile";
while (<SUFILE>) {
$frame_size{"$1\@$objfile"} = $2 + $call_cost
if /^.*:([^\t ]+)[ \t]+([0-9]+)/;
}
close(SUFILE);
}
}
# In this step, we enumerate each list of callees in the call graph and
# try to resolve the symbols. We omit ones we can't resolve, but keep a
# set of them anyway.
my %unresolved;
foreach (keys %call_graph) {
my $from = $_;
my $callees = $call_graph{$from};
my %resolved;
foreach (keys %$callees) {
my $t = $_;
if (defined($addresses{$t})) {
$resolved{$addresses{$t}} = 1;
} elsif (defined($global_name{$t})) {
$resolved{$global_name{$t}} = 1;
warn "Ambiguous resolution: $t" if defined ($ambiguous{$t});
} elsif (defined($call_graph{$t})) {
$resolved{$t} = 1;
} else {
$unresolved{$t} = 1;
}
}
$call_graph{$from} = \%resolved;
}
# Create fake edges and nodes to account for dynamic behaviour.
$call_graph{"INTERRUPT"} = {};
foreach (keys %call_graph) {
$call_graph{"INTERRUPT"}->{$_} = 1 if /^__vector_/;
}
# Trace the call graph and calculate, for each function:
#
# - inherited frames: maximum inherited frame of callees, plus own
# frame size.
# - height: maximum height of callees, plus one.
# - recursion: is the function called recursively (including indirect
# recursion)?
my %has_caller;
my %visited;
my %total_cost;
my %call_depth;
sub trace {
my $f = shift;
if ($visited{$f}) {
$visited{$f} = "R" if $visited{$f} eq "?";
return;
}
$visited{$f} = "?";
my $max_depth = 0;
my $max_frame = 0;
my $targets = $call_graph{$f} || die "Unknown function: $f";
if (defined($targets)) {
foreach (keys %$targets) {
my $t = $_;
$has_caller{$t} = 1;
trace($t);
my $is = $total_cost{$t};
my $d = $call_depth{$t};
$max_frame = $is if $is > $max_frame;
$max_depth = $d if $d > $max_depth;
}
}
$call_depth{$f} = $max_depth + 1;
$total_cost{$f} = $max_frame + ($frame_size{$f} || 0);
$visited{$f} = " " if $visited{$f} eq "?";
}
foreach (keys %call_graph) { trace $_; }
# Now, print results in a nice table.
printf " %-30s %8s %8s %8s\n",
"Func", "Cost", "Frame", "Height";
print "------------------------------------";
print "------------------------------------\n";
my $max_iv = 0;
my $main = 0;
foreach (sort { $total_cost{$b} <=> $total_cost{$a} } keys %visited) {
my $name = $_;
if (/^(.*)@(.*)$/) {
$name = $1 unless $ambiguous{$name};
}
my $tag = $visited{$_};
my $cost = $total_cost{$_};
$name = $_ if $ambiguous{$name};
$tag = ">" unless $has_caller{$_};
if (/^__vector_/) {
$max_iv = $cost if $cost > $max_iv;
} elsif (/^main@/) {
$main = $cost;
}
if ($ambiguous{$name}) { $name = $_; }
printf "%s %-30s %8d %8d %8d\n", $tag, $name, $cost,
$frame_size{$_} || 0, $call_depth{$_};
}
print "\n";
print "Peak execution estimate (main + worst-case IV):\n";
printf " main = %d, worst IV = %d, total = %d\n",
$total_cost{$global_name{"main"}},
$total_cost{"INTERRUPT"},
$total_cost{$global_name{"main"}} + $total_cost{"INTERRUPT"};
print "\n";
print "The following functions were not resolved:\n";
foreach (keys %unresolved) { print " $_\n"; }

Wyświetl plik

@ -0,0 +1,16 @@
#!/bin/bash
rm __stackanalysis/*
#cp WCS.py __stackanalysis/WCS.py
cp avstack.pl __stackanalysis/avstack.pl
find . -maxdepth 5 -type f -name "*.su" -exec bash -c 'filename=$(basename -- {}); echo $filename; cp {} __stackanalysis/$filename' \;
find . -maxdepth 5 -type f -name "*.dfinish" -exec bash -c 'filename=$(basename -- {}); echo $filename; cp {} __stackanalysis/$filename' \;
find . -maxdepth 5 -type f -name "*.o" -exec bash -c 'filename=$(basename -- {}); echo $filename; cp {} __stackanalysis/$filename' \;
cd ./__stackanalysis/
rm startup_stm32l471xx.*
perl avstack.pl *.o > ../stack_analysis.report
#python3.10 WCS.py

Wyświetl plik

@ -0,0 +1,33 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/configuration_nvm/config_data_default.c \
../src/configuration_nvm/config_data_first.c \
../src/configuration_nvm/config_data_second.c \
../src/configuration_nvm/configuration_handler.c
OBJS += \
./src/configuration_nvm/config_data_default.o \
./src/configuration_nvm/config_data_first.o \
./src/configuration_nvm/config_data_second.o \
./src/configuration_nvm/configuration_handler.o
C_DEPS += \
./src/configuration_nvm/config_data_default.d \
./src/configuration_nvm/config_data_first.d \
./src/configuration_nvm/config_data_second.d \
./src/configuration_nvm/configuration_handler.d
# Each subdirectory must supply rules for building sources it contributes
src/configuration_nvm/%.o: ../src/configuration_nvm/%.c src/configuration_nvm/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,39 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/kiss_protocol/kiss_callback.c \
../src/kiss_protocol/kiss_communication.c \
../src/kiss_protocol/kiss_communication_aprsmsg.c \
../src/kiss_protocol/kiss_did.c \
../src/kiss_protocol/kiss_nrc_response.c \
../src/kiss_protocol/kiss_security_access.c
OBJS += \
./src/kiss_protocol/kiss_callback.o \
./src/kiss_protocol/kiss_communication.o \
./src/kiss_protocol/kiss_communication_aprsmsg.o \
./src/kiss_protocol/kiss_did.o \
./src/kiss_protocol/kiss_nrc_response.o \
./src/kiss_protocol/kiss_security_access.o
C_DEPS += \
./src/kiss_protocol/kiss_callback.d \
./src/kiss_protocol/kiss_communication.d \
./src/kiss_protocol/kiss_communication_aprsmsg.d \
./src/kiss_protocol/kiss_did.d \
./src/kiss_protocol/kiss_nrc_response.d \
./src/kiss_protocol/kiss_security_access.d
# Each subdirectory must supply rules for building sources it contributes
src/kiss_protocol/%.o: ../src/kiss_protocol/%.c src/kiss_protocol/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,33 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/stored_configuration_nvm/config_data_default.c \
../src/stored_configuration_nvm/config_data_first.c \
../src/stored_configuration_nvm/config_data_second.c \
../src/stored_configuration_nvm/configuration_handler.c
OBJS += \
./src/stored_configuration_nvm/config_data_default.o \
./src/stored_configuration_nvm/config_data_first.o \
./src/stored_configuration_nvm/config_data_second.o \
./src/stored_configuration_nvm/configuration_handler.o
C_DEPS += \
./src/stored_configuration_nvm/config_data_default.d \
./src/stored_configuration_nvm/config_data_first.d \
./src/stored_configuration_nvm/config_data_second.d \
./src/stored_configuration_nvm/configuration_handler.d
# Each subdirectory must supply rules for building sources it contributes
src/stored_configuration_nvm/%.o: ../src/stored_configuration_nvm/%.c src/stored_configuration_nvm/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -14,6 +14,7 @@ C_SRCS += \
../src/button_parameteo.c \
../src/delay.c \
../src/dummy.c \
../src/event_log.c \
../src/io.c \
../src/it_handlers.c \
../src/main.c \
@ -44,6 +45,7 @@ OBJS += \
./src/button_parameteo.o \
./src/delay.o \
./src/dummy.o \
./src/event_log.o \
./src/io.o \
./src/it_handlers.o \
./src/main.o \
@ -74,6 +76,7 @@ C_DEPS += \
./src/button_parameteo.d \
./src/delay.d \
./src/dummy.d \
./src/event_log.d \
./src/io.d \
./src/it_handlers.d \
./src/main.d \
@ -98,7 +101,7 @@ C_DEPS += \
src/%.o: ../src/%.c src/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -12,6 +12,7 @@ C_SRCS += \
../system/src/aprs/crc.c \
../system/src/aprs/dac.c \
../system/src/aprs/digi.c \
../system/src/aprs/message.c \
../system/src/aprs/status.c \
../system/src/aprs/telemetry.c \
../system/src/aprs/wx.c
@ -25,6 +26,7 @@ OBJS += \
./system/src/aprs/crc.o \
./system/src/aprs/dac.o \
./system/src/aprs/digi.o \
./system/src/aprs/message.o \
./system/src/aprs/status.o \
./system/src/aprs/telemetry.o \
./system/src/aprs/wx.o
@ -38,6 +40,7 @@ C_DEPS += \
./system/src/aprs/crc.d \
./system/src/aprs/dac.d \
./system/src/aprs/digi.d \
./system/src/aprs/message.d \
./system/src/aprs/status.d \
./system/src/aprs/telemetry.d \
./system/src/aprs/wx.d
@ -47,7 +50,7 @@ C_DEPS += \
system/src/aprs/%.o: ../system/src/aprs/%.c system/src/aprs/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -34,7 +34,7 @@ system/src/cmsis/stm32l4xx/%.o: ../system/src/cmsis/stm32l4xx/%.S system/src/cms
system/src/cmsis/stm32l4xx/%.o: ../system/src/cmsis/stm32l4xx/%.c system/src/cmsis/stm32l4xx/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -20,7 +20,7 @@ C_DEPS += \
system/src/davis_vantage/%.o: ../system/src/davis_vantage/%.c system/src/davis_vantage/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -20,7 +20,7 @@ C_DEPS += \
system/src/diag/%.o: ../system/src/diag/%.c system/src/diag/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -29,7 +29,7 @@ C_DEPS += \
system/src/drivers/l4/%.o: ../system/src/drivers/l4/%.c system/src/drivers/l4/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -32,7 +32,7 @@ C_DEPS += \
system/src/drivers/%.o: ../system/src/drivers/%.c system/src/drivers/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,24 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/dust_sensor/sds011.c
OBJS += \
./system/src/dust_sensor/sds011.o
C_DEPS += \
./system/src/dust_sensor/sds011.d
# Each subdirectory must supply rules for building sources it contributes
system/src/dust_sensor/%.o: ../system/src/dust_sensor/%.c system/src/dust_sensor/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,33 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/fatfs/diskio.c \
../system/src/fatfs/ff.c \
../system/src/fatfs/ffsystem.c \
../system/src/fatfs/ffunicode.c
OBJS += \
./system/src/fatfs/diskio.o \
./system/src/fatfs/ff.o \
./system/src/fatfs/ffsystem.o \
./system/src/fatfs/ffunicode.o
C_DEPS += \
./system/src/fatfs/diskio.d \
./system/src/fatfs/ff.d \
./system/src/fatfs/ffsystem.d \
./system/src/fatfs/ffunicode.d
# Each subdirectory must supply rules for building sources it contributes
system/src/fatfs/%.o: ../system/src/fatfs/%.c system/src/fatfs/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,36 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/gsm/sim800c.c \
../system/src/gsm/sim800c_engineering.c \
../system/src/gsm/sim800c_gprs.c \
../system/src/gsm/sim800c_poolers.c \
../system/src/gsm/sim800c_tcpip.c
OBJS += \
./system/src/gsm/sim800c.o \
./system/src/gsm/sim800c_engineering.o \
./system/src/gsm/sim800c_gprs.o \
./system/src/gsm/sim800c_poolers.o \
./system/src/gsm/sim800c_tcpip.o
C_DEPS += \
./system/src/gsm/sim800c.d \
./system/src/gsm/sim800c_engineering.d \
./system/src/gsm/sim800c_gprs.d \
./system/src/gsm/sim800c_poolers.d \
./system/src/gsm/sim800c_tcpip.d
# Each subdirectory must supply rules for building sources it contributes
system/src/gsm/%.o: ../system/src/gsm/%.c system/src/gsm/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,30 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/http_client/http_client.c \
../system/src/http_client/http_client_headers.c \
../system/src/http_client/http_client_rx_callback.c
OBJS += \
./system/src/http_client/http_client.o \
./system/src/http_client/http_client_headers.o \
./system/src/http_client/http_client_rx_callback.o
C_DEPS += \
./system/src/http_client/http_client.d \
./system/src/http_client/http_client_headers.d \
./system/src/http_client/http_client_rx_callback.d
# Each subdirectory must supply rules for building sources it contributes
system/src/http_client/%.o: ../system/src/http_client/%.c system/src/http_client/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -26,7 +26,7 @@ C_DEPS += \
system/src/modbus_rtu/%.o: ../system/src/modbus_rtu/%.c system/src/modbus_rtu/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -329,7 +329,7 @@ C_DEPS += \
system/src/stm32l4-hal-driver/%.o: ../system/src/stm32l4-hal-driver/%.c system/src/stm32l4-hal-driver/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,33 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/crc_.c \
../system/src/float_average.c \
../system/src/float_to_string.c \
../system/src/int_average.c
OBJS += \
./system/src/crc_.o \
./system/src/float_average.o \
./system/src/float_to_string.o \
./system/src/int_average.o
C_DEPS += \
./system/src/crc_.d \
./system/src/float_average.d \
./system/src/float_to_string.d \
./system/src/int_average.d
# Each subdirectory must supply rules for building sources it contributes
system/src/%.o: ../system/src/%.c system/src/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -0,0 +1,24 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../system/src/tiny-aes/aes.c
OBJS += \
./system/src/tiny-aes/aes.o
C_DEPS += \
./system/src/tiny-aes/aes.d
# Each subdirectory must supply rules for building sources it contributes
system/src/tiny-aes/%.o: ../system/src/tiny-aes/%.c system/src/tiny-aes/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -26,7 +26,7 @@ C_DEPS += \
system/src/umb_master/%.o: ../system/src/umb_master/%.c system/src/umb_master/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -17,7 +17,7 @@ C_DEPS += \
system/src/ve_direct_protocol/%.o: ../system/src/ve_direct_protocol/%.c system/src/ve_direct_protocol/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/configuration_nvm" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -fstack-usage -fdump-rtl-dfinish -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Wyświetl plik

@ -57,7 +57,7 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;IWDG&quot;/&gt;&#10; &lt;peripheral name=&quot;DBGMCU&quot;/&gt;&#10; &lt;peripheral name=&quot;USART3&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#10; &lt;memoryBlockExpression address=&quot;0&quot; label=&quot;rte_wx_wind_qf&quot;/&gt;&#10;&lt;/memoryBlockExpressionList&gt;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;IWDG&quot;/&gt;&#10; &lt;peripheral name=&quot;DBGMCU&quot;/&gt;&#10; &lt;peripheral name=&quot;RTC&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

Wyświetl plik

@ -17,7 +17,7 @@
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="/usr/bin/openocd"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f interface/stlink-v2.cfg -f target/stm32f1x.cfg"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
@ -51,6 +51,7 @@
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="ParaTNC"/>
<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="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ParaTNC"/>
</listAttribute>

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -13,6 +13,7 @@
#include "gsm/sim800c_tcpip.h"
#include "ax25.h"
#include "telemetry.h"
#include "message.h"
typedef enum aprsis_return {
@ -50,7 +51,7 @@ void aprsis_init(
aprsis_return_t aprsis_connect_and_login(const char * address, uint8_t address_ln, uint16_t port, uint8_t auto_send_beacon);
aprsis_return_t aprsis_connect_and_login_default(uint8_t auto_send_beacon);
sim800_return_t aprsis_disconnect(void);
void aprsis_receive_callback(srl_context_t* srl_context);
//void aprsis_receive_callback(srl_context_t* srl_context);
void aprsis_check_alive(void);
int aprsis_check_connection_attempt_alive(void);
@ -96,11 +97,16 @@ telemetry_description_t aprsis_send_description_telemetry(uint8_t async,
const char * callsign_with_ssid);
void aprsis_igate_to_aprsis(AX25Msg *msg, const char * callsign_with_ssid);
void aprsis_send_server_conn_status(const char * callsign_with_ssid);
void aprsis_send_server_comm_counters(const char * callsign_with_ssid);
void aprsis_send_loginstring(const char * callsign_with_ssid, uint8_t rtc_ok, uint16_t voltage);
void aprsis_send_gpsstatus(const char * callsign_with_ssid);
void aprsis_send_gsm_status(const char * callsign_with_ssid);
void aprsis_send_ack_for_message(const message_t * const message);
void aprsis_send_any_string_buffer(const char * const message, const uint16_t ln);
#ifdef UNIT_TEST
char * aprsis_get_tx_buffer(void);
#endif
uint8_t aprsis_get_aprsis_logged(void);
void aprsis_debug_set_simulate_timeout(void);

Wyświetl plik

@ -41,9 +41,22 @@ inline void backup_reg_set_monitor(int8_t bit) {
}
inline uint32_t backup_reg_get_monitor(void) {
#ifdef STM32L471xx
return REGISTER_MONITOR;
#else
return 0;
#endif
}
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_WX (1U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_BEACON (1U << 1U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_TELEMETRY (1U << 2U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_DESCR (1U << 3U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_IGATE (1U << 4U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_CNTRS (1U << 5U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_LOGINSTRING (1U << 6U)
#define BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_OTHER (1U << 7U)
uint32_t backup_reg_get_configuration(void);
void backup_reg_set_configuration(uint32_t value);
void backup_reg_set_bits_configuration(uint32_t value);
@ -81,6 +94,16 @@ void backup_reg_set_telemetry(uint16_t);
void backup_reg_get_packet_counters(uint8_t * beacon_counter, uint8_t * meteo_counter, uint8_t * meteo_gsm_counter);
void backup_reg_set_packet_counters(uint8_t beacon_counter, uint8_t meteo_counter, uint8_t meteo_gsm_counter);
void backup_reg_increment_aprsis_check_reset(void);
void backup_reg_increment_weather_measurements_check_reset(void);
void backup_reg_increment_dallas_degraded_reset(void);
void backup_reg_increment_is_rtc_ok_check_reset(void);
uint32_t backup_reg_get_register_reset_check_fail(void);
void backup_assert(uint32_t assert);
uint32_t backup_reg_get_last_restart_date(void);
void backup_reg_set_last_restart_date(void);
#endif /* BACKUP_REGISTERS_H_ */

Wyświetl plik

@ -25,10 +25,6 @@
* $WIZ$ type = "int"
* $WIZ$ min = 1
*/
#include <stdint.h>
//extern uint8_t kiss_txdelay;
//#define CONFIG_AFSK_PREAMBLE_LEN (kiss_txdelay*10UL)
#define CONFIG_AFSK_PREAMBLE_LEN 400UL /// 300
/**
@ -36,8 +32,6 @@
* $WIZ$ type = "int"
* $WIZ$ min = 1
*/
//extern uint8_t kiss_txtail;
//#define CONFIG_AFSK_TRAILER_LEN (kiss_txtail*10UL)
#define CONFIG_AFSK_TRAILER_LEN 50UL

Wyświetl plik

@ -0,0 +1,23 @@
/*
* dallas_temperature_limits.h
*
* Created on: Nov 16, 2023
* Author: mateusz
*/
#ifndef ETC_DALLAS_TEMPERATURE_LIMITS_H_
#define ETC_DALLAS_TEMPERATURE_LIMITS_H_
#define DALLAS_TEMPERATURE_LIMITS_LOW -32.0f
#define DALLAS_TEMPERATURE_LIMITS_HI 64.0f
#define DALLAS_TEMPERATURE_NEG_SLEW -16
#define DALLAS_TEMPERATURE_POS_SLEW 16
#define DALLAS_MAX_LIMIT_OF_DEGRADED 64U
#endif /* ETC_DALLAS_TEMPERATURE_LIMITS_H_ */

Wyświetl plik

@ -19,12 +19,13 @@
#ifndef KISS_DID_CONFIGURATION_H_
#define KISS_DID_CONFIGURATION_H_
#include "./kiss_communication/kiss_xmacro_helpers.h"
#include "kiss_communication/types/kiss_xmacro_helpers.h"
#include "rte_main.h"
#include "rte_wx.h"
#include "main_master_time.h"
#include "main.h"
#include "rte_main.h"
#include "gsm/sim800c.h"
#include "packet_tx_handler.h"
#include "software_version.h"
//!< Dummy variable used only as end of definition marker in tables
@ -37,12 +38,14 @@ extern char did_dummy_data;
ENTRY(0x1501U, gsm_sim800_simcard_status_string) \
ENTRY(0x1502U, gsm_sim800_cellid) \
ENTRY(0x1503U, gsm_sim800_lac) \
ENTRY(0x5555U, main_test_string) \
#define DIDS_FLOAT(ENTRY) \
ENTRY(0x2000U, rte_wx_temperature_average_external_valid, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2001U, rte_wx_temperature_internal_valid, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2002U, rte_wx_pressure_history[0], rte_wx_pressure_history[1], rte_wx_pressure_history[2]) \
ENTRY(0x1505U, gsm_sim800_signal_level_dbm, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2222U, main_test_float, DID_EMPTY, DID_EMPTY) \
#define DIDS_NUMERIC(ENTRY) \
ENTRY(0x1000U, master_time, DID_EMPTY, DID_EMPTY) \
@ -57,6 +60,8 @@ extern char did_dummy_data;
ENTRY(0x2006U, rte_wx_winddirection[0], rte_wx_winddirection[1], rte_wx_winddirection[2]) \
ENTRY(0x2007U, rte_wx_humidity, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2008U, rte_wx_humidity, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2200U, packet_tx_beacon_counter, packet_tx_meteo_counter, packet_tx_telemetry_counter) \
ENTRY(0x2201U, packet_tx_beacon_interval, packet_tx_meteo_interval, packet_tx_telemetry_interval) \
ENTRY(0x1504U, gsm_sim800_signal_level_dbm, DID_EMPTY, DID_EMPTY) \
ENTRY(0xFFFFU, did_dummy_data, did_dummy_data, did_dummy_data)
#endif
@ -72,6 +77,18 @@ extern char did_dummy_data;
ENTRY(0x2002U, rte_wx_pressure_history[0], rte_wx_pressure_history[1], rte_wx_pressure_history[2]) \
#define DIDS_NUMERIC(ENTRY) \
ENTRY(0x1000U, master_time, DID_EMPTY, DID_EMPTY) \
ENTRY(0x1001U, rx10m, DID_EMPTY, DID_EMPTY) \
ENTRY(0x1002U, tx10m, DID_EMPTY, DID_EMPTY) \
ENTRY(0x1003U, digi10m, DID_EMPTY, DID_EMPTY) \
ENTRY(0x1004U, digidrop10m, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2004U, rte_wx_average_winddirection, rte_wx_average_windspeed, rte_wx_max_windspeed) \
ENTRY(0x2005U, rte_wx_windspeed[0], rte_wx_windspeed[1], rte_wx_windspeed[2]) \
ENTRY(0x2006U, rte_wx_winddirection[0], rte_wx_winddirection[1], rte_wx_winddirection[2]) \
ENTRY(0x2007U, rte_wx_humidity, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2008U, rte_wx_humidity, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2200U, packet_tx_beacon_counter, packet_tx_meteo_counter, packet_tx_telemetry_counter) \
ENTRY(0x2201U, packet_tx_beacon_interval, packet_tx_meteo_interval, packet_tx_telemetry_interval) \
ENTRY(0xFFFFU, did_dummy_data, did_dummy_data, did_dummy_data) \
#endif

Wyświetl plik

@ -0,0 +1,17 @@
/*
* misc_config.h
* Misc configuration which doesn't match to any other place
*
*
* Created on: Apr 15, 2024
* Author: mateusz
*/
#ifndef ETC_MISC_CONFIG_H_
#define ETC_MISC_CONFIG_H_
#define RTE_WX_PROBLEMS_MAX_THRESHOLD 10
#endif /* ETC_MISC_CONFIG_H_ */

Wyświetl plik

@ -0,0 +1,86 @@
/*
* event_log.h
*
* Created on: May 26, 2024
* Author: mateusz
*/
#ifndef EVENT_LOG_H_
#define EVENT_LOG_H_
#include "stdint.h"
#define EVENT_LOG_GET_SEVERITY(x) ((x & 0xF0) >> 4)
#define EVENT_LOG_GET_SOURCE(x) (x & 0x0F)
#define EVENT_LOG_TIMESYNC_BOOTUP_WPARAM (0x01U)
/**
* TYpe used to distinguish between event of different severity
*/
typedef enum event_log_severity_t {
EVENT_BOOTUP, /**< EVENT_BOOTUP all info events generated during bootup */
EVENT_TIMESYNC,/**< EVENT_TIMESYNC event generated once at startup and then every 6 hours to keep master_time and RTC date and time sync */
EVENT_DEBUG, /**< EVENT_DEBUG */
EVENT_INFO, /**< EVENT_INFO */
EVENT_WARNING, /**< EVENT_WARNING */
EVENT_ERROR, /**< EVENT_ERROR */
EVENT_ASSERT /**< EVENT_ASSERT assert failure, which result in hard reset*/
}event_log_severity_t;
/**
* Where this long entry was generated
*/
typedef enum event_log_source_t {
EVENT_SRC_MAIN, /**< EVENT_SRC_MAIN everywhere within main.c source file */
EVENT_SRC_WX_HANDLER, /**< EVENT_SRC_WX_HANDLER */
EVENT_SRC_PWR_SAVE, /**< EVENT_SRC_PWR_SAVE */
EVENT_SRC_PACKET_TX_HANDLER,/**< EVENT_SRC_PACKET_TX_HANDLER */
EVENT_SRC_APRSIS, /**< EVENT_SRC_APRSIS */
EVENT_SRC_KISS, /**< EVENT_SRC_KISS */
EVENT_SRC_APRS_RF, /**< EVENT_SRC_APRS_RF */
EVENT_SRC_GSM_GPRS, /**< EVENT_SRC_GSM_GPRS */
EVENT_SRC_TCPIP, /**< EVENT_SRC_TCPIP */
EVENT_SRC_HTTP_CLIENT, /**< EVENT_SRC_HTTP_CLIENT */
EVENT_SRC_MODBUS, /**< EVENT_SRC_MODBUS */
EVENT_SRC_UMB, /**< EVENT_SRC_UMB */
EVENT_SRC_DRV_ANEMOMETER, /**< EVENT_SRC_DRV_ANEMOMETER */
EVENT_SRC_DRV_I2C, /**< EVENT_SRC_DRV_I2C */
EVENT_SRC_DRV_UART, /**< EVENT_SRC_DRV_UART */
EVENT_SRC_DRV_SPI, /**< EVENT_SRC_DRV_SPI */
}event_log_source_t;
/**
* Structure used to store single system event in RAM2 area and Flash
* non volatile storage
*/
typedef struct __attribute__((aligned(1))) event_log_t {
uint32_t event_master_time; //!< value of maser time at the moment an event is generated
uint8_t severity_and_source; //!< high nibble -> severity level, low nibble -> source
uint8_t event_id; //!< event id, unique across different sources & severity level
uint16_t wparam; //!< Optional 2-byte data, specific per event
uint32_t lparam; //!< Optional 4-byte data, specific per event
uint32_t lparam2;
}event_log_t;
/**
* Initialies eveything log related
*/
void event_log_init(uint8_t flash_enabled_severity, uint8_t ram_enabled_severity);
/**
* Stores new event in RAM2_NOINIT area. It might trigger asynchronous
* @param severity
* @param source
* @param wparam
* @param lparam
* @param lparam2
*/
void event_log(event_log_severity_t severity, event_log_source_t source, uint16_t wparam, uint32_t lparam, uint32_t lparam2);
void event_log_sync(event_log_severity_t severity, event_log_source_t source, uint16_t wparam, uint32_t lparam, uint32_t lparam2);
#endif /* EVENT_LOG_H_ */

Wyświetl plik

@ -25,6 +25,10 @@
#define NONSTANDARD (uint8_t)0x0F
#define KISS_COMM_RESULT_MISSING_PREFIX -1
#define KISS_COMM_RESULT_WRONG_POINTER -2
#define KISS_COMM_RESULT_INPUT_TOO_LONG -3
#define KISS_COMM_RESULT_UNKNOWN_DIAG_SERV -4
extern uint8_t kiss_current_async_message;

Wyświetl plik

@ -0,0 +1,43 @@
/*
* kiss_communication_aprsmsg.h
*
* Created on: May 5, 2024
* Author: mateusz
*/
#ifndef KISS_COMMUNICATION_KISS_COMMUNICATION_APRSMSG_H_
#define KISS_COMMUNICATION_KISS_COMMUNICATION_APRSMSG_H_
#include <stdint.h>
#include "kiss_communication/types/kiss_communication_transport_t.h"
/**
*
* @param message_payload
* @param message_payload_ln
* @return
*/
kiss_communication_transport_t kiss_communication_aprsmsg_check_type(uint8_t * message_payload, uint16_t message_payload_ln);
/**
*
* @param message_payload pointer to characters buffer with APRS text message, containing encoded UDS diag request
* @param message_payload_ln length of buffer pointed by message_payload. processing will be done until first non-hex character (non 0-9 / a-f) or this length
* @param output_binary_buffer pointer to binary buffer where decoded data will be copied to.
* @param output_ln
* @return length of decoded UDS request or zero if message_payload doesn't contain valid hexstring with UDS request
*/
uint16_t kiss_communication_aprsmsg_decode_hexstring(uint8_t * message_payload, uint16_t message_payload_ln, uint8_t * output_binary_buffer, uint16_t output_ln);
/**
*
* @param input_binary_buffer
* @param input_ln
* @param output_message
* @param output_message_max_ln
* @return
*/
uint16_t kiss_communication_aprsmsg_encode_hexstring(uint8_t * input_binary_buffer, uint16_t input_ln, uint8_t * output_message, uint16_t output_message_max_ln);
#endif /* KISS_COMMUNICATION_KISS_COMMUNICATION_APRSMSG_H_ */

Wyświetl plik

@ -0,0 +1,31 @@
/*
* kiss_security_access.h
*
* Created on: May 23, 2024
* Author: mateusz
*/
#ifndef KISS_COMMUNICATION_KISS_SECURITY_ACCESS_H_
#define KISS_COMMUNICATION_KISS_SECURITY_ACCESS_H_
#include <stored_configuration_nvm/config_data.h>
#include "kiss_communication/types/kiss_communication_transport_t.h"
/**
* Initializes security acees subsystem with current configuration
* @param config
*/
void kiss_security_access_init(config_data_basic_t * config);
/**
* Checks if given diagnostics service ID, received through given transport media could be
* currently used as-is or it required security access to be unlocked.
* @param service_id identyfier as specified in kiss_communication_service_ids.h
* @param transport_media how this request was received
* @param lparam optional, per service specific parameter used for verification.
* @return
*/
uint8_t kiss_security_check_service_req_unlocking(uint8_t service_id, kiss_communication_transport_t transport_media, uint32_t lparam);
#endif /* KISS_COMMUNICATION_KISS_SECURITY_ACCESS_H_ */

Wyświetl plik

@ -48,5 +48,8 @@
#define KISS_RETURN_IDLE 1
#define KISS_RESET_HARD (uint8_t) 0x01
#define KISS_RESET_SOFT (uint8_t) 0x03
#define KISS_RESET_CONFIG (uint8_t) 0xAA
#endif /* KISS_COMMUNICATION_SERVICE_IDS_H_ */

Wyświetl plik

@ -0,0 +1,90 @@
/*
* kiss_communication_transport_t.h
*
* Created on: May 23, 2024
* Author: mateusz
*/
#ifndef KISS_COMMUNICATION_KISS_COMMUNICATION_TRANSPORT_T_H_
#define KISS_COMMUNICATION_KISS_COMMUNICATION_TRANSPORT_T_H_
typedef enum kiss_communication_aprsmsg_transport_t {
/**
* Transport KISS diagnostic messages as plain unencrypted hex-string
* which looks like
* HSxxxxxxxxxxxxxxxxxxxxxxxxx
* Where 'HS' is a prefix and all 'x' are binary data. Because of
* size limit of message content lenght, which is 67 characters,
* this payload can have no more than 32 bytes. Each byte is
* encoded in two characters + 'HS' prefix
*/
KISS_TRANSPORT_HEXSTRING,
/**
* Transport KISS diagnostic messages, encrypted using AES128 cipher
* in ECB mode and then put into message as a hex string. It looks
* like that
* Pyyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
* Where 'P' is contant prefix. 'yy' is a two-character salt to protect
* agains problems with electronic codebook mode. The rest of 'x' is exactly
* 62 characters, what resembles:
* - 58 hexstring characters / 29 bytes of KISS diagnostic message,
* - 4 hextring characters / 2 bytes of the salt (two characters)
*
* An example:
* 06FF1122334455000000000000000000000000000000000000000000006D6E - clear message in binary
* - 06FF11223344550000000 (...) - KISS message padded with zeros to 58 characters / 29 bytes
* - 6D6E - four characters / 2 bytes of salt
*
* da1044bfccd776eb8b717ec3f945a4b799616a3bf4bf5ba08ba1f2d39301e5f0 - encrypted with AES128-ECB
*
* Pmnda1044bfccd776eb8b717ec3f945a4b799616a3bf4bf5ba08ba1f2d39301e5f0 - encrypted & transported
* - P - constant prefix
* - 'mn' - two characters of salt
* - 'da1044bf (...)' ebcrypted message
*
* Internally the controller holds salt value from last UDS request in RTC backup register as a 16bit word.
* Each request is checked and a salt value cannot be smaller than the previous one, the check is done by
* 'converting' two character into one uint16_t value in way presented below"
* 'mn' - 'm' 0x6D, 'n' 0x6E => 0x6D6E
* Value of the salt could be reverted only if it is bigger than 0x7A00 ('~' as a first char), but it may
* be reverted only if 0x2100 < new_salt_value < 0x2200. In another words: reverted salt must have '!'
* as a first character.
*
* Because UDS requests and responses are transmitted as APRS text message salt must contain only printable
* characters (of course except tab and space)
*
* Responses generated by the controller also contains salt, which is
*
*
*/
KISS_TRANSPORT_ENCRYPTED_HEXSTRING,
KISS_TRANSPORT_SERIAL_PORT,
/**
* Just an echo request
*/
KISS_TRANSPORT_ECHO,
/**
* Unallowed salt value
*/
KISS_TRANSPORT_ERROR_SALT,
/**
* Transport type is known to the application, but it is not implemented yet.
*/
KISS_TRANSPORT_ERROR_UNSUPPORTED,
KISS_TRANSPORT_NOT_KISS,
KISS_TRANSPORT_UNINITIALIZED
} kiss_communication_transport_t;
#endif /* KISS_COMMUNICATION_KISS_COMMUNICATION_TRANSPORT_T_H_ */

Wyświetl plik

@ -44,7 +44,7 @@
{ \
.identifier = id, \
.first_data = (void*)string_pointer, \
.first_data_size = 0, \
.first_data_size = sizeof(string_pointer), \
.second_data = (void*)0xDEADBEEFu, \
.second_data_size = 0, \
.third_data = (void*)0xDEADBEEFu, \

Wyświetl plik

@ -16,7 +16,7 @@
#define SYSTICK_TICKS_PERIOD 10
#define INTERNAL_WATCHDOG
#define EXTERNAL_WATCHDOG
//#define EXTERNAL_WATCHDOG
#define PWR_SWITCH_BOTH
@ -73,6 +73,10 @@ extern uint8_t main_woken_up;
extern int8_t main_cpu_load;
extern const float main_test_float;
extern const char main_test_string[11];
extern char after_tx_lock;
extern unsigned short rx10m, tx10m, digi10m, digidrop10m, kiss10m;

Wyświetl plik

@ -0,0 +1,39 @@
/*
* memory_map.h
*
* Created on: May 26, 2024
* Author: mateusz
*/
#ifndef MEMORY_MAP_H_
#define MEMORY_MAP_H_
#define MEMORY_MAP_BOOTLOADER_START 0x08000800
#define MEMORY_MAP_BOOLOADER_END 0x0800BFFF
#define MEMORY_MAP_APPLICATION_START 0x0800C000
#define MEMORY_MAP_APPLICATION_END 0x0803C7FF
#define MEMORY_MAP_CONFIG_SECTION_FIRST_START 0x0803F000
#define MEMORY_MAP_CONFIG_SECTION_FIRST_END 0x0803F7FF
#define MEMORY_MAP_CONFIG_SECTION_SECOND_START 0x0803F800
#define MEMORY_MAP_CONFIG_SECTION_SECOND_END 0x0803FFFF
#define MEMORY_MAP_CONFIG_SECTION_DEFAULT_START 0x08040000
#define MEMORY_MAP_CONFIG_SECTION_DEFAULT_END 0x080407FF
#define MEMORY_MAP_CONFIG_END 0x080407FF
#define MEMORY_MAP_MEASUREMENT_512K_START 0x08041000
#define MEMORY_MAP_MEASUREMENT_1M_START 0x08080000
#define MEMORY_MAP_MEASUREMENT_512K_PAGES 48
#define MEMORY_MAP_MEASUREMENT_1M_PAGES 96
#define MEMORY_MAP_EVENT_LOG_START 0x0805A800
#define MEMORY_MAP_EVENT_LOG_END 0x0807AFFF
#define MEMORY_MAP_FLASH_END FLASH_BANK1_END
#endif /* MEMORY_MAP_H_ */

Wyświetl plik

@ -9,6 +9,7 @@
#define NVM_H_
#include <stdint.h>
#include "event_log.h"
#define NVM_RECORD_SIZE 8 // in bytes!!
@ -50,8 +51,29 @@ typedef enum nvm_state_result_t {
NVM_PGM_ERROR
}nvm_state_result_t;
/**
*
*/
void nvm_measurement_init(void);
/**
*
* @param data
* @return
*/
nvm_state_result_t nvm_measurement_store(nvm_measurement_t * data);
/**
*
* @param oldest
* @param newest
*/
void nvm_event_log_find_first_oldest_newest(event_log_t** oldest, event_log_t** newest);
/**
*
*/
void nvm_erase_all(void);
void nvm_test_prefill(void); ///<! Only for test purposes!

Wyświetl plik

@ -10,6 +10,27 @@
#include <stored_configuration_nvm/config_data.h>
extern uint8_t packet_tx_beacon_interval;
extern uint8_t packet_tx_beacon_counter;
extern uint8_t packet_tx_error_status_interval;
extern uint8_t packet_tx_error_status_counter;
extern uint8_t packet_tx_meteo_interval;
extern uint8_t packet_tx_meteo_counter;
extern uint8_t packet_tx_meteo_kiss_interval;
extern uint8_t packet_tx_meteo_kiss_counter;
extern uint8_t packet_tx_telemetry_interval;
extern uint8_t packet_tx_telemetry_counter;
extern uint8_t packet_tx_telemetry_descr_interval; // 155
extern uint8_t packet_tx_telemetry_descr_counter;
extern uint8_t packet_tx_modbus_raw_values;
extern uint8_t packet_tx_modbus_status;
typedef struct packet_tx_counter_values_t {
uint8_t beacon_counter;

Wyświetl plik

@ -4,6 +4,7 @@
#include <stdint.h>
#include "stored_configuration_nvm/config_data.h"
#include "message.h"
//!< Set immediately after waking up in RTC interrupt handler
#define RTE_MAIN_WOKEN_UP_RTC_INTERRUPT 1u
@ -14,7 +15,16 @@
//!< Set after everything was reinitialized from
#define RTE_MAIN_WOKEN_UP_EXITED 4u
extern uint8_t rte_main_trigger_gsm_status_packet;
extern message_t rte_main_received_message;
extern message_t rte_main_message_for_transmitting;
//!< Trigger preparing and sending ACK
extern uint8_t rte_main_trigger_message_ack;
extern uint8_t rte_main_trigger_send_message;
extern uint8_t rte_main_trigger_gsm_aprsis_counters_packet;
extern uint8_t rte_main_trigger_gsm_loginstring_packet;
@ -22,7 +32,7 @@ extern uint8_t rte_main_trigger_gsm_telemetry_values;
extern uint8_t rte_main_trigger_gsm_telemetry_descriptions;
extern uint8_t rte_main_trigger_gsm_status_gsm;
extern uint8_t rte_main_trigger_gsm_status;
//!< Trigger some reinitialization after waking up from deep sleep
extern uint8_t rte_main_woken_up;
@ -33,7 +43,6 @@ extern uint8_t rte_main_boot_cycles, rte_main_hard_faults;
extern uint32_t rte_main_hardfault_lr, rte_main_hardfault_pc;
extern uint8_t rte_main_trigger_status;
extern uint8_t rte_main_trigger_modbus_status;
extern uint8_t rte_main_trigger_wx_packet;

Wyświetl plik

@ -81,6 +81,7 @@ extern ms5611_qf_t rte_wx_ms5611_qf;
extern bme280_qf_t rte_wx_bme280_qf;
extern analog_wind_qf_t rte_wx_wind_qf;
extern uint8_t rte_wx_humidity_available;
extern uint8_t rte_wx_dallas_degraded_counter;
extern umb_frame_t rte_wx_umb;
@ -103,6 +104,7 @@ extern "C"
void rte_wx_init(void);
void rte_wx_update_last_measuremenet_timers(uint16_t measurement_type);
void rte_wx_reset_last_measuremenet_timers(uint16_t measurement_type);
int8_t rte_wx_check_weather_measurements(void);
#ifdef __cplusplus

Wyświetl plik

@ -8,8 +8,8 @@
#ifndef SOFTWARE_VERSION_H_
#define SOFTWARE_VERSION_H_
#define SW_VER "EB02"
#define SW_DATE "31102023"
#define SW_VER "ECXX"
#define SW_DATE "24052024"
#define SW_KISS_PROTO "B"
extern const char software_version_str[5];

Wyświetl plik

@ -199,19 +199,45 @@ typedef struct __attribute__((aligned (4))) config_data_basic_t {
#define CONFIGURATION_SEC_MEDIUM_KISS 4U
/**
* Configuration of how UDS diagnostics are secured access different
* mediums. GET_VERSION_AND_ID and SECURITY_ACCESS are never locked
* mediums. GET_VERSION_AND_ID and SECURITY_ACCESS are never locked.
* If the service shall not(!!) be locked respective bit should be set to 0.
* By default, when memory is fully erased everything is locked
*
* READ_DID and READ_MEMORY
* bit 1 - APRSIS
* bit 2 - RF network communication
* bit 3 - KISS serial port communication
* Serial Port
* 0 - Read DID
* 1 - Read Memory by address (RAM2, RAM2_NOINIT, everything > FLASH)
* 2 - Read Memory by address (without limit)
* 3 - Restart Reset
* 4 - Configuration reset
* 5 - Write memory by address
* 6 - Erase and program startup config
* 7 - Get running config
* 8 - Request file transfer and transfer data
*
* everything else
* bit 4 - APRSIS
* bit 5 - RF network communication
* bit 6 - KISS serial port communication
* 13 -
*
* Validity bits
* 14
* 15
* these bits are sum of ( (uds_diagnostics_security_access & 0x3FFF) +
* (uds_diagnostics_security_access & 3FFF0000) >> 16) & 0x3. If this value
* doesn't match a configuration from here is discarded completely and
* default settings are applied:
* 1. Everything over serial port is unlocked
* 2. Read DID and one restart per day
*
* APRS Message (Radio network or APRS-IS server)
*
* 16 -
* 17 -
*
* 29 -
*
* Unlock all services by default when accessed via APRSMSG_TRANSPORT_ENCRYPTED_HEXSTRING
* 30 - this should be zero to enable
* 31 - this should be one to enable
*/
uint8_t uds_diagnostics_security_access;
uint32_t uds_diagnostics_security_access;
} config_data_basic_t;

Wyświetl plik

@ -9,7 +9,7 @@
#define CONFIGURATION_HANDLER_H_
#include <stdint.h>
#include "kiss_communication/kiss_communication_nrc_t.h"
#include "kiss_communication/types/kiss_communication_nrc_t.h"
typedef enum configuration_handler_region_t {

Wyświetl plik

@ -10,8 +10,9 @@
#include "stdint.h"
int variant_validate_is_within_ram(uint32_t address);
int variant_validate_is_within_ram(void * address);
int variant_validate_is_within_sram2(void * address);
int variant_validate_is_within_flash(void * address);
int variant_validate_is_within_flash_logger_events(void * address);
#endif /* VARIANT_H_ */

Wyświetl plik

@ -18,7 +18,7 @@ _estack = __stack; /* STM specific definition */
* for the different modes.
*/
__Main_Stack_Size = 512 ;
__Main_Stack_Size = 768;
PROVIDE ( _Main_Stack_Size = __Main_Stack_Size ) ;

Wyświetl plik

@ -55,15 +55,17 @@ ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20018000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
_Min_Heap_Size = 0xC00; /* required amount of heap -> 3KB */
_Min_Stack_Size = 0xC00; /* required amount of stack -> 3KB */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
RAM2_NOINIT (xrw) : ORIGIN = 0x10002000, LENGTH = 24K
FLASH_VTOR (rx) : ORIGIN = 0x08000000, LENGTH = 1K
FLASH (rx) : ORIGIN = 0x0800C000, LENGTH = 192K
}
/* Define output sections */
@ -75,6 +77,14 @@ SECTIONS
. = ALIGN(8);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(8);
} >FLASH_VTOR
/* The startup code goes first into FLASH */
.isr_vector_app :
{
. = ALIGN(8);
KEEP(*(.isr_vector_app)) /* Startup code */
. = ALIGN(8);
} >FLASH
/* The program code and other data goes into FLASH */
@ -153,8 +163,8 @@ SECTIONS
{
. = ALIGN(8);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
EXCLUDE_FILE(*rte_wx.o *rte_main.o *rte_rtu.o) *(.data) /* .data sections */
EXCLUDE_FILE(*rte_wx.o *rte_main.o *rte_rtu.o) *(.data*) /* .data* sections */
. = ALIGN(8);
_edata = .; /* define a global symbol at data end */
@ -168,15 +178,57 @@ SECTIONS
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
EXCLUDE_FILE(*rte_wx.o *rte_main.o *rte_rtu.o) *(.bss)
EXCLUDE_FILE(*rte_wx.o *rte_main.o *rte_rtu.o) *(.bss*)
EXCLUDE_FILE(*rte_wx.o *rte_main.o *rte_rtu.o) *(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
.rte_bss :
{
_s_rte_bss = .; /* define a global symbol at bss start */
__bss_rte_start__ = _s_rte_bss;
. = ALIGN(4);
KEEP(*rte_wx.o (.bss))
KEEP(*rte_wx.o (.bss*))
KEEP(*rte_wx.o (COMMON))
KEEP(*rte_main.o (.bss))
KEEP(*rte_main.o (.bss*))
KEEP(*rte_main.o (COMMON))
KEEP(*rte_rtu.o (.bss))
KEEP(*rte_rtu.o (.bss*))
KEEP(*rte_rtu.o (COMMON))
. = ALIGN(4);
_e_rte_bss = .; /* define a global symbol at bss start */
__bss_rte_end__ = _e_rte_bss;
} >RAM2
.noinit_ram2 :
{
KEEP(*(.noinit_ram2));
} >RAM2_NOINIT
/* used by the startup to initialize data */
_si_rte_data = LOADADDR(.rte_data);
.rte_data :
{
_s_rte_data = .; /* create a global symbol at data start */
. = ALIGN(8);
KEEP(*rte_wx.o (.data))
KEEP(*rte_wx.o (.data*))
KEEP(*rte_main.o (.data))
KEEP(*rte_main.o (.data*))
KEEP(*rte_rtu.o (.data))
KEEP(*rte_rtu.o (.data*))
. = ALIGN(8);
_e_rte_data = .; /* create a global symbol at data start */
} >RAM2 AT> FLASH
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{

Wyświetl plik

@ -8,7 +8,10 @@
#include "aprsis.h"
#include "etc/aprsis_config.h"
#include "text.h"
#include "backup_registers.h"
#include "aprs/status.h"
#include "aprs/message.h"
#include "gsm/sim800c.h"
#include "gsm/sim800c_poolers.h"
@ -19,6 +22,12 @@
#include <stdio.h>
#include <string.h>
#ifdef UNIT_TEST
#define STATIC
#else
#define STATIC static
#endif
srl_context_t * aprsis_serial_port;
/**
@ -34,7 +43,7 @@ gsm_sim800_state_t * aprsis_gsm_modem_state;
/**
* Buffer for sending packet to aprs-is
*/
char aprsis_packet_tx_buffer[APRSIS_TX_BUFFER_LN];
static char aprsis_packet_tx_buffer[APRSIS_TX_BUFFER_LN];
/**
* Lenght of buffer
@ -74,6 +83,16 @@ const char * aprsis_default_server_address;
*/
const char * aprsis_callsign_with_ssid;
/**
* Pointer to callsign from configuration
*/
const char * aprsis_callsign;
/**
* ssid from configuration
*/
uint8_t aprsis_ssid;
/**
* Lenght of APRS-IS server address string
*/
@ -180,6 +199,109 @@ char aprsis_login_string_reveived[APRSIS_LOGIN_STRING_RECEIVED_LN];
*/
#define MAXIMUM_CALL_SSID_DASH_LN 10
/**
* Checks if data in a buffer contains APRS message
* @param message
* @param message_ln
* @return position at which content of message starts
*/
STATIC uint16_t aprsis_check_is_message(const uint8_t * const message, const uint16_t message_ln) {
// example message
// Details:"SP8EBC>APX216,TCPIP*,qAC,NINTH::SR9WXZ :tedt{0s}\r\n", '\0' <repeats 715 times>
// go through a buffer and look for double ':'
uint16_t message_start_position = 0;
for (int i = 0; i < message_ln; i++) {
const uint8_t * this_character = message + i;
const uint8_t * next_character = message + i + 1;
if (*this_character == 0x00) {
break;
}
if ((*this_character == ':') && (*next_character == ':')) {
message_start_position = i + 2;
break;
}
}
return message_start_position;
}
/**
*
* @param srl_context
*/
STATIC void aprsis_receive_callback(srl_context_t* srl_context) {
const uint8_t * buffer = srl_get_rx_buffer(srl_context);
const uint16_t message_ln = srl_context->srl_rx_bytes_counter;
// if something was actually received
if (srl_context->srl_rx_state == SRL_RX_DONE) {
// check if this is keepalive message
if (*buffer == '#') {
// set last timestamps
aprsis_last_keepalive_ts = main_get_master_time();
aprsis_last_keepalive_long_ts = main_get_master_time();
// increase received keepalive counter
aprsis_keepalive_received_counter++;
// restart receiving from serial port
gsm_sim800_tcpip_async_receive(aprsis_serial_port, aprsis_gsm_modem_state, 0, 61000, aprsis_receive_callback);
}
else {
// check if this is an aprs message
const int message_position = aprsis_check_is_message(buffer, message_ln);
// if yes try to decode it
if (message_position != 0) {
// prevent overwriting message received from radio channel if it hasn't been serviced yet
if (rte_main_received_message.source == MESSAGE_SOURCE_UNINITIALIZED) {
// if decoding was successfull
if (message_decode(buffer, message_ln, message_position, MESSAGE_SOURCE_APRSIS, &rte_main_received_message) == 0) {
// check if it is for me
if (message_is_for_me(aprsis_callsign, aprsis_ssid, &rte_main_received_message) == 0) {
// trigger preparing ACK
rte_main_trigger_message_ack = 1;
}
}
}
}
else {
;
}
aprsis_another_received_counter++;
gsm_sim800_tcpip_async_receive(aprsis_serial_port, aprsis_gsm_modem_state, 0, 61000, aprsis_receive_callback);
}
}
}
/**
*
* @param context
* @param gsm_modem_state
* @param callsign
* @param ssid
* @param passcode
* @param default_server
* @param default_port
* @param reset_on_timeout
* @param callsign_with_ssid
*/
void aprsis_init(
srl_context_t * context,
gsm_sim800_state_t * gsm_modem_state,
@ -212,6 +334,10 @@ void aprsis_init(
aprsis_reset_on_timeout = reset_on_timeout;
aprsis_callsign = callsign;
aprsis_ssid = ssid;
}
/**
@ -303,7 +429,7 @@ aprsis_return_t aprsis_connect_and_login(const char * address, uint8_t address_l
aprsis_logged = 1;
// trigger GSM status APRS-IS packet, when connection is ready
rte_main_trigger_gsm_status_gsm = 1;
rte_main_trigger_gsm_status = 1;
// set current timestamp as last
aprsis_last_keepalive_ts = master_time;
@ -394,29 +520,6 @@ sim800_return_t aprsis_disconnect(void) {
return out;
}
void aprsis_receive_callback(srl_context_t* srl_context) {
// if something was actually received
if (srl_context->srl_rx_state == SRL_RX_DONE) {
// check if this is keepalive message
if (*(srl_get_rx_buffer(srl_context)) == '#') {
aprsis_last_keepalive_ts = main_get_master_time();
aprsis_last_keepalive_long_ts = main_get_master_time();
aprsis_keepalive_received_counter++;
gsm_sim800_tcpip_async_receive(aprsis_serial_port, aprsis_gsm_modem_state, 0, 61000, aprsis_receive_callback);
}
else {
aprsis_another_received_counter++;
gsm_sim800_tcpip_async_receive(aprsis_serial_port, aprsis_gsm_modem_state, 0, 61000, aprsis_receive_callback);
}
}
}
/**
* Pooler function which check periodically if APRS-IS connection is alive.
*/
@ -524,6 +627,11 @@ void aprsis_send_wx_frame(
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_WX);
}
aprsis_tx_counter++;
float max_wind_speed = 0.0f, temp = 0.0f;
@ -602,6 +710,11 @@ void aprsis_send_beacon(
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_BEACON);
}
aprsis_tx_counter++;
aprsis_packet_tx_message_size = snprintf(
@ -721,6 +834,8 @@ void aprsis_prepare_telemetry(
/**
* Sends to APRS-IS prepared telemetry frame prepared in advance
* @param async
* @param callsign_with_ssid
*/
void aprsis_send_telemetry(uint8_t async, const char * callsign_with_ssid) {
@ -734,6 +849,11 @@ void aprsis_send_telemetry(uint8_t async, const char * callsign_with_ssid) {
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_TELEMETRY);
}
aprsis_tx_counter++;
aprsis_packet_tx_message_size = snprintf(
@ -793,6 +913,11 @@ telemetry_description_t aprsis_send_description_telemetry(uint8_t async,
return next;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_DESCR);
}
telemetry_create_description_string(config_basic, what, main_own_aprs_msg, OWN_APRS_MSG_LN);
aprsis_tx_counter++;
@ -831,6 +956,11 @@ void aprsis_igate_to_aprsis(AX25Msg *msg, const char * callsign_with_ssid) {
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_IGATE);
}
aprsis_igated_counter++;
// prepare buffer for message
@ -906,12 +1036,17 @@ void aprsis_igate_to_aprsis(AX25Msg *msg, const char * callsign_with_ssid) {
}
void aprsis_send_server_conn_status(const char * callsign_with_ssid) {
void aprsis_send_server_comm_counters(const char * callsign_with_ssid) {
if (aprsis_logged == 0) {
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_CNTRS);
}
memset (aprsis_packet_tx_buffer, 0x00, APRSIS_TX_BUFFER_LN);
aprsis_tx_counter++;
@ -938,6 +1073,11 @@ void aprsis_send_loginstring(const char * callsign_with_ssid, uint8_t rtc_ok, ui
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_LOGINSTRING);
}
memset (aprsis_packet_tx_buffer, 0x00, APRSIS_TX_BUFFER_LN);
aprsis_tx_counter++;
@ -945,18 +1085,19 @@ void aprsis_send_loginstring(const char * callsign_with_ssid, uint8_t rtc_ok, ui
aprsis_packet_tx_message_size = snprintf(
aprsis_packet_tx_buffer,
APRSIS_TX_BUFFER_LN - 1,
"%s>AKLPRZ,qAR,%s:>[rtc_ok: %d][vbat: %d][aprsis]%s\r\n",
"%s>AKLPRZ,qAR,%s:>[rtc_ok: %d][vbat: %d][register_reset_check_fail: 0x%X][aprsis]%s\r\n",
callsign_with_ssid,
callsign_with_ssid,
rtc_ok,
voltage,
backup_reg_get_register_reset_check_fail(),
aprsis_login_string_reveived);
gsm_sim800_tcpip_async_write((uint8_t *)aprsis_packet_tx_buffer, aprsis_packet_tx_message_size, aprsis_serial_port, aprsis_gsm_modem_state);
}
void aprsis_send_gpsstatus(const char * callsign_with_ssid) {
void aprsis_send_gsm_status(const char * callsign_with_ssid) {
if (aprsis_logged == 0) {
return;
}
@ -979,9 +1120,51 @@ void aprsis_send_gpsstatus(const char * callsign_with_ssid) {
gsm_sim800_tcpip_async_write((uint8_t *)aprsis_packet_tx_buffer, aprsis_packet_tx_message_size, aprsis_serial_port, aprsis_gsm_modem_state);
}
/**
*
* @param message
*/
void aprsis_send_ack_for_message(const message_t * const message) {
aprsis_packet_tx_message_size = message_create_ack_for((uint8_t*)aprsis_packet_tx_buffer, APRSIS_TX_BUFFER_LN - 1, message);
gsm_sim800_tcpip_async_write((uint8_t *)aprsis_packet_tx_buffer, aprsis_packet_tx_message_size, aprsis_serial_port, aprsis_gsm_modem_state);
}
/**
*
* @param message pointer to string buffer with a message to send to APRS-IS
* @param ln lenght of a string (not size of a buffer!!)
*/
void aprsis_send_any_string_buffer(const char * const message, const uint16_t ln) {
if (aprsis_logged == 0 || ln == 0) {
return;
}
if (gsm_sim800_tcpip_tx_busy() == 1) {
// will die here
backup_assert(BACKUP_REG_ASSERT_CONCURENT_ACCES_APRSIS_OTHER);
}
// copy input message to intermediate message buffer
strcpy(aprsis_packet_tx_buffer, message);
*(aprsis_packet_tx_buffer + ln) = '\r';
*(aprsis_packet_tx_buffer + ln + 1) = '\n';
*(aprsis_packet_tx_buffer + ln + 2) = 0x00;
*(aprsis_packet_tx_buffer + ln + 3) = 0x00;
aprsis_packet_tx_message_size = ln + 2;
gsm_sim800_tcpip_async_write((uint8_t *)aprsis_packet_tx_buffer, aprsis_packet_tx_message_size, aprsis_serial_port, aprsis_gsm_modem_state);
}
#ifdef UNIT_TEST
char * aprsis_get_tx_buffer(void) {
return aprsis_packet_tx_buffer;
}
#endif
uint8_t aprsis_get_aprsis_logged(void) {
return aprsis_logged;

Wyświetl plik

@ -16,11 +16,22 @@
#define REGISTER_COUNTERS RTC->BKP4R
#define REGISTER_LAST_SLTIM RTC->BKP6R
#define REGISTER_PACKET_COUNTERS RTC->BKP7R
#define REGISTER_RESET_CHECK_FAIL RTC->BKP8R
#define REGISTER_ASSERT RTC->BKP9R
#define REGISTER_LAST_RESTART RTC->BKP10R
#endif
//#if defined(STM32F10X_MD_VL)
//#define REGISTER_COUNTERS BKP->DR4
//#define REGISTER_PACKET_COUNTERS BKP->DR
//#define REGISTER_RESET_CHECK_FAIL RTC->BKP8R
//#define REGISTER_ASSERT RTC->BKP9R
//#endif
#define BACKUP_REG_INHIBIT_PWR_SWITCH_PERIODIC_H 1u
#define BACKUP_REG_ALL_PWRSAVE_STATES_BITMASK (0xFFu << 2)
// backup registers (ParaTNC)
// 0 ->
// 2 -> boot and hard fault count
@ -39,6 +50,9 @@
// 5 -> monitor
// 6 -> last sleep time
// 7 -> weather and telemetry timers & counters
// 8 -> counters of resets caused by validation checks failures
// 9 -> assert register
// 10-> last restart RTC date
// 7th register map
// xxxxyyAA - telemetry frames counter
@ -47,13 +61,31 @@
// xxAAyyyy - value of packet_tx_beacon_counter
// Axxxyyyy - checksum
// 8th register map
// xxxxyyAA - resets caused by 'aprsis_check_connection_attempt_alive()'
// xxxxAAyy - resets caused by 'rte_wx_check_weather_measurements()'
// xxAAyyyy - resets caused by value of 'rte_wx_dallas_degraded_counter'
// AAxxyyyy - resets caused by 'system_is_rtc_ok()'
static void backup_reg_unclock(void) {
#ifdef PARAMETEO
// enable access to backup domain
PWR->CR1 |= PWR_CR1_DBP;
#endif
#ifdef PARATNC
PWR->CR |= PWR_CR_DBP;
#endif
}
static void backup_reg_lock(void) {
#ifdef PARAMETEO
PWR->CR1 &= (0xFFFFFFFFu ^ PWR_CR1_DBP);
#endif
#ifdef PARATNC
PWR->CR &= (0xFFFFFFFFu ^ PWR_CR_DBP);
#endif
}
/**
@ -93,7 +125,7 @@ inline static uint8_t backup_reg_get_checksum(uint32_t reg) {
inline static void backup_reg_set_checksum(volatile uint32_t * reg, const uint8_t checksum) {
if (variant_validate_is_within_ram((const uint32_t)reg) != 0) {
if (variant_validate_is_within_ram((void*)reg) != 0) {
// clear existing checksum
(*reg) &= (0xFFFFFFFF ^ 0xF0000000);
@ -421,7 +453,10 @@ uint32_t backup_reg_get_last_sleep_duration(void) {
return out;
}
/**
*
* @param in
*/
void backup_reg_set_last_sleep_duration(uint32_t in) {
#ifdef PARAMETEO
backup_reg_unclock();
@ -512,6 +547,12 @@ void backup_reg_set_telemetry(uint16_t in) {
}
/**
*
* @param beacon_counter
* @param meteo_counter
* @param meteo_gsm_counter
*/
void backup_reg_get_packet_counters(uint8_t * beacon_counter, uint8_t * meteo_counter, uint8_t * meteo_gsm_counter) {
#ifdef PARAMETEO
uint32_t reg_value = REGISTER_PACKET_COUNTERS;
@ -539,6 +580,12 @@ void backup_reg_get_packet_counters(uint8_t * beacon_counter, uint8_t * meteo_co
#endif
}
/**
*
* @param beacon_counter
* @param meteo_counter
* @param meteo_gsm_counter
*/
void backup_reg_set_packet_counters(uint8_t beacon_counter, uint8_t meteo_counter, uint8_t meteo_gsm_counter) {
#ifdef PARAMETEO
volatile uint32_t reg_value = REGISTER_PACKET_COUNTERS;
@ -572,3 +619,137 @@ void backup_reg_set_packet_counters(uint8_t beacon_counter, uint8_t meteo_counte
#endif
}
void backup_reg_increment_aprsis_check_reset(void) {
#ifdef PARAMETEO
// REGISTER_RESET_CHECK_FAIL
volatile uint32_t reg_value = REGISTER_RESET_CHECK_FAIL;
// get existing value
uint8_t counter = (uint8_t)(reg_value & 0xFFU);
// increment it
counter++;
// clear existing value from register
reg_value &= 0xFFFFFF00U;
// add incremented counter value
reg_value |= counter;
backup_reg_unclock();
REGISTER_RESET_CHECK_FAIL = reg_value;
backup_reg_lock();
#endif
}
void backup_reg_increment_weather_measurements_check_reset(void) {
#ifdef PARAMETEO
// REGISTER_RESET_CHECK_FAIL
volatile uint32_t reg_value = REGISTER_RESET_CHECK_FAIL;
// get existing value
uint8_t counter = (uint8_t)((reg_value & 0xFF00U) >> 8U);
// increment it
counter++;
// clear existing value from register
reg_value &= 0xFFFF00FFU;
// add incremented counter value
reg_value |= ((uint32_t)counter << 8U);
backup_reg_unclock();
REGISTER_RESET_CHECK_FAIL = reg_value;
backup_reg_lock();
#endif
}
void backup_reg_increment_dallas_degraded_reset(void) {
#ifdef PARAMETEO
// REGISTER_RESET_CHECK_FAIL
volatile uint32_t reg_value = REGISTER_RESET_CHECK_FAIL;
// get existing value
uint8_t counter = (uint8_t)((reg_value & 0xFF0000U) >> 16U);
// increment it
counter++;
// clear existing value from register
reg_value &= 0xFF00FFFFU;
// add incremented counter value
reg_value |= ((uint32_t)counter << 16U);
backup_reg_unclock();
REGISTER_RESET_CHECK_FAIL = reg_value;
backup_reg_lock();
#endif
}
void backup_reg_increment_is_rtc_ok_check_reset(void) {
#ifdef PARAMETEO
// REGISTER_RESET_CHECK_FAIL
volatile uint32_t reg_value = REGISTER_RESET_CHECK_FAIL;
// get existing value
uint8_t counter = (uint8_t)((reg_value & 0xFF000000U) >> 24U);
// increment it
counter++;
// clear existing value from register
reg_value &= 0x00FFFFFFU;
// add incremented counter value
reg_value |= ((uint32_t)counter << 24U);
backup_reg_unclock();
REGISTER_RESET_CHECK_FAIL = reg_value;
backup_reg_lock();
#endif
}
uint32_t backup_reg_get_register_reset_check_fail(void)
{
#ifdef PARAMETEO
return REGISTER_RESET_CHECK_FAIL;
#else
return 0;
#endif
}
void backup_assert(uint32_t assert) {
#ifdef PARAMETEO
backup_reg_unclock();
REGISTER_ASSERT |= assert;
backup_reg_lock();
NVIC_SystemReset();
#endif
}
uint32_t backup_reg_get_last_restart_date(void) {
return REGISTER_LAST_RESTART;
}
void backup_reg_set_last_restart_date(void) {
backup_reg_unclock();
REGISTER_LAST_RESTART = RTC->DR;
backup_reg_lock();
}

24
src/event_log.c 100644
Wyświetl plik

@ -0,0 +1,24 @@
/*
* event_log.c
*
* Created on: May 26, 2024
* Author: mateusz
*/
#include "event_log.h"
/**
* Structure to manage noinit RAM storage and FLASH storage
*/
typedef struct event_log_fifo_t {
uint16_t oldest_event_index;
uint32_t oldest_event_master_time;
event_log_t * oldest_event_pointer;
uint16_t newest_event_index;
uint32_t newest_event_master_time;
event_log_t * newest_event_pointer;
};
void event_log_init(uint8_t flash_enabled_severity, uint8_t ram_enabled_severity) {
}

Wyświetl plik

@ -525,7 +525,7 @@ void io_vbat_meas_enable(void) {
void io_pool_vbat_r(int16_t minutes_to_wx) {
// check how many minutes reamins to weather packet
if (minutes_to_wx == 2) {
if (minutes_to_wx == 1) {
// hardcoded to 2 minutes
switch(io_vbat_r_state) {

Wyświetl plik

@ -10,7 +10,7 @@
*/
#include <kiss_communication/kiss_communication.h>
#include <kiss_communication/kiss_communication_service_ids.h>
#include <kiss_communication/types/kiss_communication_service_ids.h>
#include <kiss_communication/kiss_did.h>
#include <kiss_communication/kiss_nrc_response.h>
#include "main.h"
@ -124,9 +124,9 @@ int32_t kiss_callback_get_version_id(uint8_t* input_frame_from_host, uint16_t in
uint8_t config_payload_size = 0;
#ifdef PARAMETEO
config_payload_size = snprintf((char *)response_buffer + 3, buffer_size, "METEO-%s-%s", SW_VER, SW_KISS_PROTO);
config_payload_size = snprintf((char *)response_buffer + 4, buffer_size, "METEO-%s-%s", SW_VER, SW_KISS_PROTO);
#else
config_payload_size = snprintf((char *)response_buffer + 3, buffer_size, "TNC-%s-%s", SW_VER, SW_KISS_PROTO);
config_payload_size = snprintf((char *)response_buffer + 4, buffer_size, "TNC-%s-%s", SW_VER, SW_KISS_PROTO);
#endif
// construct a response
@ -224,11 +224,13 @@ int32_t kiss_callback_read_did(uint8_t* input_frame_from_host, uint16_t input_le
/**
* Response frame structure
*
* FEND, KISS_READ_DID_RESP, DID_lsb, DID_msb, size_byte, DATA (...), FEND
* FEND, NONSTANDARD, RESPONSE_SIZE, KISS_READ_DID_RESP, DID_lsb, DID_msb, size_byte, DATA (...), FEND
*/
int32_t out = 0;
memset(response_buffer, 0x00, buffer_size);
// identifier
uint16_t did = *(input_frame_from_host + 2) | (*(input_frame_from_host + 3) << 8);

Wyświetl plik

@ -12,12 +12,14 @@
#include <crc.h>
#include <kiss_communication/kiss_callback.h>
#include <kiss_communication/kiss_communication.h>
#include <kiss_communication/kiss_communication_service_ids.h>
#include <kiss_communication/types/kiss_communication_service_ids.h>
#include <string.h>
#include <stdlib.h>
#include <stored_configuration_nvm/config_data_externs.h>
#include <stored_configuration_nvm/configuration_handler.h>
#include "variant.h"
extern unsigned short tx10m;
/**
@ -26,6 +28,12 @@ extern unsigned short tx10m;
*/
uint8_t kiss_current_async_message = 0xFF;
/**
*
* @param output
* @param output_len
* @return
*/
uint8_t kiss_async_pooler(uint8_t* output, uint16_t output_len ) {
int16_t pooling_result = 0;
@ -60,6 +68,14 @@ uint8_t kiss_async_pooler(uint8_t* output, uint16_t output_len ) {
return out;
}
/**
*
* @param input_frame
* @param input_frame_len
* @param output
* @param output_len
* @return
*/
int32_t kiss_send_ax25_to_host(uint8_t* input_frame, uint16_t input_frame_len, uint8_t* output, uint16_t output_len) {
#define FEND (uint8_t)0xC0
#define FESC (uint8_t)0xDB
@ -106,20 +122,30 @@ int32_t kiss_send_ax25_to_host(uint8_t* input_frame, uint16_t input_frame_len, u
* some diagnostics request or configuration (NOT regular KISS data with frame to be transmitted), this function
* might generate a response
*/
/**
*
* @param input_frame_from_host
* @param input_len
* @param ax25
* @param a
* @param response_buffer
* @param resp_buf_ln
* @return
*/
int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len, AX25Ctx* ax25, Afsk* a, uint8_t * response_buffer, uint16_t resp_buf_ln ) {
int i/* zmienna do poruszania sie po buforze odbiorczym usart */;
int j/* zmienna do poruszania sie po lokalnej tablicy do przepisywania*/;
int32_t output = 0;
if (input_frame_from_host == 0x00 || ax25 == 0x00 || a == 0x00) {
output = -2;
if (variant_validate_is_within_ram(input_frame_from_host) == 0x00) {
output = KISS_COMM_RESULT_WRONG_POINTER;
}
else if (input_len >= OWN_APRS_MSG_LN) {
output = -1;
output = KISS_COMM_RESULT_INPUT_TOO_LONG;
}
else if (*(input_frame_from_host) != FEND) {
output = -1;
output = KISS_COMM_RESULT_MISSING_PREFIX;
}
else {
@ -132,33 +158,35 @@ int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len,
switch (frame_type) {
case KISS_DATA: {
memset(FrameBuff, 0x00, OWN_APRS_MSG_LN);
if (variant_validate_is_within_ram(ax25) && variant_validate_is_within_ram(a)) {
memset(FrameBuff, 0x00, OWN_APRS_MSG_LN);
// if this is data frame
for (i=2, j=0; (i<input_len && *(input_frame_from_host+i) != FEND); i++, j++) {
if (*(input_frame_from_host+i) == FESC) {
if(*(input_frame_from_host+i+1) == TFEND)
FrameBuff[j]=FEND;
else if(*(input_frame_from_host+i+1) == TFESC)
FrameBuff[j]=FESC;
else {
;
// if this is data frame
for (i=2, j=0; (i<input_len && *(input_frame_from_host+i) != FEND); i++, j++) {
if (*(input_frame_from_host+i) == FESC) {
if(*(input_frame_from_host+i+1) == TFEND)
FrameBuff[j]=FEND;
else if(*(input_frame_from_host+i+1) == TFESC)
FrameBuff[j]=FESC;
else {
;
}
i++;
}
i++;
else
FrameBuff[j] = *(input_frame_from_host+i);
}
else
FrameBuff[j] = *(input_frame_from_host+i);
tx10m++;
// keep this commented until reseting the DCD variable will be moved outside main for (;;) loop
// while(ax25->dcd == true);
while(a->sending == true);
ax25_sendRaw(ax25,FrameBuff,j);
afsk_txStart(a);
}
tx10m++;
// keep this commented until reseting the DCD variable will be moved outside main for (;;) loop
// while(ax25->dcd == true);
while(a->sending == true);
ax25_sendRaw(ax25,FrameBuff,j);
afsk_txStart(a);
} break;
case KISS_GET_RUNNING_CONFIG: {
@ -188,7 +216,7 @@ int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len,
default: {
// unknown service
output = -3;
output = KISS_COMM_RESULT_UNKNOWN_DIAG_SERV;
}
}
}
@ -197,7 +225,12 @@ int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len,
return output;
}
/**
*
* @param output
* @param output_len
* @param current_len
*/
void kiss_reset_buffer(uint8_t* output, uint16_t output_len, uint16_t* current_len) {
memset(output, 0x00, sizeof(output_len));
@ -251,6 +284,15 @@ uint8_t kiss_put_char(uint8_t c, uint8_t* output, uint16_t output_len, uint16_t*
return 0;
}
/**
*
* @param c
* @param output
* @param output_len
* @param current_len
* @param crc
* @return
*/
uint8_t kiss_put_char_nocheck(uint8_t c, uint8_t* output, uint16_t output_len, uint16_t* current_len, uint16_t* crc) {
uint16_t new_crc = 0;
uint16_t curr_ln = *current_len;
@ -275,6 +317,15 @@ uint8_t kiss_put_char_nocheck(uint8_t c, uint8_t* output, uint16_t output_len, u
return 0;
}
/**
*
* @param addr
* @param is_last
* @param output
* @param output_len
* @param current_len
* @param crc
*/
void kiss_put_call(const AX25Call *addr, uint8_t is_last, uint8_t* output, uint16_t output_len, uint16_t* current_len, uint16_t* crc) {
uint16_t i;
@ -301,6 +352,12 @@ void kiss_put_call(const AX25Call *addr, uint8_t is_last, uint8_t* output, uint1
}
/**
*
* @param output
* @param output_len
* @param current_len
*/
void kiss_finalize_buffer(uint8_t* output, uint16_t output_len, uint16_t* current_len) {
uint16_t ln = *current_len;

Wyświetl plik

@ -0,0 +1,175 @@
/*
* kiss_communication_aprsmsg.c
*
* Created on: May 5, 2024
* Author: mateusz
*/
#include "kiss_communication/kiss_communication_aprsmsg.h"
#define KISS_COMMUNICATION_APRSMSG_DEC_CURRENT_CHAR *(message_payload + payload_it)
#define KISS_COMMUNICATION_APRSMSG_DEC_NEXT_CHAR *(message_payload + payload_it + 1)
#define KISS_COMMUNICATION_APRSMSG_DEC_OUTPUT_IT ((payload_it - 1) / 2)
#define KISS_COMMUNICATION_APRSMSG_IS_DIGIT(c) ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
#define KISS_COMMUNICATION_APRSMSG_ENC_OUTPUT_L_IT(i) (((i + 1) * 2) + 1)
#define KISS_COMMUNICATION_APRSMSG_ENC_OUTPUT_H_IT(i) ((i + 1) * 2)
#define KISS_COMMUNICATION_APRSMSG_GET_CHAR(b) kiss_communication_aprsmsg_tohexstr_lookup_table[b]
#define KISS_COMMUNICATION_APRSMSG_IS_HEXSTRING(s) ((*(s) == 'H') && (*(s + 1) == 'S'))
#define KISS_COMMUNICATION_APRSMSG_IS_ENCR_HEXSTRING(s) (*(s) == 'P')
static uint8_t kiss_communication_aprsmsg_lookup_table[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
-1, -1, -1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15};
static uint8_t kiss_communication_aprsmsg_tohexstr_lookup_table[] =
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
/**
*
* @param message_payload
* @param message_payload_ln
* @return
*/
kiss_communication_transport_t kiss_communication_aprsmsg_check_type(uint8_t * message_payload, uint16_t message_payload_ln)
{
kiss_communication_transport_t out = KISS_TRANSPORT_UNINITIALIZED;
if (variant_validate_is_within_ram(message_payload) == 1 && message_payload_ln > 6 && message_payload_ln <= 67) {
if (KISS_COMMUNICATION_APRSMSG_IS_HEXSTRING(message_payload)) {
out = KISS_TRANSPORT_HEXSTRING;
}
else if (KISS_COMMUNICATION_APRSMSG_IS_ENCR_HEXSTRING(message_payload)) {
out = KISS_TRANSPORT_ERROR_UNSUPPORTED;
}
else {
out = KISS_TRANSPORT_NOT_KISS;
}
}
return out;
}
/**
*
* @param message_payload pointer to characters buffer with APRS text message, containing encoded UDS diag request
* @param message_payload_ln length of buffer pointed by message_payload. processing will be done until first non-hex character (non 0-9 / a-f) or this length
* @param output_binary_buffer pointer to binary buffer where decoded data will be copied to.
* @param output_ln
* @return length of decoded UDS request or zero if message_payload doesn't contain valid hexstring with UDS request
*/
uint16_t kiss_communication_aprsmsg_decode_hexstring(uint8_t * message_payload, uint16_t message_payload_ln, uint8_t * output_binary_buffer, uint16_t output_ln)
{
uint8_t out = 0;
// iterator to go through 'message_payload' input buffer
uint16_t payload_it = 0;
// high nibble
uint8_t hn = 0;
// low nibble
uint8_t ln = 0;
// checck if input string is located in legoit RAM memory
if (variant_validate_is_within_ram(message_payload) == 1 && message_payload_ln > 0) {
// check second time of string begins with 'HS'
if (KISS_COMMUNICATION_APRSMSG_DEC_CURRENT_CHAR == 'H' && KISS_COMMUNICATION_APRSMSG_DEC_NEXT_CHAR == 'S') {
// move iterator to begining of hex-characters
payload_it += 2;
while (payload_it < message_payload_ln) {
// check if current char resembles hex base number
if (KISS_COMMUNICATION_APRSMSG_IS_DIGIT(KISS_COMMUNICATION_APRSMSG_DEC_CURRENT_CHAR) == 0) {
break; // if not break conversion
}
if (KISS_COMMUNICATION_APRSMSG_DEC_OUTPUT_IT >= output_ln) {
break; // no more room for output data
}
hn = KISS_COMMUNICATION_APRSMSG_DEC_CURRENT_CHAR;
ln = KISS_COMMUNICATION_APRSMSG_DEC_NEXT_CHAR;
// calculate index to lookup table basing on current character
const uint8_t index_hn = hn - 0x30u;
// calculate index to lookup table basing on current character
const uint8_t index_ln = ln - 0x30u;
// conveted byte
const uint8_t converted_byte = (kiss_communication_aprsmsg_lookup_table[index_hn] * 0x10u) +
kiss_communication_aprsmsg_lookup_table[index_ln];
// put converted byte into output array
output_binary_buffer[KISS_COMMUNICATION_APRSMSG_DEC_OUTPUT_IT] = converted_byte;
payload_it += 2;
}
// go through
out = KISS_COMMUNICATION_APRSMSG_DEC_OUTPUT_IT;
}
}
return out;
}
uint16_t kiss_communication_aprsmsg_encode_hexstring(uint8_t * input_binary_buffer, uint16_t input_ln, uint8_t * output_message, uint16_t output_message_max_ln)
{
uint16_t out = 0;
// iterator across input buffer
uint16_t iterator = 0;
// expected lenght of output buffer. Prefix 'HS', then hex encoded binary data and null termimator at the end
const uint16_t expected_output_ln = 2 + (input_ln * 2) + 1;
// if output buffer is big enought to fit
if (output_message_max_ln > expected_output_ln) {
// make a room for output data
memset(output_message, 0x00, expected_output_ln);
// put prefix
*output_message = 'H';
*(output_message + 1) = 'S';
while (iterator < input_ln) {
// extract high and low nibbled for processed byte
const uint8_t low_nibble = input_binary_buffer[iterator] & 0xFu;
const uint8_t high_nibble = (input_binary_buffer[iterator] & 0xF0u) >> 4;
output_message[KISS_COMMUNICATION_APRSMSG_ENC_OUTPUT_L_IT(iterator)] = KISS_COMMUNICATION_APRSMSG_GET_CHAR(low_nibble);
output_message[KISS_COMMUNICATION_APRSMSG_ENC_OUTPUT_H_IT(iterator)] = KISS_COMMUNICATION_APRSMSG_GET_CHAR(high_nibble);
out = KISS_COMMUNICATION_APRSMSG_ENC_OUTPUT_L_IT(iterator) + 1;
iterator++;
}
}
return out;
}

Wyświetl plik

@ -22,6 +22,10 @@
#include <stm32l4xx.h>
#endif
#define KISS_DID_SIZE_MAPPING_INT8 1
#define KISS_DID_SIZE_MAPPING_INT16 2
#define KISS_DID_SIZE_MAPPING_INT32 3
//!< Dummy variable used only as end of definition marker in tables
char did_dummy_data;
@ -46,10 +50,10 @@ const static kiss_did_numeric_definition_t kiss_did_def[] = {
//!< Mapping between a result of sizeof operator and a value of sizebyte
const static uint8_t kiss_did_sizeof_to_sizebyte_mapping[5] = {
0,// nothing
1, // int8_t
2, // int16_t
KISS_DID_SIZE_MAPPING_INT8, // int8_t -> 1
KISS_DID_SIZE_MAPPING_INT16, // int16_t -> 2
0, // nothing
3 // int32_t
KISS_DID_SIZE_MAPPING_INT32 // int32_t -> 3
};
/**
@ -146,9 +150,9 @@ static int kiss_did_validate(kiss_did_numeric_definition_t * definition, uint8_t
if (amount_of_data > 0) {
// check if DID data size an address is correct
if ((definition->first_data_size == 0 ||
definition->first_data_size == 1 ||
definition->first_data_size == 4) &&
if ((definition->first_data_size == sizeof(int8_t) ||
definition->first_data_size == sizeof(int16_t) ||
definition->first_data_size == sizeof(int32_t)) &&
(uint32_t)definition->first_data > SRAM_BASE &&
(uint32_t)definition->first_data < SRAM_BASE + SRAM1_SIZE_MAX) {
@ -158,9 +162,9 @@ static int kiss_did_validate(kiss_did_numeric_definition_t * definition, uint8_t
// if second did is also defined
if (amount_of_data > 1) {
// check if DID data size is correct
if ((definition->second_data_size == 0 ||
definition->second_data_size == 1 ||
definition->second_data_size == 4) &&
if ((definition->first_data_size == sizeof(int8_t) ||
definition->first_data_size == sizeof(int16_t) ||
definition->first_data_size == sizeof(int32_t)) &&
(uint32_t)definition->second_data > SRAM_BASE &&
(uint32_t)definition->second_data < SRAM_BASE + SRAM1_SIZE_MAX) {
@ -171,9 +175,9 @@ static int kiss_did_validate(kiss_did_numeric_definition_t * definition, uint8_t
if (amount_of_data > 2) {
// check third DID source data size
if ((definition->third_data_size == 0 ||
definition->third_data_size == 1 ||
definition->third_data_size == 4) &&
if ((definition->first_data_size == sizeof(int8_t) ||
definition->first_data_size == sizeof(int16_t) ||
definition->first_data_size == sizeof(int32_t)) &&
(uint32_t)definition->third_data > SRAM_BASE &&
(uint32_t)definition->third_data < SRAM_BASE + SRAM1_SIZE_MAX) {
@ -209,6 +213,13 @@ static int kiss_did_validate(kiss_did_numeric_definition_t * definition, uint8_t
}
// special case for float DIDs
if (out == 0) {
if (kiss_did_validate_is_float(definition) != 0) {
out = 1;
}
}
if (amount != 0) {
*amount = amount_of_data;
}
@ -245,7 +256,7 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
* 0y - If most significant bit is set to zero, size_byte will
* signalize string DID as ASCII characters from basic ASIC
* table are from range 0 to 127
* 10 - If most significant bit is set to zero AND next significant
* 10 - If most significant bit is set to one AND next significant
* bit is set to zero this DID returns integer data. In such
* case three groups of two bits controls a size of data according
* to 'kiss_did_sizeof_to_sizebyte_mapping'. If a group of two bits
@ -314,12 +325,19 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
// move after DID value and size_byte
output_buffer += 3;
// room for size byte
out++;
// and for DID value itself
out += 2;
//append first data source
memcpy(output_buffer, found.first_data, found.first_data_size);
//move forward a poiner to response buffer
output_buffer += found.first_data_size;
// room for first value returned by DID
out += found.first_data_size;
if (number_of_data_source > 1) {
@ -342,12 +360,6 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
out += found.third_data_size;
}
// also include size_byte in this calculation
out++;
// include DID value itself
out += 2;
}
else if (found.identifier != 0xFFFFu && is_valid == 1 && is_float == 1) {
@ -365,13 +377,19 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
// move after DID value and size_byte
output_buffer += 3;
// room for size byte stored in output buffer
out++;
// room for DID number in output buffer
out += 2;
//append first data source
memcpy(output_buffer, found.first_data, sizeof(float));
//move forward a poiner to response buffer
output_buffer += sizeof(float);
out += found.first_data_size;
out += sizeof(float);
if (number_of_data_source > 1) {
//append second data source
@ -393,12 +411,6 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
out += sizeof(float);
}
// also include size_byte in this calculation
out++;
// include DID value itself
out += 2;
}
else if (found.identifier != 0xFFFFu && is_string == 1) {
@ -406,18 +418,33 @@ uint8_t kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t
output_buffer[0] = (identifier & 0xFF);
output_buffer[1] = (identifier & 0xFF00) >> 8;
// if this is a string DID
const char * str = (char *)found.first_data;
// move after DID value and size_byte
output_buffer += 2;
const size_t str_len = strlen(str);
// if this is a string DID
const void * str = (void *)found.first_data;
const size_t str_len = found.first_data_size;
memset(output_buffer, 0x00, buffer_ln - 2);
if (str_len - 2 > buffer_ln) {
memcpy(output_buffer + 2, found.first_data, buffer_ln);
memcpy(output_buffer, str, buffer_ln - 2);
out = buffer_ln - 2;
}
else {
memcpy(output_buffer, found.first_data, str_len);
memcpy(output_buffer, str, str_len);
out = str_len;
}
// include DID number itself
out += 2;
}
else {
out = 0;
}
return out;

Wyświetl plik

@ -7,9 +7,9 @@
#include <kiss_communication/kiss_nrc_response.h>
#include "kiss_communication/kiss_communication_nrc_t.h"
#include "kiss_communication/types/kiss_communication_nrc_t.h"
#include "kiss_communication/kiss_communication.h"
#include "kiss_communication/kiss_communication_service_ids.h"
#include "kiss_communication/types/kiss_communication_service_ids.h"
#include "kiss_configuation.h"
#include <string.h>

Wyświetl plik

@ -0,0 +1,199 @@
/*
* kiss_security_access.c
*
* Created on: May 23, 2024
* Author: mateusz
*/
#include "kiss_communication/kiss_security_access.h"
#include "kiss_communication/types/kiss_communication_service_ids.h"
#include "backup_registers.h"
#include "system_stm32l4xx.h"
#include "memory_map.h"
#include "variant.h"
#define KISS_SECURITY_READ_DID (1 << 0)
#define KISS_SECURITY_READ_MEM_RESTRICTED (1 << 1)
#define KISS_SECURITY_READ_MEM_UNRESTRICTED (1 << 2)
#define KISS_SECURITY_RESTART_RESET (1 << 3)
#define KISS_SECURITY_CONFIG_RESET (1 << 4)
#define KISS_SECURITY_WRITE_MEM (1 << 5)
#define KISS_SECURITY_ERASE_PROGRAM_STARTUP_CONF (1 << 6)
#define KISS_SECURITY_GET_RUNNING_CONF (1 << 7)
#define KISS_SECURITY_FILE_DATA_TRANSFER (1 << 8)
#define KISS_SECURITY_ENCRYPTED_DEFAULT_UNLOCK (1 << 30)
#define KISS_SECURITY_ENCRYPTED_DEFAULT_UNLOCK_NEG (1 << 31)
#define KISS_SECURITY_CHECK_SERIAL(x) ((kiss_security_access_config & (x)) != 0) ? 1 : 0
#define KISS_SECURITY_CHECK_MESSAGE(x) ((kiss_security_access_config & (x << 16)) != 0) ? 1 : 0
/**
* Configuration of how UDS diagnostics are secured access different
* mediums. GET_VERSION_AND_ID and SECURITY_ACCESS are never locked.
* If the service shall not(!!) be locked respective bit should be set to 0.
* By default, when memory is fully erased everything is locked
*
* Serial Port
* 0 - Read DID
* 1 - Read Memory by address (RAM2, RAM2_NOINIT, everything > FLASH)
* 2 - Read Memory by address (without limit)
* 3 - Restart Reset
* 4 - Configuration reset
* 5 - Write memory by address
* 6 - Erase and program startup config
* 7 - Get running config
* 8 - Request file transfer and transfer data
*
* 13 -
*
* Validity bits
* 14
* 15
* these bits are sum of ( (uds_diagnostics_security_access & 0x3FFF) +
* (uds_diagnostics_security_access & 3FFF0000) >> 16) & 0x3. If this value
* doesn't match a configuration from here is discarded completely and
* default settings are applied:
* 1. Everything over serial port is unlocked
* 2. Read DID and one restart per day
*
* APRS Message (Radio network or APRS-IS server)
*
* 16 -
* 17 -
*
* 29 -
*
* Unlock all services by default when accessed via APRSMSG_TRANSPORT_ENCRYPTED_HEXSTRING
* 30 - this should be zero to enable
* 31 - this should be one to enable
*/
static uint32_t kiss_security_access_config = 0U;
/**
* Set to one if configuration allow APRSMSG_TRANSPORT_ENCRYPTED_HEXSTRING
* to be unlocked by default
*/
static uint8_t kiss_security_access_encrypted_unclock = 0U;
/**
* Initializes security acees subsystem with current configuration
* @param config
*/
void kiss_security_access_init(config_data_basic_t * config) {
kiss_security_access_config = config->uds_diagnostics_security_access;
if ((kiss_security_access_config & KISS_SECURITY_ENCRYPTED_DEFAULT_UNLOCK) != 0 &&
(kiss_security_access_config & KISS_SECURITY_ENCRYPTED_DEFAULT_UNLOCK_NEG) == 0 ) {
// every message sent via encrypted HEX string
kiss_security_access_encrypted_unclock = 1;
}
}
/**
* Checks if given diagnostics service ID, received through given transport media could be
* currently used as-is or it required security access to be unlocked.
* @param service_id identyfier as specified in kiss_communication_service_ids.h
* @param transport_media how this request was received
* @param lparam optional, per service specific parameter used for verification.
* @return zero if service doesn't require unlocking and can be executed right now.
*/
uint8_t kiss_security_check_service_req_unlocking(uint8_t service_id, kiss_communication_transport_t transport_media, uint32_t lparam) {
uint8_t out = 1;
if (transport_media == KISS_TRANSPORT_ENCRYPTED_HEXSTRING && kiss_security_access_encrypted_unclock == 1) {
out = 0;
}
else if ((transport_media == KISS_TRANSPORT_ENCRYPTED_HEXSTRING && kiss_security_access_encrypted_unclock == 0) ||
transport_media == KISS_TRANSPORT_HEXSTRING) {
switch (service_id) {
case KISS_RESTART:
if (lparam == KISS_RESET_HARD) {
if (system_get_rtc_date() != backup_reg_get_last_restart_date()) {
// one restart per day is always allowed
out = 0;
}
else {
out = KISS_SECURITY_CHECK_MESSAGE(KISS_RESTART);
}
}
break;
case KISS_GET_VERSION_AND_ID:
case KISS_SECURITY_ACCESS:
// these two are always allowed to be used
out = 0;
break;
case KISS_READ_DID:
out = KISS_SECURITY_CHECK_MESSAGE(KISS_READ_DID);
break;
case KISS_READ_MEM_ADDR:
if (variant_validate_is_within_flash_logger_events((void*)lparam) == 1) {
out = KISS_SECURITY_CHECK_MESSAGE(KISS_SECURITY_READ_MEM_RESTRICTED);
}
else {
// it is assumed that DID handler checks if address to be read
// is located within area
out = KISS_SECURITY_CHECK_MESSAGE(KISS_SECURITY_READ_MEM_UNRESTRICTED);
}
break;
case KISS_ERASE_STARTUP_CFG:
case KISS_PROGRAM_STARTUP_CFG:
out = KISS_SECURITY_CHECK_MESSAGE(KISS_SECURITY_ERASE_PROGRAM_STARTUP_CONF);
break;
case KISS_GET_RUNNING_CONFIG:
out = KISS_SECURITY_CHECK_MESSAGE(KISS_SECURITY_GET_RUNNING_CONF);
break;
default:
break;
}
}
else if (transport_media == KISS_TRANSPORT_SERIAL_PORT) {
switch (service_id) {
case KISS_RESTART:
if (lparam == KISS_RESET_HARD) {
if (system_get_rtc_date() != backup_reg_get_last_restart_date()) {
// one restart per day is always allowed
out = 0;
}
else {
out = KISS_SECURITY_CHECK_SERIAL(KISS_RESTART);
}
}
break;
case KISS_GET_VERSION_AND_ID:
case KISS_SECURITY_ACCESS:
// these two are always allowed to be used
out = 0;
break;
case KISS_READ_DID:
out = KISS_SECURITY_CHECK_SERIAL(KISS_READ_DID);
break;
case KISS_READ_MEM_ADDR:
if (variant_validate_is_within_flash_logger_events((void*)lparam) == 1) {
out = KISS_SECURITY_CHECK_SERIAL(KISS_SECURITY_READ_MEM_RESTRICTED);
}
else {
// it is assumed that DID handler checks if address to be read
// is located within area
out = KISS_SECURITY_CHECK_SERIAL(KISS_SECURITY_READ_MEM_UNRESTRICTED);
}
break;
case KISS_ERASE_STARTUP_CFG:
case KISS_PROGRAM_STARTUP_CFG:
out = KISS_SECURITY_CHECK_SERIAL(KISS_SECURITY_ERASE_PROGRAM_STARTUP_CONF);
break;
case KISS_GET_RUNNING_CONFIG:
out = KISS_SECURITY_CHECK_SERIAL(KISS_SECURITY_GET_RUNNING_CONF);
break;
default:
break;
}
}
return out;
}

Wyświetl plik

@ -94,8 +94,11 @@
#include "drivers/dallas.h"
#include <kiss_communication/kiss_communication.h>
#include <kiss_communication/kiss_communication_aprsmsg.h>
#include <etc/kiss_configuation.h>
#include <etc/dallas_temperature_limits.h>
#define SOH 0x01
//#include "variant.h"
@ -120,8 +123,8 @@
// 3 -> controller configuration status
// 4 -> wakeup events MSB, sleep events LSB
// 5 -> monitor
// 6 -> weather and telemetry timers & counters
// 6 -> last sleep time
// 7 -> weather and telemetry timers & counters
#define CONFIG_FIRST_RESTORED (1)
#define CONFIG_FIRST_FAIL_RESTORING (1 << 1)
@ -188,28 +191,31 @@ int32_t main_two_second_pool_timer = 2000;
//! ten second pool interval
int32_t main_ten_second_pool_timer = 10000;
//! one hour interval incremented inside one minute
int8_t main_one_hour_pool_timer = 60;
//! serial context for UART used to KISS
srl_context_t main_kiss_srl_ctx;
static srl_context_t main_kiss_srl_ctx;
//! serial context for UART used for comm with wx sensors
srl_context_t main_wx_srl_ctx;
static srl_context_t main_wx_srl_ctx;
#if defined(PARAMETEO)
//! serial context for communication with GSM module
srl_context_t main_gsm_srl_ctx;
static srl_context_t main_gsm_srl_ctx;
#endif
//! operation mode of USART1 (RS232 on RJ45 socket)
main_usart_mode_t main_usart1_kiss_mode = USART_MODE_UNDEF;
static main_usart_mode_t main_usart1_kiss_mode = USART_MODE_UNDEF;
//! operation mode of USART2 (RS485)
main_usart_mode_t main_usart2_wx_mode = USART_MODE_UNDEF;
static main_usart_mode_t main_usart2_wx_mode = USART_MODE_UNDEF;
//! function configuration for left button on ParaMETEO
configuration_button_function_t main_button_one_left;
static configuration_button_function_t main_button_one_left;
//! function configuration for right button on ParaMETEO
configuration_button_function_t main_button_two_right;
static configuration_button_function_t main_button_two_right;
//! a pointer to KISS context
srl_context_t* main_kiss_srl_ctx_ptr;
@ -251,12 +257,27 @@ char main_string_longitude[9];
char main_callsign_with_ssid[10];
uint8_t main_small_buffer[KISS_CONFIG_DIAGNOSTIC_BUFFER_LN];
#if defined(PARAMETEO)
//! Lenght of a buffer for KISS diagnostic request
#define MAIN_KISS_FROM_MESSAGE_LEN 33
//! KISS (diagnostic) request decoded from APRS message
static uint8_t main_kiss_from_message[MAIN_KISS_FROM_MESSAGE_LEN];
static uint8_t main_kiss_from_message_ln = 0;
//! binary response to DID request from APRS message
static uint8_t main_kiss_response_message[32];
static uint8_t main_kiss_response_message_ln = 0;
#endif
char main_symbol_f = '/';
char main_symbol_s = '#';
//! global variable used to store return value from various functions
volatile uint8_t retval = 100;
volatile int retval = 100;
uint16_t buffer_len = 0;
@ -287,6 +308,10 @@ telemetry_description_t main_telemetry_description = TELEMETRY_NOTHING;
char after_tx_lock;
const float main_test_float = 123.4f;
const char main_test_string[11] = "1234556aaa\0";
unsigned short rx10m = 0, tx10m = 0, digi10m = 0, digidrop10m = 0, kiss10m = 0;
static void message_callback(struct AX25Msg *msg) {
@ -312,6 +337,225 @@ const char * post_content = "{\
//#define SERIAL_TX_TEST_MODE
static void main_set_ax25_my_callsign(AX25Call * call) {
if (variant_validate_is_within_ram(call)) {
strncpy(call->call, main_config_data_basic->callsign, 6);
call->ssid = main_config_data_basic->ssid;
}
}
static void main_copy_ax25_call(AX25Call * to, AX25Call * from) {
if (variant_validate_is_within_ram(to)) {
strncpy(to->call, from->call, 6);
to->ssid = from->ssid;
}
}
#if defined(STM32L471xx)
/**
* Piece of code refactored from 'main' function responsible for pooling
* @param gsm_srl_ctx_ptr
* @param gsm_state
* @param trigger_message_ack
* @param received_message
* @param from_message
* @param from_message_ln
* @param response_message
* @param message_for_transmitting
* @param trigger_send_message
* @param trigger_gsm_status
* @param trigger_gsm_aprsis_counters_packet
* @param trigger_gsm_loginstring_packet
* @param trigger_gsm_telemetry_values
* @param trigger_gsm_telemetry_descriptions
* @param telemetry_description
* @param config_data_mode
* @param config_data_basic
* @param callsign_with_ssid
* @param own_aprs_msg
*/
static void main_gsm_pool_handler(
srl_context_t *const gsm_srl_ctx_ptr, // 1
gsm_sim800_state_t *const gsm_state, // 2
uint8_t *const trigger_message_ack, // 3
message_t *const received_message, // 4
uint8_t *const from_message, // 5
uint8_t *const from_message_ln, // 6
uint8_t *const response_message, // 7
message_t *const message_for_transmitting, // 8
uint8_t *const trigger_send_message, // 9
uint8_t *const trigger_gsm_status, // 10
uint8_t *const trigger_gsm_aprsis_counters_packet, // 11
uint8_t *const trigger_gsm_loginstring_packet, // 12
uint8_t *const trigger_gsm_telemetry_values, // 13
uint8_t *const trigger_gsm_telemetry_descriptions, // 14
telemetry_description_t *const telemetry_description, // 15
const config_data_mode_t *const config_data_mode, // 16
const config_data_basic_t *const config_data_basic, // 17
const char *const callsign_with_ssid, // 18
char *const own_aprs_msg ) { // 19
// if data has been received
if (gsm_srl_ctx_ptr->srl_rx_state == SRL_RX_DONE || gsm_srl_ctx_ptr->srl_rx_state == SRL_RX_ERROR) {
// receive callback for communicatio with the modem
gsm_sim800_rx_done_event_handler(gsm_srl_ctx_ptr, gsm_state);
}
if (gsm_srl_ctx_ptr->srl_tx_state == SRL_TX_IDLE) {
gsm_sim800_tx_done_event_handler(gsm_srl_ctx_ptr, gsm_state);
}
// if message ACK has been scheduled
if (*trigger_message_ack == 1) {
// if TCP/IP connection is not busy and received message comes from APRS-IS
if ((received_message->source == MESSAGE_SOURCE_APRSIS || received_message->source == MESSAGE_SOURCE_APRSIS_HEXCNTR)
&& gsm_sim800_tcpip_tx_busy() == 0) {
// clear ACK request
*trigger_message_ack = 0;
// create and send ACK for this message
aprsis_send_ack_for_message(received_message);
received_message->source = MESSAGE_SOURCE_UNINITIALIZED;
// decode message, do it after ACK is scheduled to be sure about right sequence
const kiss_communication_transport_t type = kiss_communication_aprsmsg_check_type(received_message->content, MESSAGE_MAX_LENGHT);
// decode HEXSTRING
if (type == KISS_TRANSPORT_HEXSTRING) {
*from_message_ln = kiss_communication_aprsmsg_decode_hexstring(received_message->content, received_message->content_ln, from_message + 1, MAIN_KISS_FROM_MESSAGE_LEN - 1);
}
else {
// zero message lenght if message cannot be decoded for some reason
*from_message_ln = 0;
}
// if KISS request has been parsed from APRS message
if (*from_message_ln != 0) {
// put artificial FEND at the begining of a buffer to make it compatible with 'kiss_parse_received'
*(main_kiss_from_message) = FEND;
#define KISS_RESPONSE_MESSAGE_LN retval
// parse KISS request
KISS_RESPONSE_MESSAGE_LN = kiss_parse_received(from_message, *from_message_ln, NULL, NULL, response_message, MAIN_KISS_FROM_MESSAGE_LEN);
// if a response was generated
if (KISS_RESPONSE_MESSAGE_LN > 0) {
// check if a beginning and an end of generated response contains FEND.
if ((*(response_message) == FEND) && (*(response_message + 1) == NONSTANDARD) && (*(response_message + KISS_RESPONSE_MESSAGE_LN - 1) == FEND)) {
// if yes encode the response w/o them
message_for_transmitting->content_ln = kiss_communication_aprsmsg_encode_hexstring(response_message + 2, KISS_RESPONSE_MESSAGE_LN - 3, message_for_transmitting->content, MESSAGE_MAX_LENGHT);
}
else {
// if response doesn't contain FEND at the begining and the end just
message_for_transmitting->content_ln = kiss_communication_aprsmsg_encode_hexstring(response_message, KISS_RESPONSE_MESSAGE_LN, message_for_transmitting->content, MESSAGE_MAX_LENGHT);
}
// put source and destination callsign
main_set_ax25_my_callsign(&message_for_transmitting->from);
main_copy_ax25_call(&message_for_transmitting->to, &received_message->from);
message_for_transmitting->source = MESSAGE_SOURCE_APRSIS;
// response is done, trigger sending it
*trigger_send_message = 1;
}
else if (KISS_RESPONSE_MESSAGE_LN == KISS_COMM_RESULT_UNKNOWN_DIAG_SERV) {
// assemble a response with NRC 'unknown diagnostics service'
KISS_RESPONSE_MESSAGE_LN = kiss_nrc_response_fill_unknown_service(response_message);
message_for_transmitting->content_ln = kiss_communication_aprsmsg_encode_hexstring(response_message + 2, KISS_RESPONSE_MESSAGE_LN - 3, message_for_transmitting->content, MESSAGE_MAX_LENGHT);
// put source and destination callsign
main_set_ax25_my_callsign(&message_for_transmitting->from);
main_copy_ax25_call(&message_for_transmitting->to, &received_message->from);
message_for_transmitting->source = MESSAGE_SOURCE_APRSIS;
// response is done, trigger sending it
*trigger_send_message = 1;
}
}
}
else if (received_message->source == MESSAGE_SOURCE_RADIO) {
}
}
if (gsm_sim800_tcpip_tx_busy() == 0) {
if (*trigger_send_message == 1 && message_for_transmitting->source == MESSAGE_SOURCE_APRSIS) {
*trigger_send_message = 0;
retval = message_encode(message_for_transmitting, (uint8_t*)own_aprs_msg, OWN_APRS_MSG_LN, MESSAGE_SOURCE_APRSIS);
aprsis_send_any_string_buffer(own_aprs_msg, retval);
}
else if (*trigger_gsm_status == 1) {
*trigger_gsm_status = 0;
aprsis_send_gsm_status((const char *)callsign_with_ssid);
}
// if GSM status message is triggered and GSM module is not busy transmitting something else
else if (*trigger_gsm_aprsis_counters_packet == 1) {
*trigger_gsm_aprsis_counters_packet = 0;
aprsis_send_server_comm_counters((const char *)callsign_with_ssid);
}
// if loginstring packet (APRS status packet with loginstring received from a server)
// is triggered and GSM module is not busy
else if (*trigger_gsm_loginstring_packet == 1) {
*trigger_gsm_loginstring_packet = 0;
aprsis_send_loginstring((const char *)callsign_with_ssid, system_is_rtc_ok(), rte_main_battery_voltage);
}
// if telemetry packet is triggerend
else if (*trigger_gsm_telemetry_values == 1) {
*trigger_gsm_telemetry_values = 0;
aprsis_send_telemetry(1u, (const char *)callsign_with_ssid);
}
else if (*trigger_gsm_telemetry_descriptions == 1) {
// check if this ought to be first telemetry description in sequence
if (*telemetry_description == TELEMETRY_NOTHING) {
// if yes check if victron telemetry is enabled
if (config_data_mode->victron != 0) {
// set the first packet accordingly
*telemetry_description = TELEMETRY_PV_PARM;
}
else if (config_data_mode->digi_viscous != 0) {
*telemetry_description = TELEMETRY_VISCOUS_PARAM;
}
else {
*telemetry_description = TELEMETRY_NORMAL_PARAM;
}
}
// assemble and sent a telemetry description packet
*telemetry_description = aprsis_send_description_telemetry(1u, *telemetry_description, config_data_basic, config_data_mode, (const char *)callsign_with_ssid);
// if there is nothing to send
if (*telemetry_description == TELEMETRY_NOTHING) {
*trigger_gsm_telemetry_descriptions = 0;
}
}
}
}
#endif
/**
* Just a main function
* @param argc
* @param argv
* @return
*/
int main(int argc, char* argv[]){
int32_t ln = 0;
@ -416,6 +660,8 @@ int main(int argc, char* argv[]){
#endif
}
nvm_event_log_find_first_oldest();
// if first section has wrong CRC and it hasn't been restored before
if ((main_crc_result & 0x01) == 0 && (backup_reg_get_configuration() & CONFIG_FIRST_FAIL_RESTORING) == 0) {
// restore default configuration
@ -1232,71 +1478,27 @@ int main(int argc, char* argv[]){
// if GSM communication is enabled
if (main_config_data_mode->gsm == 1 && io_get_cntrl_vbat_g() == 1) {
// if data has been received
if (main_gsm_srl_ctx_ptr->srl_rx_state == SRL_RX_DONE || main_gsm_srl_ctx_ptr->srl_rx_state == SRL_RX_ERROR) {
// receive callback for communicatio with the modem
gsm_sim800_rx_done_event_handler(main_gsm_srl_ctx_ptr, &main_gsm_state);
//srl_reset(main_gsm_srl_ctx_ptr);
}
if (main_gsm_srl_ctx_ptr->srl_tx_state == SRL_TX_IDLE) {
gsm_sim800_tx_done_event_handler(main_gsm_srl_ctx_ptr, &main_gsm_state);
}
if (rte_main_trigger_gsm_status_gsm == 1 && gsm_sim800_tcpip_tx_busy() == 0) {
rte_main_trigger_gsm_status_gsm = 0;
aprsis_send_gpsstatus((const char *)&main_callsign_with_ssid);
}
// if GSM status message is triggered and GSM module is not busy transmitting something else
if (rte_main_trigger_gsm_status_packet == 1 && gsm_sim800_tcpip_tx_busy() == 0) {
rte_main_trigger_gsm_status_packet = 0;
aprsis_send_server_conn_status((const char *)&main_callsign_with_ssid);
}
// if loginstring packet (APRS status packet with loginstring received from a server)
// is triggered and GSM module is not busy
if (rte_main_trigger_gsm_loginstring_packet == 1 && gsm_sim800_tcpip_tx_busy() == 0) {
rte_main_trigger_gsm_loginstring_packet = 0;
aprsis_send_loginstring((const char *)&main_callsign_with_ssid, system_is_rtc_ok(), rte_main_battery_voltage);
}
if (rte_main_trigger_gsm_telemetry_values == 1 && gsm_sim800_tcpip_tx_busy() == 0) {
rte_main_trigger_gsm_telemetry_values = 0;
aprsis_send_telemetry(1u, (const char *)&main_callsign_with_ssid);
}
if (rte_main_trigger_gsm_telemetry_descriptions == 1 && gsm_sim800_tcpip_tx_busy() == 0) {
// check if this ought to be first telemetry description in sequence
if (main_telemetry_description == TELEMETRY_NOTHING) {
// if yes check if victron telemetry is enabled
if (main_config_data_mode->victron != 0) {
// set the first packet accordingly
main_telemetry_description = TELEMETRY_PV_PARM;
}
else if (main_config_data_mode->digi_viscous != 0) {
main_telemetry_description = TELEMETRY_VISCOUS_PARAM;
}
else {
main_telemetry_description = TELEMETRY_NORMAL_PARAM;
}
}
// assemble and sent a telemetry description packet
main_telemetry_description = aprsis_send_description_telemetry(1u, main_telemetry_description, main_config_data_basic, main_config_data_mode, (const char *)&main_callsign_with_ssid);
// if there is nothing to send
if (main_telemetry_description == TELEMETRY_NOTHING) {
rte_main_trigger_gsm_telemetry_descriptions = 0;
}
}
// pool all stuff related
main_gsm_pool_handler(
main_gsm_srl_ctx_ptr, // 1
&main_gsm_state, // 2
&rte_main_trigger_message_ack, // 3
&rte_main_received_message, // 4
main_kiss_from_message, // 5
&main_kiss_from_message_ln, // 6
main_kiss_response_message, // 7
&rte_main_message_for_transmitting,
&rte_main_trigger_send_message, // 9
&rte_main_trigger_gsm_status, // 10
&rte_main_trigger_gsm_aprsis_counters_packet,
&rte_main_trigger_gsm_loginstring_packet,
&rte_main_trigger_gsm_telemetry_values,
&rte_main_trigger_gsm_telemetry_descriptions,
&main_telemetry_description, // 15
main_config_data_mode, // 16
main_config_data_basic, // 17
main_callsign_with_ssid, // 18
main_own_aprs_msg);
}
#endif
@ -1444,19 +1646,6 @@ int main(int argc, char* argv[]){
wx_get_all_measurements(main_config_data_wx_sources, main_config_data_mode, main_config_data_umb, main_config_data_rtu);
}
// check if there is a request to send ModbusRTU error status message
if (rte_main_trigger_modbus_status == 1 && main_modbus_rtu_master_enabled == 1) {
rtu_serial_get_status_string(&rte_rtu_pool_queue, main_wx_srl_ctx_ptr, main_own_aprs_msg, OWN_APRS_MSG_LN, &main_own_aprs_msg_len);
ax25_sendVia(&main_ax25, main_own_path, main_own_path_ln, main_own_aprs_msg, main_own_aprs_msg_len);
afsk_txStart(&main_afsk);
rte_main_trigger_modbus_status = 0;
}
backup_reg_set_monitor(3);
main_wx_sensors_pool_timer = 65500;
@ -1486,18 +1675,62 @@ int main(int argc, char* argv[]){
}
if (main_config_data_gsm->aprsis_enable != 0) {
if ((main_config_data_gsm->aprsis_enable != 0) && (main_config_data_mode->gsm == 1)) {
if (pwr_save_is_currently_cutoff() == 0) {
// this checks when APRS-IS was alive last time and when any packet
// has been sent to the server.
const int i_am_ok_with_aprsis = aprsis_check_connection_attempt_alive();
if (i_am_ok_with_aprsis != 0) {
// increase counter stored in RTC backup register
backup_reg_increment_aprsis_check_reset();
// trigger a restart
NVIC_SystemReset();
}
}
}
#endif
if (main_config_data_mode->wx != 0) {
if (rte_wx_check_weather_measurements() == 0) {
backup_reg_increment_weather_measurements_check_reset();
NVIC_SystemReset();
}
if (rte_wx_dallas_degraded_counter > DALLAS_MAX_LIMIT_OF_DEGRADED) {
backup_reg_increment_dallas_degraded_reset();
rte_main_reboot_req = 1;
}
}
/**
* ONE HOUR POOLING
*/
if (--main_one_hour_pool_timer < 0) {
main_one_hour_pool_timer = 60;
#if defined(STM32L471xx)
// check if RTC is working correctly
if (system_is_rtc_ok() == 0) {
backup_reg_increment_is_rtc_ok_check_reset();
rte_main_reboot_req = 1;
}
if ((main_config_data_gsm->aprsis_enable != 0) && (main_config_data_mode->gsm == 1)) {
rte_main_trigger_gsm_aprsis_counters_packet = 1;
}
#endif
}
main_one_minute_pool_timer = 60000;
}
@ -1583,8 +1816,12 @@ int main(int argc, char* argv[]){
*/
if (main_two_second_pool_timer < 10) {
if (configuration_get_inhibit_wx_pwr_handle() == 0) {
wx_pwr_switch_periodic_handle();
if (main_config_data_mode->wx != 0) {
if (configuration_get_inhibit_wx_pwr_handle() == 0) {
wx_pwr_switch_periodic_handle();
}
wx_check_force_i2c_reset();
}
#ifdef PARAMETEO
@ -1593,8 +1830,6 @@ int main(int argc, char* argv[]){
}
#endif
wx_check_force_i2c_reset();
#ifdef PARAMETEO
max31865_pool();
#endif
@ -1673,15 +1908,17 @@ int main(int argc, char* argv[]){
rte_wx_umb_qf = umb_get_current_qf(&rte_wx_umb_context, master_time);
}
#ifdef STM32L471xx
if (io_get_cntrl_vbat_s() == 1) {
#else
if (io_get_5v_isol_sw___cntrl_vbat_s() == 1) {
#endif
// pool anemometer only when power is applied
wx_pool_anemometer(main_config_data_wx_sources, main_config_data_mode, main_config_data_umb, main_config_data_rtu);
}
if (main_config_data_mode->wx != 0) {
#ifdef STM32L471xx
if (io_get_cntrl_vbat_s() == 1) {
#else
if (io_get_5v_isol_sw___cntrl_vbat_s() == 1) {
#endif
// pool anemometer only when power is applied
wx_pool_anemometer(main_config_data_wx_sources, main_config_data_mode, main_config_data_umb, main_config_data_rtu);
}
}
if (main_davis_serial_enabled == 1) {

124
src/nvm.c
Wyświetl plik

@ -6,6 +6,7 @@
*/
#include "nvm.h"
#include "memory_map.h"
#define KB *1024
@ -22,25 +23,28 @@
#endif
//#define NVM_MEASUREMENT_OFFSET 0
//!< Size of NVM data logger in pages
#define NVM_MEASUREMENT_PAGES_USED 96
//#define NVM_MEASUREMENT_PAGES_USED 96
//!< Size of NVM data logger in bytes
#define NVM_MEASUREMENT_MAXIMUM_SIZ (NVM_PAGE_SIZE * NVM_MEASUREMENT_PAGES_USED)
#define NVM_MEASUREMENT_MAXIMUM_SIZ (NVM_PAGE_SIZE * nvm_measurement_page_used)
//!< A macro to calculate start address of last page for NVM data logger
#define START_OF_LAST_NVM_PAGE (nvm_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ - NVM_PAGE_SIZE)
#define START_OF_LAST_NVM_PAGE (nvm_measurement_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ - NVM_PAGE_SIZE)
//!< Base address of NVM data logger for device with 1MB of Flash
#define LOGGER_BASE_ADDRESS_1MB_DEVICE 0x08080000 // Page 256 from 511
#define LOGGER_BASE_ADDRESS_1MB_DEVICE MEMORY_MAP_MEASUREMENT_1M_START // Page 256 from 352
#define LOGGER_BASE_ADDRESS_512K_DEVICE 0x08040000 // Page 256 from 383 (warning! there are no pages within 128-255)
uint32_t nvm_base_address = 0;
#define LOGGER_BASE_ADDRESS_512K_DEVICE MEMORY_MAP_MEASUREMENT_512K_START // Page 130 from 178
uint32_t nvm_measurement_base_address = 0;
//!< Start address of flash page used currently for NVM
uint32_t nvm_current_page_address = 0;
uint32_t nvm_measurement_current_page_address = 0;
//!< How many
uint8_t nvm_measurement_page_used = 0;
/**
* Pointer to
@ -65,22 +69,27 @@ nvm_state_result_t nvm_general_state = NVM_UNINITIALIZED;
} \
} \
/**
*
*/
void nvm_measurement_init(void) {
uint8_t data = 0;
#if defined(STM32L471xx)
// flash operation result
FLASH_Status flash_status = 0;
#if defined(STM32L471xx)
// check current flash size
if (FLASH_SIZE == 1024 KB) {
// 1024KB
nvm_base_address = LOGGER_BASE_ADDRESS_1MB_DEVICE;
nvm_measurement_base_address = LOGGER_BASE_ADDRESS_1MB_DEVICE;
nvm_measurement_page_used = MEMORY_MAP_MEASUREMENT_1M_PAGES;
}
else if (FLASH_SIZE == 512 KB) {
// 512KB
nvm_base_address = LOGGER_BASE_ADDRESS_512K_DEVICE;
nvm_measurement_base_address = LOGGER_BASE_ADDRESS_512K_DEVICE;
nvm_measurement_page_used = MEMORY_MAP_MEASUREMENT_512K_PAGES;
}
else {
// unknown device ??
@ -90,7 +99,7 @@ void nvm_measurement_init(void) {
}
// find the first non-erased page
for (uint32_t i = nvm_base_address; i < (nvm_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ); i += NVM_PAGE_SIZE) {
for (uint32_t i = nvm_measurement_base_address; i < (nvm_measurement_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ); i += NVM_PAGE_SIZE) {
// get the content of first byte
data = *((uint8_t*) i);
@ -161,6 +170,11 @@ void nvm_measurement_init(void) {
#endif
}
/**
*
* @param data
* @return
*/
nvm_state_result_t nvm_measurement_store(nvm_measurement_t * data) {
nvm_state_result_t out = NVM_OK;
@ -178,7 +192,7 @@ nvm_state_result_t nvm_measurement_store(nvm_measurement_t * data) {
if (nvm_general_state == NVM_NO_SPACE_LEFT) {
// erase first page of NVM flash area
nvm_data_ptr = (uint8_t*)nvm_base_address;
nvm_data_ptr = (uint8_t*)nvm_measurement_base_address;
flash_status = FLASH_ErasePage(nvm_data_ptr);
@ -234,7 +248,7 @@ nvm_state_result_t nvm_measurement_store(nvm_measurement_t * data) {
nvm_data_ptr += NVM_WRITE_BYTE_ALIGN;
// and check if an end has
if ((uint32_t)nvm_data_ptr < nvm_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ) {
if ((uint32_t)nvm_data_ptr < nvm_measurement_base_address + NVM_MEASUREMENT_MAXIMUM_SIZ) {
;
}
else {
@ -254,6 +268,9 @@ nvm_state_result_t nvm_measurement_store(nvm_measurement_t * data) {
return out;
}
/**
*
*/
void nvm_erase_all(void) {
#if defined(STM32L471xx)
@ -274,7 +291,7 @@ void nvm_erase_all(void) {
return;
}
for (int i = 0; i < NVM_MEASUREMENT_PAGES_USED; i++) {
for (int i = 0; i < nvm_measurement_page_used; i++) {
FLASH_ErasePage(base_address + (i * NVM_PAGE_SIZE));
}
@ -282,6 +299,9 @@ void nvm_erase_all(void) {
#endif
}
/**
*
*/
void nvm_test_prefill(void) {
#if defined(STM32L471xx)
@ -333,7 +353,7 @@ void nvm_test_prefill(void) {
return;
}
for (int i = 11; i < NVM_MEASUREMENT_PAGES_USED; i++) {
for (int i = 11; i < nvm_measurement_page_used; i++) {
// flash programming must be 64 bit (8 bytes) aligned
for (int j = 0; j < NVM_PAGE_SIZE / 8; j++) {
*(base_address++) = 0x12345678;
@ -350,3 +370,73 @@ void nvm_test_prefill(void) {
#endif
}
/**
*
* @param oldest
* @param newest
*/
void nvm_event_log_find_first_oldest_newest(event_log_t** oldest, event_log_t** newest) {
// pointer to last, non null and non TIMESYNC entry
event_log_t* last = NULL;
// size of single log entry
const uint8_t log_entry_size = sizeof(event_log_t);
// how any events could be stored in NVM flash memory
const uint16_t log_entries = (MEMORY_MAP_EVENT_LOG_END - MEMORY_MAP_EVENT_LOG_START) / log_entry_size;
// lowest date found within events in NVM
uint32_t lowest_date = 0xFFFFFFFFu;
uint32_t lowest_time = 0xFFFFFFFFu;
uint32_t highest_date = 0x00000000u;
uint32_t highest_time = 0x00000000u;
// sanity check if everything is set correctly
if ((MEMORY_MAP_EVENT_LOG_END - MEMORY_MAP_EVENT_LOG_START) % log_entry_size != 0 ) {
return;
}
// iterate through all event log flash area
for (int i = 0; i < log_entries; i++) {
// set pointer to currently checked event
const event_log_t* const ptr = (MEMORY_MAP_EVENT_LOG_START + (log_entry_size) * i);
// skip erased memory
if (ptr->event_id == 0xFFU && ptr->event_master_time == 0xFFFFFFFFU) {
continue;
}
// look for timesync event created at bootup
if (ptr->event_id == EVENT_TIMESYNC && ptr->wparam == 0x77) {
// check if this timestamp is before the oldest found before
if (lowest_date > ptr->lparam && lowest_time > ptr->lparam2) {
// set this as the oldest
lowest_date = ptr->lparam;
lowest_time = ptr->lparam2;
// timestamp are always created after the first one after power up, so that
// with oldest RTC date and time will be the oldest in general
*oldest = ptr;
if (last != NULL) {
*newest = last;
}
}
}
else {
// store a pointer to last non-null and non-timesync event
last = ptr;
}
*newest = last;
}
}

Wyświetl plik

@ -90,7 +90,9 @@ void packet_tx_init(uint8_t meteo_interval, uint8_t beacon_interval, config_data
packet_tx_beacon_interval = beacon_interval;
#ifdef PARAMETEO
backup_reg_get_packet_counters(&packet_tx_beacon_counter, &packet_tx_meteo_counter, &packet_tx_meteo_gsm_counter);
#endif
if (powersave == PWSAVE_AGGRESV) {
// if user selected aggressive powersave mode the meteo counter must be set back to zero
@ -242,7 +244,9 @@ void packet_tx_handler(const config_data_basic_t * const config_basic, const con
// increase these counters only when WX is enabled
packet_tx_meteo_counter++;
packet_tx_meteo_kiss_counter++;
#ifdef PARAMETEO
packet_tx_meteo_gsm_counter++;
#endif
}
// check if there is a time to send own beacon
@ -369,7 +373,7 @@ void packet_tx_handler(const config_data_basic_t * const config_basic, const con
// ASSEMBLY QUALITY FACTORS
// if there weren't any erros related to the communication with DS12B20 from previous function call
// if there weren't any errors related to the communication with DS12B20 from previous function call
if (rte_wx_error_dallas_qf == DALLAS_QF_UNKNOWN) {
dallas_qf = rte_wx_current_dallas_qf; // it might be DEGRADATED so we need to copy a value directly
@ -579,17 +583,18 @@ void packet_tx_handler(const config_data_basic_t * const config_basic, const con
else {
packet_tx_trigger_tcp = 0;
}
if (system_is_rtc_ok() == 0) {
rte_main_reboot_req = 1;
}
#endif
packet_tx_telemetry_descr_counter = 0;
}
#ifdef PARAMETEO
// store counters in backup registers
backup_reg_set_packet_counters(packet_tx_beacon_counter, packet_tx_meteo_counter, packet_tx_meteo_gsm_counter);
#else
// store counters in backup registers
backup_reg_set_packet_counters(packet_tx_beacon_counter, packet_tx_meteo_counter, 0);
#endif
#ifdef STM32L471xx
// if powersave mode allow to sent extensive status messages
@ -624,7 +629,9 @@ void packet_tx_get_current_counters(packet_tx_counter_values_t * out) {
if (out != 0x00) {
out->beacon_counter = packet_tx_beacon_counter;
out->wx_counter = packet_tx_meteo_counter;
#ifdef PARAMETEO
out->gsm_wx_counter = packet_tx_meteo_gsm_counter;
#endif
out->telemetry_counter = packet_tx_telemetry_counter;
out->telemetry_desc_counter = packet_tx_telemetry_descr_counter;
out->kiss_counter = packet_tx_meteo_kiss_counter;
@ -649,13 +656,17 @@ void packet_tx_set_current_counters(packet_tx_counter_values_t * in) {
if (in->kiss_counter != 0)
packet_tx_meteo_kiss_counter = in->kiss_counter;
#ifdef PARAMETEO
if (in->gsm_wx_counter != 0)
packet_tx_meteo_gsm_counter = in->gsm_wx_counter;
#endif
}
else {
packet_tx_beacon_counter = 0;
packet_tx_meteo_counter = 2;
#ifdef PARAMETEO
packet_tx_meteo_gsm_counter = 0;
#endif
packet_tx_telemetry_counter = 0;
packet_tx_telemetry_descr_counter = 10;
packet_tx_meteo_kiss_counter = 0;

Wyświetl plik

@ -14,12 +14,22 @@ uint8_t rte_main_reboot_req = 0;
uint8_t rte_main_boot_cycles = 0, rte_main_hard_faults = 0;
uint8_t rte_main_trigger_status = 0;
uint8_t rte_main_trigger_modbus_status = 0;
uint8_t rte_main_trigger_wx_packet = 0;
//!< message received from APRS-IS or RF radio network
message_t rte_main_received_message;
//!< message to be send via APRS-IS or RF radio network
message_t rte_main_message_for_transmitting;
//!< Trigger message ACK preparing and sending
uint8_t rte_main_trigger_message_ack = 0;
uint8_t rte_main_trigger_send_message = 0;
#ifdef PARAMETEO
uint8_t rte_main_trigger_gsm_status_packet = 0;
uint8_t rte_main_trigger_gsm_aprsis_counters_packet = 0;
//!< Trigger sending status packet with received APRS is login string
uint8_t rte_main_trigger_gsm_loginstring_packet = 0;
@ -31,7 +41,7 @@ uint8_t rte_main_trigger_gsm_telemetry_values = 0;
uint8_t rte_main_trigger_gsm_telemetry_descriptions = 0;
//!<
uint8_t rte_main_trigger_gsm_status_gsm = 0;
uint8_t rte_main_trigger_gsm_status = 0;
//!< Trigger some reinitialization after waking up from deep sleep
uint8_t rte_main_woken_up = 0;

Wyświetl plik

@ -9,6 +9,11 @@
#include <rte_wx.h>
#include <wx_handler.h>
#include "main.h"
#include "misc_config.h"
#ifndef RTE_WX_PROBLEMS_MAX_THRESHOLD
#define RTE_WX_PROBLEMS_MAX_THRESHOLD 20
#endif
/**
* A little word of explanataion:
@ -66,6 +71,7 @@ ms5611_qf_t rte_wx_ms5611_qf = MS5611_QF_UNKNOWN;
bme280_qf_t rte_wx_bme280_qf = BME280_QF_UKNOWN;
analog_wind_qf_t rte_wx_wind_qf = AN_WIND_QF_UNKNOWN;
uint8_t rte_wx_humidity_available = 0;
uint8_t rte_wx_dallas_degraded_counter = 0;
umb_frame_t rte_wx_umb;
@ -79,9 +85,15 @@ uint8_t rte_wx_davis_station_avaliable = 0;
uint8_t rte_wx_davis_loop_packet_avaliable = 0;
davis_loop_t rte_wx_davis_loop_content;
uint8_t rte_wx_problems_wind_buffers = 0; //!< Problems detected with buffers content
uint8_t rte_wx_problems_wind_values = 0; //!< Problems with values calculated from buffers content
void rte_wx_init(void) {
int i = 0;
rte_wx_problems_wind_buffers = 0;
rte_wx_problems_wind_values = 0;
for (; i < WIND_AVERAGE_LEN; i++) {
rte_wx_windspeed[i] = 0;
rte_wx_winddirection[i] = 0;
@ -114,3 +126,76 @@ void rte_wx_reset_last_measuremenet_timers(uint16_t parameter_type) {
;
}
}
/**
* This function checks if weather measurements looks to be valid and if they
* are changing over time. The function shall be called in one minute interval.
* @return
*/
int8_t rte_wx_check_weather_measurements(void) {
int8_t looks_good = 1;
uint8_t i = 0; // loop iterator
// go through wind direction buffer and checks if it contains the same value
for (i = 0; i < WIND_AVERAGE_LEN - 1; i++) {
if (rte_wx_winddirection[i] != rte_wx_winddirection[i + 1]) {
break;
}
}
// check if an end of the buffer has been reached
if (i >= WIND_AVERAGE_LEN - 1) {
rte_wx_problems_wind_buffers++;
}
// go through wind speed buffer and checks if it contains the same value
for (i = 0; i < WIND_AVERAGE_LEN - 1; i++) {
if (rte_wx_windspeed[i] != rte_wx_windspeed[i + 1]) {
break;
}
// break the loop if the windspeed is zero anywhere, not to reset
// periodically if wind sensor is not connected.
if (rte_wx_windspeed[i] == 0) {
break;
}
}
// check if an end of the buffer has been reached
if (i >= WIND_AVERAGE_LEN - 1) {
rte_wx_problems_wind_buffers++;
}
// check if average wind speed is different from zero and the same than gusts
if (rte_wx_average_windspeed != 0 &&
(rte_wx_average_windspeed == rte_wx_max_windspeed))
{
// if so a wind sensor had been blocked by icing very rapidly
// before next DMA interrupt so rte_wx_windspeed is also
// not updated at all
rte_wx_problems_wind_values++;
}
// check if wind direction equals exactly north (zero degrees)
if (rte_wx_average_winddirection == 0) {
// open wind direction input (anemometer disconnected) gives
// a reading of about 6 do 8 degrees. If it is stuck on zero
// the U->f converted or its reference clock generator
// might not work at all
rte_wx_problems_wind_values++;
}
else {
rte_wx_problems_wind_values = 0;
}
if (rte_wx_problems_wind_values > RTE_WX_PROBLEMS_MAX_THRESHOLD) {
looks_good = 0;
}
if (rte_wx_problems_wind_buffers > RTE_WX_PROBLEMS_MAX_THRESHOLD * 3) {
looks_good = 0;
}
return looks_good;
}

Wyświetl plik

@ -13,6 +13,8 @@
#include "main.h"
#include "memory_map.h"
#ifdef STM32F10X_MD_VL
#include <stm32f10x.h>
#include <stm32f10x_crc.h>
@ -25,7 +27,7 @@
#include <stm32l4xx_ll_crc.h>
#endif
/**
/** EBxx
* STM32L476RE, 512KB flash mem, last flash memory page
* 0x0807F800 - 0x0807FFFF; 2 K; Page 383
*
@ -36,9 +38,26 @@
*
*/
#define CONFIG_SECTION_FIRST_START 0x0801E800
#define CONFIG_SECTION_SECOND_START 0x0801F000
#define CONFIG_SECTION_DEFAULT_START 0x0801E000
/** ECxx
* STM32L476RE, 512KB flash mem, last flash memory page
* 0x0807F800 - 0x0807FFFF; 2 K; Page 383
*
* __config_section_default_start = 0x0803F000;
__config_section_first_start = 0x0803F800;
__config_section_second_start = 0x08040000;
__config_section_third_start = 0x0801F800;
*
*/
#ifdef STM32L471xx
#define CONFIG_SECTION_FIRST_START MEMORY_MAP_CONFIG_SECTION_FIRST_START //0x0803F000
#define CONFIG_SECTION_SECOND_START MEMORY_MAP_CONFIG_SECTION_SECOND_START //0x0803F800
#define CONFIG_SECTION_DEFAULT_START MEMORY_MAP_CONFIG_SECTION_DEFAULT_START //0x08040000
#else
#define CONFIG_SECTION_FIRST_START 0x0801E800 //0x0801E800
#define CONFIG_SECTION_SECOND_START 0x0801F000 //0x0801F000
#define CONFIG_SECTION_DEFAULT_START 0x0801E000 //0x0801E000
#endif
#define CONFIG_MODE_PGM_CNTR 0x0
#define CONFIG_MODE_OFSET 0x20 // Current size: 0x14, free: 0x0C
@ -56,6 +75,9 @@ const uint32_t * const config_section_first_start = (const uint32_t *)CONFIG_S
const uint32_t * const config_section_second_start = (const uint32_t *)CONFIG_SECTION_SECOND_START;
const uint32_t * const config_section_default_start = (const uint32_t *)CONFIG_SECTION_DEFAULT_START;
uint8_t config_engineering_1 = 0xFFU;
uint8_t config_engineering_2 = 0xFFU;
#ifdef PARAMETEO
#define STRUCT_COUNT 6
#endif
@ -638,6 +660,9 @@ void configuration_handler_load_configuration(configuration_handler_region_t reg
configuration_handler_loaded = region;
config_engineering_1 = main_config_data_basic->engineering1;
config_engineering_2 = main_config_data_basic->engineering2;
}
kiss_communication_nrc_t configuration_handler_erase_startup(void) {

Wyświetl plik

@ -7,8 +7,66 @@
#include "variant.h"
int variant_validate_is_within_ram(uint32_t address) {
if (address != 0x00) {
#ifdef STM32L471xx
#include <stm32l4xx.h>
#endif
#include "memory_map.h"
int variant_validate_is_within_ram(void * address) {
#ifdef STM32L471xx
uint32_t addr_value = (uint32_t)address;
if (addr_value > SRAM_BASE &&
addr_value < SRAM_BASE + SRAM1_SIZE_MAX) {
return 1;
}
else if (addr_value > SRAM2_BASE &&
addr_value < SRAM2_BASE + SRAM2_SIZE) {
return 1;
}
else {
return 0;
}
#else
return 1;
#endif
}
int variant_validate_is_within_sram2(void * address) {
uint32_t addr_value = (uint32_t)address;
if (addr_value > SRAM2_BASE &&
addr_value < SRAM2_BASE + SRAM2_SIZE) {
return 1;
}
else {
return 0;
}
}
int variant_validate_is_within_flash(void * address) {
#ifdef STM32L471xx
uint32_t addr_value = (uint32_t)address;
if (addr_value > FLASH_BASE &&
addr_value < MEMORY_MAP_FLASH_END) {
return 1;
}
else {
return 0;
}
#else
return 1;
#endif
}
int variant_validate_is_within_flash_logger_events(void * address) {
uint32_t addr_value = (uint32_t)address;
if (addr_value > MEMORY_MAP_CONFIG_END &&
addr_value < MEMORY_MAP_FLASH_END) {
return 1;
}
else {

Wyświetl plik

@ -180,7 +180,7 @@ void wx_pool_anemometer(const config_data_wx_sources_t * const config_sources, c
short i = 0;
uint8_t average_ln;
int32_t modbus_retval;
int32_t modbus_retval = MODBUS_RET_UNINITIALIZED;
uint16_t scaled_windspeed = 0;
//#ifdef STM32L471xx

Wyświetl plik

@ -19,8 +19,43 @@
#include <modbus_rtu/rtu_getters.h>
#include <modbus_rtu/rtu_return_values.h>
#include <etc/dallas_temperature_limits.h>
#define WX_MAX_TEMPERATURE_SLEW_RATE 4.0f
inline static int8_t wx_handler_temperature_check_slew(const float last, const float_average_t* average) {
// 0 -> OK
int8_t result = 0;
float avg = 0.0f;
// continue only if average circular buffer is completely full
if (float_get_nonfull(average) == 0) {
// get current average
avg = float_get_average(average);
// get difference
avg = avg - last;
// resuse result variable to save stack space
result = (int8_t)avg;
if (result < DALLAS_TEMPERATURE_NEG_SLEW) {
result = 1;
}
else if (result > DALLAS_TEMPERATURE_POS_SLEW) {
result = 1;
}
else {
result = 0;
}
}
return result;
}
int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const config_sources, const config_data_mode_t * const config_mode, const config_data_umb_t * const config_umb, const config_data_rtu_t * const config_rtu, float * output) {
@ -31,6 +66,8 @@ int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const co
float temperature = 0.0f;
float dallas_temperature = 0.0f;
// choose main temperature source from the configuration. main sensor is something which is used to send data though aprs
switch(config_sources->temperature) {
// controller measures two temperatures
@ -69,7 +106,14 @@ int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const co
// this function has blockin I/O which also adds a delay required by MS5611
// sensor to finish data acquisition after the pressure measurement
// is triggered.
wx_get_temperature_dallas();
dallas_temperature = dallas_query(&rte_wx_current_dallas_qf);
// check against excessive slew rate
const uint8_t dallas_slew_exceeded = wx_handler_temperature_check_slew(dallas_temperature, &rte_wx_dallas_average);
if (dallas_slew_exceeded > 0) {
rte_wx_current_dallas_qf = DALLAS_QF_NOT_AVALIABLE;
}
#ifdef STM32L471xx
// measure temperature from PT100 sensor if it is selected as main temperature sensor
@ -81,11 +125,32 @@ int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const co
}
#endif
if (config_sources->temperature == WX_SOURCE_INTERNAL && rte_wx_current_dallas_qf != DALLAS_QF_NOT_AVALIABLE) {
if (config_sources->temperature == WX_SOURCE_INTERNAL && rte_wx_current_dallas_qf == DALLAS_QF_FULL) {
// updating last good measurement time
wx_last_good_temperature_time = master_time;
// include current temperature into the average
float_average(dallas_temperature, &rte_wx_dallas_average);
temperature = float_get_average(&rte_wx_dallas_average);
#if defined(STM32L471xx)
rte_wx_temperature_average_dallas = (int16_t)(temperature * 10.0f);
#endif
parameter_result = parameter_result | WX_HANDLER_PARAMETER_RESULT_TEMPERATURE;
}
else if (config_sources->temperature == WX_SOURCE_INTERNAL && rte_wx_current_dallas_qf == DALLAS_QF_DEGRADATED) {
// if there were a communication error set the error to unavaliable
rte_wx_error_dallas_qf = DALLAS_QF_NOT_AVALIABLE;
// increase degraded quality factor counter
rte_wx_dallas_degraded_counter++;
}
else if (config_sources->temperature == WX_SOURCE_INTERNAL && rte_wx_current_dallas_qf == DALLAS_QF_NOT_AVALIABLE) {
// if there were a communication error set the error to unavaliable
rte_wx_error_dallas_qf = DALLAS_QF_NOT_AVALIABLE;
}
break;
}
@ -135,60 +200,9 @@ int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const co
*output = temperature;
}
//#if defined(STM32L471xx)
// // get modbus temperature reading regardless if it has been chosen as main
// if (config_mode->wx_modbus == 1) {
// rtu_get_temperature(&rte_wx_temperature_average_modbus, config_rtu);
// }
//
// // get temperature from dallas sensor if this isn't a sensor of choice
// if (config_sources->temperature != WX_SOURCE_INTERNAL) {
// wx_get_temperature_dallas();
// }
//
// rte_wx_temperature_average_internal = (int16_t)(rte_wx_temperature_internal * 10.0f);
//#endif
return parameter_result;
}
int32_t wx_get_temperature_dallas() {
int32_t output = 0;
float temperature = 0.0f;
// get the value from dallas one-wire sensor
temperature = dallas_query(&rte_wx_current_dallas_qf);
// checking if communication was successfull
if (temperature != -128.0f) {
// include current temperature into the average
float_average(temperature, &rte_wx_dallas_average);
// update the current temperature with current average
// rte_wx_temperature_average_external_valid = float_get_average(&rte_wx_dallas_average);
// updating last good measurement time
wx_last_good_temperature_time = master_time;
#if defined(STM32L471xx)
rte_wx_temperature_average_dallas = (int16_t)(rte_wx_temperature_average_external_valid * 10.0f);
#endif
}
else {
// if there were a communication error set the error to unavaliable
rte_wx_error_dallas_qf = DALLAS_QF_NOT_AVALIABLE;
// set the output value
output = -1;
}
return output;
}
int32_t wx_get_temperature_ms5611(float * const temperature) {
int32_t return_value = 0;

Wyświetl plik

Wyświetl plik

@ -6,6 +6,7 @@
#include "main_master_time.h"
#include "ax25_t.h"
#include "cfifo.h"
#include "afsk.h"
@ -50,15 +51,15 @@
struct AX25Msg; // fwd declaration
/**
* Type for AX25 messages callback.
*/
typedef void (*ax25_callback_t)(struct AX25Msg *ax25_rxed_frame);
/**
* Type for channel free wait timeout callback
* Create an AX25Call structure on the fly.
* \param str callsign, can be 6 characters or shorter.
* \param id ssid associated with the callsign.
*/
typedef void (*ax25_ch_free_timeout_callback_t)(void);
#define AX25_CALL(str, id) {.call = (str), .ssid = (id) }
#define AX25_PATH(dst, src, ...) { dst, src, ## __VA_ARGS__ }
typedef struct AX25Ctx
{
@ -81,54 +82,6 @@ typedef struct AX25Ctx
} AX25Ctx;
/**
* AX25 Call sign.
*/
typedef struct AX25Call
{
char call[6]; ///< Call string, max 6 character
uint8_t ssid; ///< SSID (secondary station ID) for the call
} AX25Call;
/**
* Create an AX25Call structure on the fly.
* \param str callsign, can be 6 characters or shorter.
* \param id ssid associated with the callsign.
*/
#define AX25_CALL(str, id) {.call = (str), .ssid = (id) }
#define AX25_PATH(dst, src, ...) { dst, src, ## __VA_ARGS__ }
/**
* Maximum number of Repeaters in a AX25 message.
*/
#define AX25_MAX_RPT 8
/**
* AX25 Message.
* Used to handle AX25 sent/received messages.
*/
typedef struct AX25Msg
{
AX25Call src; ///< Source adress
AX25Call dst; ///< Destination address
AX25Call rpt_lst[AX25_MAX_RPT]; ///< List of repeaters
uint8_t rpt_cnt; ///< Number of repeaters in this message
uint8_t rpt_flags; ///< Has-been-repeated flags for each repeater (bit-mapped)
#define AX25_REPEATED(msg, idx) ((msg)->rpt_flags & BV(idx))
uint16_t ctrl; ///< AX25 control field
uint8_t pid; ///< AX25 PID field
const uint8_t *info; ///< Pointer to the info field (payload) of the message
uint16_t len; ///< Payload length
uint8_t raw_data[CONFIG_AX25_FRAME_BUF_LEN]; /// Surowa zawarto<74><6F> ramki przekopiowana z Ctx->buff
short int raw_msg_len; // wielkosc surowej ramki
} AX25Msg;
extern AX25Msg ax25_rxed_frame;
extern char ax25_new_msg_rx_flag;

Wyświetl plik

@ -0,0 +1,61 @@
/*
* ax25_t.h
*
* Created on: Apr 20, 2024
* Author: mateusz
*/
#ifndef INCLUDE_APRS_AX25_T_H_
#define INCLUDE_APRS_AX25_T_H_
#include "stdint.h"
#include "ax25_config.h"
/**
* Maximum number of Repeaters in a AX25 message.
*/
#define AX25_MAX_RPT 8
/**
* AX25 Call sign.
*/
typedef struct AX25Call
{
char call[6]; ///< Call string, max 6 character
uint8_t ssid; ///< SSID (secondary station ID) for the call
} AX25Call;
/**
* AX25 Message.
* Used to handle AX25 sent/received messages.
*/
typedef struct AX25Msg
{
AX25Call src; ///< Source adress
AX25Call dst; ///< Destination address
AX25Call rpt_lst[AX25_MAX_RPT]; ///< List of repeaters
uint8_t rpt_cnt; ///< Number of repeaters in this message
uint8_t rpt_flags; ///< Has-been-repeated flags for each repeater (bit-mapped)
#define AX25_REPEATED(msg, idx) ((msg)->rpt_flags & BV(idx))
uint16_t ctrl; ///< AX25 control field
uint8_t pid; ///< AX25 PID field
const uint8_t *info; ///< Pointer to the info field (payload) of the message
uint16_t len; ///< Payload length
uint8_t raw_data[CONFIG_AX25_FRAME_BUF_LEN]; /// Surowa zawarto<74><6F> ramki przekopiowana z Ctx->buff
short int raw_msg_len; // wielkosc surowej ramki
} AX25Msg;
/**
* Type for AX25 messages callback.
*/
typedef void (*ax25_callback_t)(struct AX25Msg *ax25_rxed_frame);
/**
* Type for channel free wait timeout callback
*/
typedef void (*ax25_ch_free_timeout_callback_t)(void);
#endif /* INCLUDE_APRS_AX25_T_H_ */

Wyświetl plik

@ -0,0 +1,80 @@
/*
* message.h
*
* Created on: Apr 20, 2024
* Author: mateusz
*/
#ifndef INCLUDE_APRS_MESSAGE_H_
#define INCLUDE_APRS_MESSAGE_H_
#include "ax25_t.h"
#include "stdint.h"
#include "./stored_configuration_nvm/config_data.h"
#define MESSAGE_MAX_LENGHT 67
#define MESSAGE_NUMBER_STRING_BUFFER 5 ///!< include room of null terminator
/**
*
*/
typedef enum message_source_t {
MESSAGE_SOURCE_UNINITIALIZED = 0x0,
MESSAGE_SOURCE_APRSIS = 0x1,
MESSAGE_SOURCE_APRSIS_HEXCNTR = 0x2,
MESSAGE_SOURCE_RADIO = 0x11,
MESSAGE_SOURCE_RADIO_HEXCNTR = 0x12
}message_source_t;
/**
*
*/
typedef struct message_t {
AX25Call from;
AX25Call to;
uint8_t content[MESSAGE_MAX_LENGHT];
uint8_t content_ln;
uint8_t number;
uint8_t number_str[MESSAGE_NUMBER_STRING_BUFFER]; //!< Message sequence number but stored as string not decoded to integer
message_source_t source;
}message_t;
/**
* Decode received data to look for an APRS message and put it into a structure
* @param message pointer to data received from APRS-IS
* @param message_ln lenght of a buffer content
* @param content_position optional position of an APRS message content (recipient callsign). if set to zero function will look for it
* @param src
* @param output parsed APRS message content
* @return zero if message has been found and decoded, non zero if parsing failed
*/
uint8_t message_decode(const uint8_t * const message, const uint16_t message_ln, uint16_t content_position, message_source_t src, message_t * output);
/**
*
* @param input
* @param output
* @param output_ln
* @param encode_for
* @return
*/
uint16_t message_encode(message_t * input, uint8_t * output, uint16_t output_ln, message_source_t encode_for);
/**
*
* @param config_data
* @param message
* @return zero if this is a message to us, non zero otherwise
*/
uint8_t message_is_for_me(const char * const callsign, const uint8_t ssid, const message_t * const message);
/**
*
* @param out_buffer
* @param out_buffer_ln
* @param message
*/
int message_create_ack_for(uint8_t * out_buffer, const uint16_t out_buffer_ln, const message_t * const message);
#endif /* INCLUDE_APRS_MESSAGE_H_ */

Wyświetl plik

@ -14,4 +14,7 @@ int system_clock_configure_rtc_l4(void);
void system_clock_configure_auto_wakeup_l4(uint16_t seconds);
int system_is_rtc_ok(void);
uint32_t system_get_rtc_date(void);
uint32_t system_get_rtx_time(void);
#endif /* INCLUDE_CMSIS_STM32L4XX_SYSTEM_STM32L4XX_H_ */

Wyświetl plik

@ -21,5 +21,6 @@ void float_average(float in, float_average_t* average);
float float_get_average(const float_average_t* average);
float float_get_min(const float_average_t* average);
float float_get_max(const float_average_t* average);
char float_get_nonfull(const float_average_t* average);
#endif /* INCLUDE_FLOAT_AVERAGE_H_ */

Wyświetl plik

@ -25,5 +25,6 @@ int32_t int_get_average(const int_average_t* average);
int32_t int_get_min(const int_average_t* average);
int32_t int_get_max(const int_average_t* average);
int32_t int_get_last(const int_average_t* average);
int32_t int_get_nonfull(const int_average_t* average);
#endif /* INCLUDE_INT_AVERAGE_H_ */

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef VE_DIRECT_PROTOCOL_AVERAGE_STRUCT_H_
#define VE_DIRECT_PROTOCOL_AVERAGE_STRUCT_H_
#define VE_DIRECT_AVERAGE_LEN 24
#define VE_DIRECT_AVERAGE_LEN 12
typedef __attribute__ ((aligned(1))) struct ve_direct_average_struct {

Wyświetl plik

@ -115,9 +115,11 @@ void DA_Start() {
#endif
#ifdef STM32F10X_MD_VLs
#if (!defined(_METEO))
GPIO_SetBits(GPIOC, GPIO_Pin_9);
#endif
#endif
}
/*********************************************************************************************************************/
@ -144,7 +146,9 @@ void DA_Stop() {
#endif
#ifdef STM32F10X_MD_VL
#if (!defined(_METEO))
GPIO_ResetBits(GPIOC, GPIO_Pin_9);
#endif
#endif
}

Some files were not shown because too many files have changed in this diff Show More