kopia lustrzana https://github.com/SP8EBC/ParaTNC
fix with erasing flash memory in STM32F100 target
rodzic
9048419ffb
commit
9b6f8013ac
|
@ -4,7 +4,6 @@
|
|||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/KissCommunication.c \
|
||||
../src/LedConfig.c \
|
||||
../src/PathConfig.c \
|
||||
../src/TimerConfig.c \
|
||||
|
@ -18,6 +17,8 @@ C_SRCS += \
|
|||
../src/float_to_string.c \
|
||||
../src/io.c \
|
||||
../src/it_handlers.c \
|
||||
../src/kiss_callback.c \
|
||||
../src/kiss_communication.c \
|
||||
../src/main.c \
|
||||
../src/packet_tx_handler.c \
|
||||
../src/rte_main.c \
|
||||
|
@ -32,7 +33,6 @@ C_SRCS += \
|
|||
../src/wx_pwr_switch.c
|
||||
|
||||
OBJS += \
|
||||
./src/KissCommunication.o \
|
||||
./src/LedConfig.o \
|
||||
./src/PathConfig.o \
|
||||
./src/TimerConfig.o \
|
||||
|
@ -46,6 +46,8 @@ OBJS += \
|
|||
./src/float_to_string.o \
|
||||
./src/io.o \
|
||||
./src/it_handlers.o \
|
||||
./src/kiss_callback.o \
|
||||
./src/kiss_communication.o \
|
||||
./src/main.o \
|
||||
./src/packet_tx_handler.o \
|
||||
./src/rte_main.o \
|
||||
|
@ -60,7 +62,6 @@ OBJS += \
|
|||
./src/wx_pwr_switch.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/KissCommunication.d \
|
||||
./src/LedConfig.d \
|
||||
./src/PathConfig.d \
|
||||
./src/TimerConfig.d \
|
||||
|
@ -74,6 +75,8 @@ C_DEPS += \
|
|||
./src/float_to_string.d \
|
||||
./src/io.d \
|
||||
./src/it_handlers.d \
|
||||
./src/kiss_callback.d \
|
||||
./src/kiss_communication.d \
|
||||
./src/main.d \
|
||||
./src/packet_tx_handler.d \
|
||||
./src/rte_main.d \
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "config_data.h"
|
||||
|
||||
#define SW_VER "EA16"
|
||||
#define SW_DATE "15082022"
|
||||
#define SW_DATE "20082022"
|
||||
|
||||
#define SYSTICK_TICKS_PER_SECONDS 100
|
||||
#define SYSTICK_TICKS_PERIOD 10
|
||||
|
|
|
@ -78,8 +78,8 @@ const config_data_gsm_t * config_data_gsm_default_ptr = (const config_data_gsm_t
|
|||
#endif
|
||||
|
||||
#ifdef STM32F10X_MD_VL
|
||||
const uint16_t * config_data_pgm_cntr_first_ptr = &config_data_pgm_cntr_first;
|
||||
const uint16_t * config_data_pgm_cntr_second_ptr = &config_data_pgm_cntr_second;
|
||||
const uint16_t * config_data_pgm_cntr_first_ptr = &config_data_pgm_cntr_first_ptr;
|
||||
const uint16_t * config_data_pgm_cntr_second_ptr = &config_data_pgm_cntr_second_ptr;
|
||||
|
||||
const config_data_mode_t * config_data_mode_first_ptr = &config_data_mode_first;
|
||||
const config_data_basic_t * config_data_basic_first_ptr = &config_data_basic_first;
|
||||
|
@ -208,8 +208,9 @@ static int configuration_handler_program_crc(uint32_t crc, int8_t bank) {
|
|||
|
||||
#ifdef STM32F10X_MD_VL
|
||||
// program the CRC value
|
||||
*(uint16_t*)((uint16_t *)config_section_first_start + CRC_16B_WORD_OFFSET) = (uint16_t)(target_crc_value & 0xFFFF);
|
||||
*(uint16_t*)((uint16_t *)config_section_first_start + CRC_16B_WORD_OFFSET + 1) = (uint16_t)((target_crc_value & 0xFFFF0000) >> 16);
|
||||
*(uint16_t*)((uint16_t *)config_section_first_start + CRC_16B_WORD_OFFSET) = (uint16_t)(crc & 0xFFFF);
|
||||
WAIT_FOR_PGM_COMPLETION
|
||||
*(uint16_t*)((uint16_t *)config_section_first_start + CRC_16B_WORD_OFFSET + 1) = (uint16_t)((crc & 0xFFFF0000) >> 16);
|
||||
|
||||
flash_status = FLASH_GetBank1Status();
|
||||
|
||||
|
@ -423,6 +424,10 @@ uint32_t configuration_handler_restore_default_first(void) {
|
|||
|
||||
int comparision_result = 0;
|
||||
|
||||
#ifdef STM32F10X_MD_VL
|
||||
FLASH_Unlock();
|
||||
#endif
|
||||
|
||||
// erase first page
|
||||
flash_status = FLASH_ErasePage((uint32_t)config_section_first_start);
|
||||
flash_status = FLASH_ErasePage((uint32_t)config_section_first_start + 0x400);
|
||||
|
@ -547,8 +552,9 @@ uint32_t configuration_handler_restore_default_second(void) {
|
|||
|
||||
int comparision_result = 0;
|
||||
|
||||
// unlock flash memory
|
||||
#ifdef STM32F10X_MD_VL
|
||||
FLASH_Unlock();
|
||||
#endif
|
||||
|
||||
// erase first page
|
||||
flash_status = FLASH_ErasePage((uint32_t)config_section_second_start);
|
||||
|
|
Ładowanie…
Reference in New Issue