const config data moved to separate sections in flash

pull/2/head
Mateusz Lubecki 2021-04-27 21:54:35 +02:00
rodzic 7d5a106046
commit 0db20888e2
7 zmienionych plików z 494 dodań i 10 usunięć

Wyświetl plik

@ -78,7 +78,8 @@
<listOptionValue builtIn="false" value="USE_STDPERIPH_DRIVER"/>
<listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.1338324911" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wunused-function" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.1338324911" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wunused-function -Wall" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.asmlisting.1200792307" name="Generate assembler listing (-Wa,-adhlns=&quot;$@.lst&quot;)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.asmlisting" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<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">

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="815361885035330323" 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="893947698641861052" 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>

Wyświetl plik

@ -9,7 +9,9 @@ C_SRCS += \
../src/PathConfig.c \
../src/TimerConfig.c \
../src/_write.c \
../src/config_data.c \
../src/config_data_first.c \
../src/config_data_second.c \
../src/config_data_third.c \
../src/delay.c \
../src/io.c \
../src/it_handlers.c \
@ -30,7 +32,9 @@ OBJS += \
./src/PathConfig.o \
./src/TimerConfig.o \
./src/_write.o \
./src/config_data.o \
./src/config_data_first.o \
./src/config_data_second.o \
./src/config_data_third.o \
./src/delay.o \
./src/io.o \
./src/it_handlers.o \
@ -51,7 +55,9 @@ C_DEPS += \
./src/PathConfig.d \
./src/TimerConfig.d \
./src/_write.d \
./src/config_data.d \
./src/config_data_first.d \
./src/config_data_second.d \
./src/config_data_third.d \
./src/delay.d \
./src/io.d \
./src/it_handlers.d \

Wyświetl plik

@ -234,6 +234,50 @@ SECTIONS
_etext = .;
__etext = .;
__config_section_first_start = 0x0801E800;
__config_section_second_start = 0x0801F000;
__config_section_third_start = 0x0801F800;
__config_section_first_end = __config_section_first_start + 0x7FF;
__config_section_second_end = __config_section_second_start + 0x7FF;
__config_section_third_end = __config_section_third_start + 0x7FF;
.config_section_first __config_section_first_start : ALIGN(4)
{
FILL(0xAB)
*(.config_section_first) config_data_mode_first = __config_section_first_start;
*(.config_section_first) config_data_basic_first = __config_section_first_start + 0x20;
*(.config_section_first) config_data_wx_sources_first = __config_section_first_start + 0x100;
*(.config_section_first) config_data_umb_first = __config_section_first_start + 0x120;
*(.config_section_first) config_data_rtu_first = __config_section_first_start + 0x140;
__config_section_first_crc = (__config_section_first_end - 0x4);
KEEP(*(.config_section_first))
} >FLASH
.config_section_second __config_section_second_start : ALIGN(4)
{
FILL(0xAC)
*(.config_section_second) config_data_mode_second = __config_section_second_start;
*(.config_section_second) config_data_basic_second = __config_section_second_start + 0x20;
*(.config_section_second) config_data_wx_sources_second = __config_section_second_start + 0x100;
*(.config_section_second) config_data_umb_second = __config_section_second_start + 0x120;
*(.config_section_second) config_data_rtu_second = __config_section_second_start + 0x140;
__config_section_second_crc = (__config_section_second_end - 0x4);
KEEP(*(.config_section_second))
} >FLASH
.config_section_third __config_section_third_start : ALIGN(4)
{
KEEP(*(.config_section_third))
} >FLASH
/* MEMORY_ARRAY */
/*
.ROarraySection :

Wyświetl plik

@ -43,7 +43,7 @@
/**
*
*/
const config_data_mode_t config_data_mode_first = {
const config_data_mode_t __attribute__((section(".config_section_first"))) config_data_mode_first = {
#ifdef _DIGI
.digi = 1,
#else
@ -109,7 +109,7 @@ const config_data_mode_t config_data_mode_first = {
/**
*
*/
const config_data_basic_t config_data_basic_first = {
const config_data_basic_t __attribute__((section(".config_section_first"))) config_data_basic_first = {
.callsign = _CALL,
.ssid = _SSID,
.latitude = _LAT,
@ -168,7 +168,7 @@ const config_data_basic_t config_data_basic_first = {
* Data sources for different parameters
*
*/
const config_data_wx_sources_t config_data_wx_sources_first = {
const config_data_wx_sources_t __attribute__((section(".config_section_first"))) config_data_wx_sources_first = {
#ifdef _TEMPERATURE_INTERNAL
.temperature = WX_SOURCE_INTERNAL,
#endif
@ -233,7 +233,7 @@ const config_data_wx_sources_t config_data_wx_sources_first = {
/**
*
*/
const config_data_umb_t config_data_umb_first = {
const config_data_umb_t __attribute__((section(".config_section_first"))) config_data_umb_first = {
#ifdef _UMB_SLAVE_ID
.slave_id = _UMB_SLAVE_ID,
#else
@ -265,7 +265,7 @@ const config_data_umb_t config_data_umb_first = {
/**
*
*/
const config_data_rtu_t config_data_rtu_first = {
const config_data_rtu_t __attribute__((section(".config_section_first"))) config_data_rtu_first = {
.slave_speed = _RTU_SLAVE_SPEED,
.slave_parity = _RTU_SLAVE_PARITY,

Wyświetl plik

@ -0,0 +1,424 @@
/*
* config_data_second.c
*
* Created on: Apr 26, 2021
* Author: mateusz
*/
#include "config_data.h"
#include "station_config.h"
#ifndef _RTU_SLAVE_LENGHT_1
#define _RTU_SLAVE_LENGHT_1 0x1
#endif
#ifndef _RTU_SLAVE_LENGHT_2
#define _RTU_SLAVE_LENGHT_2 0x1
#endif
#ifndef _RTU_SLAVE_LENGHT_3
#define _RTU_SLAVE_LENGHT_3 0x1
#endif
#ifndef _RTU_SLAVE_LENGHT_4
#define _RTU_SLAVE_LENGHT_4 0x1
#endif
#ifndef _RTU_SLAVE_LENGHT_5
#define _RTU_SLAVE_LENGHT_5 0x1
#endif
#ifndef _RTU_SLAVE_LENGHT_6
#define _RTU_SLAVE_LENGHT_6 0x1
#endif
/**
*
*/
const config_data_mode_t __attribute__((section(".config_section_second"))) config_data_mode_second = {
#ifdef _DIGI
.digi = 1,
#else
.digi = 0,
#endif
#ifdef _METEO
.wx = 1,
#else
.wx = 0,
#endif
#ifdef _MODBUS_RTU
.wx_modbus = 1,
#else
.wx_modbus = 0,
#endif
#ifdef _MODBUS_RTU
.wx_modbus = 1,
#else
.wx_modbus = 0,
#endif
#ifdef _UMB_MASTER
.wx_umb = 1,
#else
.wx_umb = 0,
#endif
#ifdef _VICTRON
.victron = 1,
#else
.victron = 0,
#endif
#ifdef _SENSOR_BME280
.wx_ms5611_or_bme = 1,
#else
.wx_ms5611_or_bme = 0,
#endif
#ifdef _DIGI_ONLY_789
.digi_only_ssids = 1,
#else
.digi_only_ssids = 0,
#endif
#ifdef _DIGI_VISCOUS
.digi_viscous = 1,
#else
.digi_viscous = 0,
#endif
#ifdef _DIGI_VISCOUS_DEALY
.digi_viscous_delay_sec = _DIGI_VISCOUS_DEALY
#else
.digi_viscous_delay_sec = 3
#endif
};
/**
*
*/
const config_data_basic_t __attribute__((section(".config_section_second"))) config_data_basic_second = {
.callsign = _CALL,
.ssid = _SSID,
.latitude = _LAT,
.longitude = _LON,
#if (_LATNS == 'N')
.zero_to_n_one_to_s = 0,
#else
.zero_to_n_one_to_s = 1,
#endif
#if (_LONWE == 'E')
.zero_to_e_one_to_w = 0,
#else
.zero_to_e_one_to_w = 1,
#endif
.comment = _COMMENT,
#ifdef _SYMBOL_DIGI
.symbol = 0,
#endif
#ifdef _SYMBOL_WIDE1_DIGI
.symbol = 1,
#endif
#ifdef _SYMBOL_HOUSE
.symbol = 2,
#endif
#ifdef _SYMBOL_RXIGATE
.symbol = 3,
#endif
#ifdef _SYMBOL_IGATE
.symbol = 4,
#endif
#if defined(_WIDE1_PATH)
.path_type = 1,
#elif defined(_WIDE21_PATH)
.path_type = 2,
#else
.path_type = 0,
#endif
.wx_transmit_period = _WX_INTERVAL,
.beacon_transmit_period = _BCN_INTERVAL,
#ifdef _BCN_ON_STARTUP
.beacon_at_bootup = 1
#else
.beacon_at_bootup = 0
#endif
};
/**
* Data sources for different parameters
*
*/
const config_data_wx_sources_t __attribute__((section(".config_section_second"))) config_data_wx_sources_second = {
#ifdef _TEMPERATURE_INTERNAL
.temperature = WX_SOURCE_INTERNAL,
#endif
#ifdef _TEMPERATURE_UMB
.temperature = WX_SOURCE_UMB,
#endif
#ifdef _TEMPERATURE_RTU
.temperature = WX_SOURCE_RTU,
#endif
#ifdef _TEMPERATURE_DAVIS
.temperature = WX_SOURCE_DAVIS_SERIAL,
#endif
#ifdef _PRESSURE_INTERNAL
.pressure = WX_SOURCE_INTERNAL,
#endif
#ifdef _PRESSURE_UMB
.pressure = WX_SOURCE_UMB,
#endif
#ifdef _PRESSURE_RTU
.pressure = WX_SOURCE_RTU,
#endif
#ifdef _PRESSURE_DAVIS
.pressure = WX_SOURCE_DAVIS_SERIAL,
#endif
#ifdef _HUMIDITY_INTERNAL
.humidity = WX_SOURCE_INTERNAL,
#endif
#ifdef _HUMIDITY_UMB
.humidity = WX_SOURCE_UMB,
#endif
#ifdef _HUMIDITY_RTU
.humidity = WX_SOURCE_RTU,
#endif
#ifdef _HUMIDITY_DAVIS
.humidity = WX_SOURCE_DAVIS_SERIAL,
#endif
#ifdef _WIND_INTERNAL
.wind = WX_SOURCE_INTERNAL
#endif
#ifdef _WIND_UMB
.wind = WX_SOURCE_UMB
#endif
#ifdef _WIND_RTU
.wind = WX_SOURCE_RTU
#endif
#ifdef _WIND_FULL_RTU
.wind = WX_SOURCE_FULL_RTU
#endif
#ifdef _WIND_DAVIS
.wind = WX_SOURCE_DAVIS_SERIAL
#endif
};
/**
*
*/
const config_data_umb_t __attribute__((section(".config_section_second"))) config_data_umb_second = {
#ifdef _UMB_SLAVE_ID
.slave_id = _UMB_SLAVE_ID,
#else
.slave_id = 0,
#endif
#ifdef _UMB_SLAVE_CLASS
.slave_class = _UMB_SLAVE_CLASS,
#else
.slave_class = 0,
#endif
#if defined (_UMB_SLAVE_ID) && defined (_UMB_SLAVE_CLASS)
.channel_windspeed = _UMB_CHANNEL_WINDSPEED,
.channel_wingsusts = _UMB_CHANNEL_WINDGUSTS,
.channel_winddirection = _UMB_CHANNEL_WINDDIRECTION,
.channel_temperature = _UMB_CHANNEL_TEMPERATURE,
.channel_qnh = _UMB_CHANNEL_QFE
#else
.channel_windspeed = 0xFFFF,
.channel_wingsusts = 0xFFFF,
.channel_winddirection = 0xFFFF,
.channel_temperature = 0xFFFF,
.channel_qfe = 0xFFFF
#endif
};
/**
*
*/
const config_data_rtu_t __attribute__((section(".config_section_second"))) config_data_rtu_second = {
.slave_speed = _RTU_SLAVE_SPEED,
.slave_parity = _RTU_SLAVE_PARITY,
.slave_stop_bits = _RTU_SLAVE_STOP_BITS,
#ifdef _RTU_SLAVE_FULL_WIND_DATA
.use_full_wind_data = 1,
#else
.use_full_wind_data = 0,
#endif
// sources
#ifdef _RTU_SLAVE_TEMPERATURE_SOURCE
.temperature_source = _RTU_SLAVE_TEMPERATURE_SOURCE,
#else
.temperature_source = 0,
#endif
#ifdef _RTU_SLAVE_HUMIDITY_SOURCE
.humidity_source = _RTU_SLAVE_HUMIDITY_SOURCE,
#else
.humidity_source = 0,
#endif
#ifdef _RTU_SLAVE_PRESSURE_SOURCE
.pressure_source = _RTU_SLAVE_PRESSURE_SOURCE,
#else
.pressure_source = 0,
#endif
#ifdef _RTU_SLAVE_WIND_DIRECTION_SORUCE
.wind_direction_source = _RTU_SLAVE_WIND_DIRECTION_SORUCE,
#else
.wind_direction_source = 0,
#endif
#ifdef _RTU_SLAVE_WIND_SPEED_SOURCE
.wind_speed_source = _RTU_SLAVE_WIND_SPEED_SOURCE,
#else
.wind_speed_source = 0,
#endif
#ifdef _RTU_SLAVE_WIND_GUSTS_SOURCE
.wind_gusts_source = _RTU_SLAVE_WIND_GUSTS_SOURCE,
#else
.wind_gusts_source = 0,
#endif
// channel 1
.slave_1_bus_address = _RTU_SLAVE_ID_1,
.slave_1_function = _RTU_SLAVE_FUNC_1,
.slave_1_register_address = _RTU_SLAVE_ADDR_1,
.slave_1_lenght = _RTU_SLAVE_LENGHT_1,
.slave_1_scaling_a = _RTU_SLAVE_SCALING_A_1,
.slave_1_scaling_b = _RTU_SLAVE_SCALING_B_1,
.slave_1_scaling_c = _RTU_SLAVE_SCALING_C_1,
.slave_1_scaling_d = _RTU_SLAVE_SCALING_D_1,
.slave_1_unsigned_signed = 0, // 0 - unsigned
// channel 2
.slave_2_bus_address = _RTU_SLAVE_ID_2,
.slave_2_function = _RTU_SLAVE_FUNC_2,
.slave_2_register_address = _RTU_SLAVE_ADDR_2,
.slave_2_lenght = _RTU_SLAVE_LENGHT_2,
.slave_2_scaling_a = _RTU_SLAVE_SCALING_A_2,
.slave_2_scaling_b = _RTU_SLAVE_SCALING_B_2,
.slave_2_scaling_c = _RTU_SLAVE_SCALING_C_2,
.slave_2_scaling_d = _RTU_SLAVE_SCALING_D_2,
.slave_2_unsigned_signed = 0,
// channel 3
.slave_3_bus_address = _RTU_SLAVE_ID_3,
.slave_3_function = _RTU_SLAVE_FUNC_3,
.slave_3_register_address = _RTU_SLAVE_ADDR_3,
.slave_3_lenght = _RTU_SLAVE_LENGHT_3,
.slave_3_scaling_a = _RTU_SLAVE_SCALING_A_3,
.slave_3_scaling_b = _RTU_SLAVE_SCALING_B_3,
.slave_3_scaling_c = _RTU_SLAVE_SCALING_C_3,
.slave_3_scaling_d = _RTU_SLAVE_SCALING_D_3,
.slave_3_unsigned_signed = 0,
// channel 4
.slave_4_bus_address = _RTU_SLAVE_ID_4,
.slave_4_function = _RTU_SLAVE_FUNC_4,
.slave_4_register_address = _RTU_SLAVE_ADDR_4,
.slave_4_lenght = _RTU_SLAVE_LENGHT_4,
.slave_4_scaling_a = _RTU_SLAVE_SCALING_A_4,
.slave_4_scaling_b = _RTU_SLAVE_SCALING_B_4,
.slave_4_scaling_c = _RTU_SLAVE_SCALING_C_4,
.slave_4_scaling_d = _RTU_SLAVE_SCALING_D_4,
.slave_4_unsigned_signed = 0,
// channel 5
.slave_5_bus_address = _RTU_SLAVE_ID_5,
.slave_5_function = _RTU_SLAVE_FUNC_5,
.slave_5_register_address = _RTU_SLAVE_ADDR_5,
.slave_5_lenght = _RTU_SLAVE_LENGHT_5,
.slave_5_scaling_a = _RTU_SLAVE_SCALING_A_5,
.slave_5_scaling_b = _RTU_SLAVE_SCALING_B_5,
.slave_5_scaling_c = _RTU_SLAVE_SCALING_C_5,
.slave_5_scaling_d = _RTU_SLAVE_SCALING_D_5,
.slave_5_unsigned_signed = 0,
// channel 6
.slave_6_bus_address = _RTU_SLAVE_ID_6,
.slave_6_function = _RTU_SLAVE_FUNC_6,
.slave_6_register_address = _RTU_SLAVE_ADDR_6,
.slave_6_lenght = _RTU_SLAVE_LENGHT_6,
.slave_6_scaling_a = _RTU_SLAVE_SCALING_A_6,
.slave_6_scaling_b = _RTU_SLAVE_SCALING_B_6,
.slave_6_scaling_c = _RTU_SLAVE_SCALING_C_6,
.slave_6_scaling_d = _RTU_SLAVE_SCALING_D_6,
.slave_6_unsigned_signed = 0
};

Wyświetl plik

@ -0,0 +1,9 @@
/*
* config_data_third.c
*
* Created on: Apr 26, 2021
* Author: mateusz
*/
const int __attribute__((section(".config_section_third"))) dummy = 0xDEADBEEF;