Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
c61c438b8c | |||
0e834dfe3d | |||
fbd36705f1 | |||
320cce09ec | |||
05e069441c | |||
d82a525a82 | |||
c46dde7c5c | |||
f2b52210e9 | |||
9ff61f7825 | |||
ed3ac12f75 | |||
d9c19bf743 | |||
327f65e16b | |||
0699aee653 | |||
c2b7720886 | |||
072f042fe3 | |||
b9db537db1 | |||
a7d6faca8b | |||
d6c3e5d7be | |||
120ec1cd90 | |||
370a0a98e6 | |||
4bf3fcd9ce |
143
.gitignore
vendored
Normal file
143
.gitignore
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
# ---> uVision
|
||||
# git ignore file for Keil µVision Project
|
||||
|
||||
# µVision 5 and µVision 4 Project screen layout file
|
||||
*.uvguix.*
|
||||
*.uvgui.*
|
||||
*.uvoptx.*
|
||||
|
||||
|
||||
# Listing Files
|
||||
*.i
|
||||
*.lst
|
||||
*.m51
|
||||
*.m66
|
||||
*.map
|
||||
|
||||
# Object Files
|
||||
*.axf
|
||||
*.b[0-2][0-9]
|
||||
*.b3[0-1]
|
||||
*.bak
|
||||
*.build_log.htm
|
||||
*.crf
|
||||
*.d
|
||||
*.dep
|
||||
*.elf
|
||||
*.htm
|
||||
*.iex
|
||||
*.lnp
|
||||
*.o
|
||||
*.obj
|
||||
*.sbr
|
||||
|
||||
# Firmware Files
|
||||
*.bin
|
||||
*.h86
|
||||
*.hex
|
||||
|
||||
# Build Files
|
||||
.bat
|
||||
|
||||
# Debugger Files
|
||||
.ini
|
||||
|
||||
# JLink Files
|
||||
JLinkLog.txt
|
||||
|
||||
# Other Files
|
||||
|
||||
# ---> Qt
|
||||
# C++ objects and libs
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.so.*
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
# Qt-es
|
||||
object_script.*.Release
|
||||
object_script.*.Debug
|
||||
*_plugin_import.cpp
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.qbs.user
|
||||
*.qbs.user.*
|
||||
*.moc
|
||||
moc_*.cpp
|
||||
moc_*.h
|
||||
qrc_*.cpp
|
||||
ui_*.h
|
||||
*.qmlc
|
||||
*.jsc
|
||||
Makefile*
|
||||
*build-*
|
||||
*.qm
|
||||
*.prl
|
||||
|
||||
# Qt unit tests
|
||||
target_wrapper.*
|
||||
|
||||
# QtCreator
|
||||
*.autosave
|
||||
|
||||
# QtCreator Qml
|
||||
*.qmlproject.user
|
||||
*.qmlproject.user.*
|
||||
|
||||
# QtCreator CMake
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# QtCreator 4.8< compilation database
|
||||
compile_commands.json
|
||||
|
||||
# QtCreator local machine specific files for imported projects
|
||||
*creator.user*
|
||||
|
||||
*_qmlcache.qrc
|
||||
|
||||
|
||||
|
||||
|
||||
# ---> MATLAB
|
||||
# Windows default autosave extension
|
||||
*.asv
|
||||
|
||||
# OSX / *nix default autosave extension
|
||||
*.m~
|
||||
|
||||
# Compiled MEX binaries (all platforms)
|
||||
*.mex*
|
||||
|
||||
# Packaged app and toolbox files
|
||||
*.mlappinstall
|
||||
*.mltbx
|
||||
|
||||
# Generated helpsearch folders
|
||||
helpsearch*/
|
||||
|
||||
# Simulink code generation folders
|
||||
slprj/
|
||||
sccprj/
|
||||
|
||||
# Matlab code generation folders
|
||||
codegen/
|
||||
|
||||
# Simulink autosave extension
|
||||
*.autosave
|
||||
|
||||
# Simulink cache files
|
||||
*.slxc
|
||||
|
||||
# Octave session info
|
||||
octave-workspace
|
||||
|
||||
/MDK-ARM/uksvep_2_2_v1/
|
||||
/MDK-ARM/JLinkSettings.ini
|
24
.mxproject
24
.mxproject
File diff suppressed because one or more lines are too long
20
Core/Bootloader/Inc/boot_can.h
Normal file
20
Core/Bootloader/Inc/boot_can.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef __BOOT_CAN_H
|
||||
#define __BOOT_CAN_H
|
||||
|
||||
#include "bootloader.h"
|
||||
|
||||
extern CAN_HandleTypeDef hcan_boot;
|
||||
|
||||
extern CAN_TxHeaderTypeDef TxHeaderBoot;
|
||||
extern CAN_RxHeaderTypeDef RxHeaderBoot;
|
||||
extern uint32_t TxMailBoxBoot;
|
||||
extern uint8_t TXDataBoot[8];
|
||||
|
||||
/* Инициализация CAN */
|
||||
void MX_BOOT_CAN_Init(void);
|
||||
/* Приём команды по CAN по протоколу */
|
||||
BootloaderCommand_t Bootloader_CAN_Receive(Bootloader_t *bl);
|
||||
/* Приём CAN: страница + CRC */
|
||||
void Bootloader_CAN_Receive_Page(Bootloader_t *bl);
|
||||
|
||||
#endif //__BOOT_CAN_H
|
14
Core/Bootloader/Inc/boot_flash.h
Normal file
14
Core/Bootloader/Inc/boot_flash.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef __BOOT_FLASH_H
|
||||
#define __BOOT_FLASH_H
|
||||
|
||||
#include "bootloader.h"
|
||||
|
||||
|
||||
// FOR APP FLASHING
|
||||
HAL_StatusTypeDef FLASH_Erase_App(void);
|
||||
HAL_StatusTypeDef FLASH_Write_Page(uint32_t *Address, uint8_t *Data, int Data_size);
|
||||
|
||||
// SERVICE
|
||||
HAL_StatusTypeDef FLASH_Write_Word(uint32_t Address, uint64_t Data);
|
||||
|
||||
#endif //__BOOT_FLASH_H
|
14
Core/Bootloader/Inc/boot_gpio.h
Normal file
14
Core/Bootloader/Inc/boot_gpio.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef __BOOT_GPIO_H
|
||||
#define __BOOT_GPIO_H
|
||||
|
||||
#include "bootloader.h"
|
||||
|
||||
|
||||
#define LED_BOOT_ON() CLEAR_BIT(LED_BOOT_GPIO_Port->ODR, LED_BOOT_Pin)
|
||||
#define LED_BOOT_OFF() SET_BIT(LED_BOOT_GPIO_Port->ODR, LED_BOOT_Pin)
|
||||
#define LED_BOOT_TOOGLE() LED_BOOT_GPIO_Port->ODR ^= LED_BOOT_Pin
|
||||
|
||||
|
||||
void MX_BOOT_GPIO_Init(void);
|
||||
|
||||
#endif //__BOOT_GPIO_H
|
26
Core/Bootloader/Inc/boot_jump.h
Normal file
26
Core/Bootloader/Inc/boot_jump.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef __BOOT_JUMP_H
|
||||
#define __BOOT_JUMP_H
|
||||
|
||||
#include "bootloader.h"
|
||||
|
||||
/* Инициализация приложения */
|
||||
void App_Init(void);
|
||||
/* Переход в бутлоадер */
|
||||
void JumpToBootloader(void);
|
||||
/* Переход к основному приложению */
|
||||
void JumpToApplocation(void);
|
||||
|
||||
/* Сброс ключа BOOT в Flash */
|
||||
void ResetKey(void);
|
||||
/* Установка ключа BOOT в Flash */
|
||||
void SetKey(void);
|
||||
/* Чтение ключа BOOT из Flash */
|
||||
uint32_t ReadKey(void);
|
||||
/* Стирание ключа BOOT в Flash */
|
||||
void EraseKey(void);
|
||||
|
||||
/* Проверка валидности прошивки перед переходом к приложению */
|
||||
HAL_StatusTypeDef Verify_Firmware(void);
|
||||
|
||||
|
||||
#endif //__BOOT_JUMP_H
|
73
Core/Bootloader/Inc/boot_project_setup.h
Normal file
73
Core/Bootloader/Inc/boot_project_setup.h
Normal file
@ -0,0 +1,73 @@
|
||||
#ifndef __BOOT_SETUP_H
|
||||
#define __BOOT_SETUP_H
|
||||
|
||||
#include "stm32f1xx_hal.h"
|
||||
|
||||
// ======================== BOOTLOADER CONFIG ========================
|
||||
|
||||
// ---------- MAIN APPLICATION defines ----------
|
||||
// Адрес и страницы Flash для основного приложения
|
||||
// MAIN_APP_START_ADR – начало кода основного приложения
|
||||
#define MAIN_APP_START_ADR (uint32_t)0x0800C000UL
|
||||
#define MAIN_APP_PAGE 21 // страница, с которой начинается приложение
|
||||
#define MAIN_APP_NUM_OF_PAGE 250-MAIN_APP_PAGE // количество страниц, отведённых под приложение
|
||||
|
||||
// ---------- KEY defines ----------
|
||||
// Адрес и страница Flash для хранения ключа бутлоадера
|
||||
// Ключ используется для проверки, записано ли приложение корректно
|
||||
#define BOOTLOADER_KEY_ADR (uint32_t)0x08009800UL // физический адрес ключа
|
||||
#define BOOTLOADER_KEY_PAGE 20 // страница флеш, на которой хранится ключ
|
||||
|
||||
// ---------- RECEIVE defines ----------
|
||||
// Настройки приёма прошивки
|
||||
#define FW_RECEIVE_TIMEOUT_MS 500 // таймаут приёма одного байта прошивки (мс)
|
||||
#define PAGE_SIZE 2048 // размер блока (страницы) прошивки для приёма и записи в Flash
|
||||
// должен быть таким, чтобы размер страниц Flash был кратен ему
|
||||
|
||||
// ---------- LED defines ----------
|
||||
#define LED_BOOT_Pin GPIO_PIN_5
|
||||
#define LED_BOOT_GPIO_Port GPIOB
|
||||
|
||||
// ======================== RCC (CLOCK) defines ========================
|
||||
|
||||
// Макросы для включения тактирования периферии бутлоадера
|
||||
#define __RCC_LED_BOOT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() // тактирование UART
|
||||
#define __RCC_UART_BOOT_CLK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() // тактирование UART
|
||||
#define __RCC_UART_PORT_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() // тактирование порта UART
|
||||
#define __RCC_CAN_BOOT_CLK_ENABLE() __HAL_RCC_CAN1_CLK_ENABLE() // тактирование CAN
|
||||
#define __RCC_CAN_PORT_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() // тактирование порта CAN
|
||||
|
||||
// ======================== UART defines ========================
|
||||
|
||||
// Аппаратный UART и скорость передачи
|
||||
#define UART_BOOT UART4
|
||||
#define UART_SPEED 115200
|
||||
|
||||
// Порт и пины UART
|
||||
#define UART_PORT GPIOC
|
||||
#define UART_PIN_TX GPIO_PIN_10
|
||||
#define UART_PIN_RX GPIO_PIN_11
|
||||
|
||||
// ======================== CAN defines ========================
|
||||
|
||||
// Аппаратный CAN и режим работы
|
||||
#define CAN_BOOT CAN1
|
||||
#define CAN_MODE CAN_MODE_NORMAL
|
||||
|
||||
// Настройка скорости CAN при 8 MHz
|
||||
// ------------|-----------|-----------|-----------
|
||||
// CAN speed | Prescaler | BS1 | BS2
|
||||
// ------------|-----------|-----------|-----------
|
||||
// 125 kbps | 4 | 13TQ | 2TQ
|
||||
// 250 kbps | 2 | 13TQ | 2TQ
|
||||
// 500 kbps | 1 | 13TQ | 2TQ
|
||||
#define CAN_SPEED_PRESCALER 4
|
||||
#define CAN_SPEED_BS1 CAN_BS1_13TQ
|
||||
#define CAN_SPEED_BS2 CAN_BS2_2TQ
|
||||
|
||||
// Порт и пины CAN
|
||||
#define CAN_PORT GPIOA
|
||||
#define CAN_PIN_RX GPIO_PIN_11
|
||||
#define CAN_PIN_TX GPIO_PIN_12
|
||||
|
||||
#endif //__BOOT_SETUP_H
|
15
Core/Bootloader/Inc/boot_uart.h
Normal file
15
Core/Bootloader/Inc/boot_uart.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef __BOOT_UART_H
|
||||
#define __BOOT_UART_H
|
||||
|
||||
#include "bootloader.h"
|
||||
|
||||
extern UART_HandleTypeDef huart_boot;
|
||||
|
||||
/* Инициализация UART */
|
||||
void MX_BOOT_UART_Init(void);
|
||||
/* Приём команды по UART по протоколу */
|
||||
BootloaderCommand_t Bootloader_UART_Receive(Bootloader_t *bl);
|
||||
/* Приём UART: страница + CRC */
|
||||
void Bootloader_UART_Receive_Page(Bootloader_t *bl);
|
||||
|
||||
#endif //__BOOT_UART_H
|
150
Core/Bootloader/Inc/bootloader.h
Normal file
150
Core/Bootloader/Inc/bootloader.h
Normal file
@ -0,0 +1,150 @@
|
||||
#ifndef __BOOTLOADER_H
|
||||
#define __BOOTLOADER_H
|
||||
|
||||
#include "boot_project_setup.h"
|
||||
#include "string.h"
|
||||
|
||||
/* --- Настройка: подставьте значения для вашей MCU --- */
|
||||
/* Адрес начала приложения (используется в вашем коде) */
|
||||
#ifndef MAIN_APP_START_ADR
|
||||
#error "MAIN_APP_START_ADR must be defined"
|
||||
#endif
|
||||
/* Flash boundaries: подставьте реальные границы флеш-памяти вашего MCU */
|
||||
#ifndef FLASH_START_ADR
|
||||
#define FLASH_START_ADR MAIN_APP_START_ADR
|
||||
#endif
|
||||
#ifndef FLASH_END_ADR
|
||||
#define FLASH_END_ADR FLASH_BASE + (*((uint16_t*)FLASHSIZE_BASE) * 1024U)
|
||||
#endif
|
||||
|
||||
/* SRAM boundaries: подставьте реальные адреса SRAM вашей MCU */
|
||||
#ifndef SRAM_START_ADR
|
||||
#define SRAM_START_ADR 0x20000000UL
|
||||
#endif
|
||||
#ifndef SRAM_END_ADR
|
||||
#define SRAM_END_ADR 0x2003FFFFUL
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Значение ключа, указывающее что основное приложение записано
|
||||
*/
|
||||
#define BL_KEY_APP_WRITTEN 0xAAAA5555
|
||||
|
||||
|
||||
|
||||
|
||||
/** @brief Получить сохранённый код ошибки из BKP */
|
||||
#define GetErrorCode() BKP->DR1
|
||||
/** @brief Получить счетчик ошибок из BKP */
|
||||
#define GetErrorCnt() BKP->DR2
|
||||
|
||||
|
||||
/**
|
||||
* @brief Сохранение кода ошибки и инкремент счетчика
|
||||
* @param code Код ошибки
|
||||
* @details
|
||||
* Включаем тактирование PWR и BKP (APB1) и разрешаем доступ к BKP domain
|
||||
* Записываем напрямую в регистры RCC/APB1ENR и PWR->CR
|
||||
* Записываем код ошибки и счётчик ошибок
|
||||
*/
|
||||
#define SaveErrorCode(code) do{ \
|
||||
RCC->APB1ENR |= (RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN); \
|
||||
PWR->CR |= PWR_CR_DBP; \
|
||||
GetErrorCode() = code; \
|
||||
GetErrorCnt() = GetErrorCnt() + 1; \
|
||||
}while(0u);
|
||||
|
||||
/**
|
||||
* @brief Очистка кода ошибки и счетчика ошибок
|
||||
*/
|
||||
#define ClearErrorCode(code) do{ \
|
||||
RCC->APB1ENR |= (RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN); \
|
||||
PWR->CR |= PWR_CR_DBP; \
|
||||
GetErrorCode() = 0; \
|
||||
GetErrorCnt() = 0; \
|
||||
}while(0u);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Команды для управления бутлоадером
|
||||
*/
|
||||
typedef enum {
|
||||
NO_CMD = 0x00, ///< Нет комманды
|
||||
CMD_ERASE = 0x01, ///< Команда на стирание прошивки
|
||||
CMD_START_RECEIVE, ///< Команда на старт приема прошивки
|
||||
CMD_WRITE, ///< Команда на запись блока прошивки
|
||||
CMD_GOTOAPP, ///< Команда на переход в приложение
|
||||
CMD_RESET, ///< Команда на переход в приложение
|
||||
CMD_GOTOBOOT, ///< Команда на переход в приложение
|
||||
CMD_PING = 0xAA, ///< Команда на пинг
|
||||
}BootloaderCommand_t;
|
||||
|
||||
/**
|
||||
* @brief Состояния конечного автомата бутлоадера
|
||||
*/
|
||||
typedef enum {
|
||||
BL_STATE_INIT = 0, ///< Состояние: инициализация
|
||||
BL_STATE_JUMP_TO_APP, ///< Состояние: запуск приложения
|
||||
BL_STATE_IDLE, ///< Состояние: ожидание команд
|
||||
BL_STATE_ERASE, ///< Состояние: стирание флеша
|
||||
BL_STATE_RECEIVE_UART, ///< Состояние: прием прошивки по UART
|
||||
BL_STATE_RECEIVE_CAN, ///< Состояние: прием прошивки по CAN
|
||||
BL_STATE_WRITE, ///< Состояние: запись данных
|
||||
BL_STATE_ERROR, ///< Состояние: ошибка
|
||||
BL_STATE_RESET, ///< Состояние: сброс контролллера
|
||||
BL_STATE_JUMP_TO_BOOT, ///< Состояние: запуск приложения
|
||||
} BootloaderState_t;
|
||||
|
||||
/**
|
||||
* @brief Ошибки бутлоадера
|
||||
*/
|
||||
typedef union {
|
||||
uint16_t all; ///< Все ошибки одним числом
|
||||
struct {
|
||||
unsigned hardfault_cycle:1; ///< Прерывание HardFault
|
||||
unsigned memmanage_cycle:1; ///< Прерывание MemManage
|
||||
unsigned watchdog_reset:1; ///< Watchdog сброс
|
||||
unsigned unknown_cmd:1; ///< Неизвестная команда
|
||||
unsigned erase_err:1; ///< Ошибка стирания
|
||||
unsigned write_err:1; ///< Ошибка записи
|
||||
unsigned verify_err:1; ///< Ошибка проверки прошивки
|
||||
unsigned overflow:1; ///< Слишком много данных
|
||||
unsigned timeout_receive:1; ///< Таймаут приёма
|
||||
unsigned crc_err:1; ///< Ошибка CRC
|
||||
} bit;
|
||||
} BootloaderError_t;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Дескриптор бутлоадера
|
||||
*/
|
||||
typedef struct {
|
||||
BootloaderState_t state; ///< текущее состояние бутлоадера
|
||||
BootloaderError_t error; ///< ошибки бутлоадера
|
||||
|
||||
uint32_t addr; ///< текущий адрес прошивки
|
||||
|
||||
uint8_t fw_size; ///< размер прошивки
|
||||
uint8_t fw_buffer[PAGE_SIZE]; ///< буфер для приема прошивки (UART/CAN)
|
||||
uint32_t fw_len; ///< длина принятого пакета
|
||||
uint32_t fw_crc; ///< контрольная сумма прошивки
|
||||
|
||||
UART_HandleTypeDef *huart; ///< хендлер UART
|
||||
CAN_HandleTypeDef *hcan; ///< хендер CAN
|
||||
CAN_TxHeaderTypeDef TxHeader; ///< Заголовок CAN сообщения для отправки
|
||||
BootloaderState_t prev_state; ///< предыдущее состояние бутлоадера
|
||||
} Bootloader_t;
|
||||
|
||||
/* Основная задача бутлоадера */
|
||||
void Bootloader_Task(Bootloader_t *bl);
|
||||
|
||||
/* Настройка тактирования */
|
||||
void Boot_SystemClock_Config(void);
|
||||
/* Хендлер ошибки */
|
||||
void Error_Handler(void);
|
||||
/* CRC */
|
||||
uint32_t CRC32_Compute(const uint8_t* data, uint32_t length);
|
||||
|
||||
#endif //__BOOTLOADER_H
|
162
Core/Bootloader/Src/boot_can.c
Normal file
162
Core/Bootloader/Src/boot_can.c
Normal file
@ -0,0 +1,162 @@
|
||||
#include "boot_can.h"
|
||||
#include "boot_gpio.h"
|
||||
|
||||
CAN_HandleTypeDef hcan_boot;
|
||||
|
||||
CAN_TxHeaderTypeDef TxHeaderBoot;
|
||||
CAN_RxHeaderTypeDef RxHeaderBoot;
|
||||
uint32_t TxMailBoxBoot = 0;
|
||||
uint8_t TXDataBoot[8] = {0};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Инициализация CAN для бутлоадера
|
||||
*/
|
||||
void MX_BOOT_CAN_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
CAN_FilterTypeDef sFilterConfig;
|
||||
|
||||
/* Включаем тактирование */
|
||||
__RCC_CAN_BOOT_CLK_ENABLE();
|
||||
__RCC_CAN_PORT_CLK_ENABLE();
|
||||
|
||||
/* Настройка пинов RX/TX */
|
||||
GPIO_InitStruct.Pin = CAN_PIN_RX;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(CAN_PORT, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = CAN_PIN_TX;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(CAN_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Настройка CAN */
|
||||
hcan_boot.Instance = CAN_BOOT;
|
||||
hcan_boot.Init.Prescaler = CAN_SPEED_PRESCALER;
|
||||
hcan_boot.Init.Mode = CAN_MODE;
|
||||
hcan_boot.Init.SyncJumpWidth = CAN_SJW_1TQ;
|
||||
hcan_boot.Init.TimeSeg1 = CAN_SPEED_BS1;
|
||||
hcan_boot.Init.TimeSeg2 = CAN_SPEED_BS2;
|
||||
hcan_boot.Init.TimeTriggeredMode = DISABLE;
|
||||
hcan_boot.Init.AutoBusOff = DISABLE;
|
||||
hcan_boot.Init.AutoWakeUp = DISABLE;
|
||||
hcan_boot.Init.AutoRetransmission = ENABLE;
|
||||
hcan_boot.Init.ReceiveFifoLocked = DISABLE;
|
||||
hcan_boot.Init.TransmitFifoPriority = DISABLE;
|
||||
|
||||
if (HAL_CAN_Init(&hcan_boot) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Настройка фильтра: пропускать все сообщения */
|
||||
sFilterConfig.FilterBank = 0;
|
||||
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
|
||||
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
|
||||
sFilterConfig.FilterIdHigh = 0x0000;
|
||||
sFilterConfig.FilterIdLow = 0x0000;
|
||||
sFilterConfig.FilterMaskIdHigh = 0x0000;
|
||||
sFilterConfig.FilterMaskIdLow = 0x0000;
|
||||
sFilterConfig.FilterFIFOAssignment = CAN_FILTER_FIFO0;
|
||||
sFilterConfig.FilterActivation = ENABLE;
|
||||
|
||||
if (HAL_CAN_ConfigFilter(&hcan_boot, &sFilterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Запускаем CAN */
|
||||
if (HAL_CAN_Start(&hcan_boot) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Приём команды по CAN по протоколу:
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
* @retval BootloaderCommand_t — принятая команда или NO_CMD
|
||||
*/
|
||||
BootloaderCommand_t Bootloader_CAN_Receive(Bootloader_t *bl)
|
||||
{
|
||||
BootloaderCommand_t cmd = NO_CMD;
|
||||
uint8_t canData[8];
|
||||
if (HAL_CAN_GetRxFifoFillLevel(bl->hcan, CAN_RX_FIFO0) > 0)
|
||||
{
|
||||
if (HAL_CAN_GetRxMessage(bl->hcan, CAN_RX_FIFO0, &RxHeaderBoot, canData) == HAL_OK)
|
||||
{
|
||||
cmd = canData[0]; // предполагаем, что команда в первом байте
|
||||
}
|
||||
}
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Приём CAN: страница + CRC
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
*/
|
||||
void Bootloader_CAN_Receive_Page(Bootloader_t *bl)
|
||||
{
|
||||
uint16_t bytes_received = 0;
|
||||
CAN_RxHeaderTypeDef canHeader;
|
||||
uint8_t canData[8];
|
||||
uint32_t start_tick = HAL_GetTick();
|
||||
|
||||
// Приём страницы прошивки
|
||||
while(bytes_received < PAGE_SIZE)
|
||||
{
|
||||
if(HAL_CAN_GetRxFifoFillLevel(bl->hcan, CAN_RX_FIFO0) > 0)
|
||||
{
|
||||
if(HAL_CAN_GetRxMessage(bl->hcan, CAN_RX_FIFO0, &canHeader, canData) == HAL_OK)
|
||||
{
|
||||
uint8_t len = canHeader.DLC;
|
||||
if(bytes_received + len > PAGE_SIZE)
|
||||
len = PAGE_SIZE - bytes_received;
|
||||
|
||||
memcpy(&bl->fw_buffer[bytes_received], canData, len);
|
||||
bytes_received += len;
|
||||
start_tick = HAL_GetTick(); // сброс таймаута
|
||||
LED_BOOT_TOOGLE();
|
||||
}
|
||||
}
|
||||
|
||||
// проверка таймаута
|
||||
if(HAL_GetTick() - start_tick >= FW_RECEIVE_TIMEOUT_MS)
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Приём CRC (4 байта)
|
||||
start_tick = HAL_GetTick(); // сброс таймаута
|
||||
while(1)
|
||||
{
|
||||
if(HAL_CAN_GetRxFifoFillLevel(bl->hcan, CAN_RX_FIFO0) > 0)
|
||||
{
|
||||
if(HAL_CAN_GetRxMessage(bl->hcan, CAN_RX_FIFO0, &canHeader, canData) == HAL_OK)
|
||||
{
|
||||
// CRC в первых 4 байтах пакета
|
||||
bl->fw_crc = (canData[0] << 24) |
|
||||
(canData[1] << 16) |
|
||||
(canData[2] << 8) |
|
||||
canData[3];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Таймаут
|
||||
if(HAL_GetTick() - start_tick >= FW_RECEIVE_TIMEOUT_MS)
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bl->fw_len = PAGE_SIZE;
|
||||
bl->state = BL_STATE_IDLE;
|
||||
}
|
||||
|
92
Core/Bootloader/Src/boot_flash.c
Normal file
92
Core/Bootloader/Src/boot_flash.c
Normal file
@ -0,0 +1,92 @@
|
||||
#include "boot_flash.h"
|
||||
uint32_t word_data;
|
||||
|
||||
|
||||
HAL_StatusTypeDef FLASH_Erase_App(void) //
|
||||
{
|
||||
HAL_StatusTypeDef res;
|
||||
uint32_t PageError = 0x00;
|
||||
|
||||
res = HAL_FLASH_Unlock();
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
FLASH_EraseInitTypeDef EraseInitStruct;
|
||||
|
||||
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;// erase pages
|
||||
EraseInitStruct.Banks = 1;
|
||||
EraseInitStruct.PageAddress = MAIN_APP_START_ADR; //address
|
||||
EraseInitStruct.NbPages = MAIN_APP_NUM_OF_PAGE;// num of erased pages
|
||||
|
||||
res = HAL_FLASHEx_Erase(&EraseInitStruct, &PageError);
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
res = HAL_FLASH_Lock();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HAL_StatusTypeDef FLASH_Write_Page(uint32_t *Address, uint8_t *Data, int Data_size)
|
||||
{
|
||||
//GPIOB->ODR^=(0x2000);
|
||||
// GPIOB->ODR|=0x4000;
|
||||
|
||||
HAL_StatusTypeDef res;
|
||||
int data_cnt = 0;
|
||||
uint32_t adr;
|
||||
|
||||
|
||||
res = HAL_FLASH_Unlock();
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
for (adr = *Address; adr < *Address + Data_size; adr = adr+4)
|
||||
{
|
||||
word_data = (
|
||||
Data[data_cnt]|
|
||||
Data[data_cnt+1]<<8|
|
||||
Data[data_cnt+2]<<16|
|
||||
Data[data_cnt+3]<<24);
|
||||
|
||||
res = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, adr, word_data);
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
data_cnt +=4;
|
||||
}
|
||||
|
||||
*Address += Data_size;
|
||||
res = HAL_FLASH_Lock();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HAL_StatusTypeDef FLASH_Write_Word(uint32_t Address, uint64_t Data) //Куда записывать
|
||||
{
|
||||
HAL_StatusTypeDef res;
|
||||
|
||||
res = HAL_FLASH_Unlock();
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
res = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, Address, (uint32_t)(Data));
|
||||
|
||||
if (res != HAL_OK) return res;
|
||||
|
||||
res = HAL_FLASH_Lock();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
24
Core/Bootloader/Src/boot_gpio.c
Normal file
24
Core/Bootloader/Src/boot_gpio.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include "boot_gpio.h"
|
||||
|
||||
/**
|
||||
* @brief Инициализация GPIO для бутлоадера
|
||||
*/
|
||||
void MX_BOOT_GPIO_Init(void)
|
||||
{
|
||||
__RCC_LED_BOOT_CLK_ENABLE();
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
GPIO_InitStruct.Pin = LED_BOOT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; // Push-Pull выход
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL; // Без подтяжки
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; // Низкая скорость
|
||||
HAL_GPIO_Init(LED_BOOT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
for(int cnt = 0; cnt < 5; cnt++)
|
||||
{
|
||||
LED_BOOT_ON();
|
||||
for(int delay = 0; delay < 10000; delay++);
|
||||
LED_BOOT_OFF();
|
||||
for(int delay = 0; delay < 10000; delay++);
|
||||
}
|
||||
}
|
150
Core/Bootloader/Src/boot_jump.c
Normal file
150
Core/Bootloader/Src/boot_jump.c
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
* @file boot_jump.c
|
||||
* @brief Функции для перехода между бутлоадером и основным приложением,
|
||||
* управление ключом BOOT и проверка прошивки.
|
||||
*
|
||||
* Основные возможности:
|
||||
* - Настройка вектора прерываний для запуска приложения
|
||||
* - Управление ключом BOOT в Flash
|
||||
* - Проверка корректности прошивки перед прыжком
|
||||
* - Функции прыжка: Bootloader <-> Application
|
||||
*/
|
||||
#include "boot_jump.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Инициализация приложения.
|
||||
* Устанавливает вектор прерываний на начало основного приложения.
|
||||
*/
|
||||
void App_Init(void)
|
||||
{
|
||||
__disable_irq();
|
||||
SCB->VTOR = MAIN_APP_START_ADR;
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Переход в бутлоадер.
|
||||
* Сбрасывает ключ BOOT и выполняет системный сброс.
|
||||
*/
|
||||
void JumpToBootloader(void)
|
||||
{
|
||||
// jump to boot
|
||||
ResetKey(); // сброс ключа (не erase, просто битый ключ)
|
||||
NVIC_SystemReset(); // сброс и переход в бутлоадер (т.к. нет ключа)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Переход к основному приложению.
|
||||
* Настраивает стек и переход к ResetHandler приложения.
|
||||
*/
|
||||
void JumpToApplocation(void)
|
||||
{
|
||||
//Деинициализация HAL
|
||||
HAL_DeInit();
|
||||
|
||||
//Перенос вектора прерываний на начало зашитой программы
|
||||
__disable_irq();
|
||||
__set_MSP(*((volatile uint32_t*)MAIN_APP_START_ADR));
|
||||
__enable_irq();
|
||||
|
||||
//Переход к выполнению зашитой программы
|
||||
__ASM volatile(
|
||||
"ldr r0, [%0, #4]\n" // r0 = *(MAIN_APP_START_ADR + 4)
|
||||
"bx r0\n" // переход по адресу в r0
|
||||
:
|
||||
: "r"(MAIN_APP_START_ADR)
|
||||
: "r0"
|
||||
);
|
||||
//Note: asm потому что при O0 компилятор делал локальные переменные,
|
||||
// из-за чего при смене стека он не мог получить адрес для прыжка
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Сброс ключа BOOT в Flash.
|
||||
* Делает ключ «битым», чтобы MCU остался в бутлоадере при следующем перезапуске.
|
||||
*/
|
||||
void ResetKey(void)
|
||||
{
|
||||
HAL_FLASH_Unlock();
|
||||
|
||||
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, BOOTLOADER_KEY_ADR, 0);
|
||||
|
||||
HAL_FLASH_Lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Установка ключа BOOT в Flash.
|
||||
* Указывает, что прошивка записана корректно.
|
||||
*/
|
||||
void SetKey(void)
|
||||
{
|
||||
HAL_FLASH_Unlock();
|
||||
|
||||
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, BOOTLOADER_KEY_ADR, BL_KEY_APP_WRITTEN);
|
||||
|
||||
HAL_FLASH_Lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Чтение ключа BOOT из Flash.
|
||||
* @retval Значение ключа
|
||||
*/
|
||||
uint32_t ReadKey(void)
|
||||
{
|
||||
return (*(__IO uint32_t*)BOOTLOADER_KEY_ADR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Стирание ключа BOOT в Flash (одна страница).
|
||||
*/
|
||||
void EraseKey(void)
|
||||
{
|
||||
FLASH_EraseInitTypeDef EraseInitStruct;
|
||||
HAL_FLASH_Unlock();
|
||||
uint32_t PageError = 0x00;
|
||||
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;// erase pages
|
||||
EraseInitStruct.PageAddress = BOOTLOADER_KEY_ADR; //address
|
||||
EraseInitStruct.NbPages = 0x01;// num of erased pages
|
||||
|
||||
HAL_FLASHEx_Erase(&EraseInitStruct, &PageError);
|
||||
HAL_FLASH_Lock();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Проверка валидности прошивки перед переходом к приложению.
|
||||
* Проверяет MSP и ResetHandler.
|
||||
* @retval HAL_OK - прошивка валидна
|
||||
* HAL_ERROR - прошивка повреждена или некорректна
|
||||
*/
|
||||
HAL_StatusTypeDef Verify_Firmware(void)
|
||||
{
|
||||
uint32_t msp = *((volatile uint32_t*)(MAIN_APP_START_ADR));
|
||||
uint32_t reset = *((volatile uint32_t*)(MAIN_APP_START_ADR + 4));
|
||||
|
||||
/* 1) Проверка MSP: должен быть указателем в SRAM */
|
||||
if ((msp < SRAM_START_ADR) || (msp > SRAM_END_ADR))
|
||||
{
|
||||
/* Некорректный стек — прошивка невалидна */
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
/* 2) Проверка reset handler:
|
||||
- бит0 должен быть 1 (Thumb)
|
||||
- адрес без бита0 должен лежать в пределах flash (MAIN_APP_START_ADR .. FLASH_END_ADR)
|
||||
*/
|
||||
if ((reset & 0x1) == 0)
|
||||
{
|
||||
/* Не Thumb-при-старте — подозрительно */
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
uint32_t reset_addr = (reset & (~1U)); /* выравненный адрес */
|
||||
if ((reset_addr < FLASH_START_ADR) || (reset_addr > FLASH_END_ADR))
|
||||
{
|
||||
/* Reset handler вне flash */
|
||||
return HAL_ERROR;
|
||||
}
|
||||
return HAL_OK;
|
||||
}
|
189
Core/Bootloader/Src/boot_main.c
Normal file
189
Core/Bootloader/Src/boot_main.c
Normal file
@ -0,0 +1,189 @@
|
||||
#include "bootloader.h"
|
||||
Bootloader_t boot = {0};
|
||||
|
||||
int main()
|
||||
{
|
||||
__disable_irq();
|
||||
SCB->VTOR = FLASH_BASE;
|
||||
__enable_irq();
|
||||
|
||||
|
||||
boot.state = BL_STATE_INIT;
|
||||
while (1)
|
||||
{
|
||||
Bootloader_Task(&boot);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Boot_SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/* Включаем внутренний генератор HSI */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_OFF; // без PLL
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Настройка шин AHB/APB */
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; // HSI = 8 MHz
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // HCLK = 8 MHz
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; // PCLK1 = 8 MHz
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // PCLK2 = 8 MHz
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M3 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
|
||||
/* Включаем тактирование PWR и BKP (APB1) и разрешаем доступ к BKP domain */
|
||||
/* Записываем напрямую в регистры RCC/APB1ENR и PWR->CR */
|
||||
SaveErrorCode(0xDEAD);
|
||||
NVIC_SystemReset();
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||
SaveErrorCode(0xBEEF);
|
||||
NVIC_SystemReset();
|
||||
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Prefetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END BusFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END UsageFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 0 */
|
||||
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 0 */
|
||||
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 1 */
|
||||
}
|
||||
|
||||
|
||||
void Error_Handler(void)
|
||||
{
|
||||
NVIC_SystemReset();
|
||||
}
|
182
Core/Bootloader/Src/boot_uart.c
Normal file
182
Core/Bootloader/Src/boot_uart.c
Normal file
@ -0,0 +1,182 @@
|
||||
#include "boot_uart.h"
|
||||
#include "boot_gpio.h"
|
||||
|
||||
UART_HandleTypeDef huart_boot;
|
||||
|
||||
/**
|
||||
* @brief Инициализация UART для бутлоадера
|
||||
*/
|
||||
void MX_BOOT_UART_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
|
||||
/* Включаем тактирование */
|
||||
__RCC_UART_BOOT_CLK_ENABLE();
|
||||
__RCC_UART_PORT_CLK_ENABLE();
|
||||
|
||||
/* Настройка GPIO TX/RX */
|
||||
GPIO_InitStruct.Pin = UART_PIN_TX;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(UART_PORT, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = UART_PIN_RX;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(UART_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Настройка UART */
|
||||
huart_boot.Instance = UART_BOOT;
|
||||
huart_boot.Init.BaudRate = UART_SPEED;
|
||||
huart_boot.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
huart_boot.Init.StopBits = UART_STOPBITS_1;
|
||||
huart_boot.Init.Parity = UART_PARITY_NONE;
|
||||
huart_boot.Init.Mode = UART_MODE_TX_RX;
|
||||
huart_boot.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
huart_boot.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
|
||||
if (HAL_UART_Init(&huart_boot) != HAL_OK)
|
||||
{
|
||||
Error_Handler(); // твоя функция обработки ошибок
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Приём команды по UART по протоколу:
|
||||
* [SOH][CMD][LEN_H][LEN_L][DATA ...][CRC32_H..CRC32_L]
|
||||
* Idle — не блокируется до SOH
|
||||
* После SOH — блокирующий приём всего пакета
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
* @retval BootloaderCommand_t — принятая команда или NO_CMD
|
||||
*/
|
||||
BootloaderCommand_t Bootloader_UART_Receive(Bootloader_t *bl)
|
||||
{
|
||||
BootloaderCommand_t cmd;
|
||||
uint8_t byte = 0;
|
||||
HAL_StatusTypeDef res;
|
||||
|
||||
// -----------------------------
|
||||
// 1. Ждём SOH в неблокирующем режиме
|
||||
res = HAL_UART_Receive(bl->huart, &byte, 1, 1); // 1 ms таймаут
|
||||
if(res != HAL_OK)
|
||||
return NO_CMD; // пакета нет
|
||||
|
||||
if(byte != 0xAA)
|
||||
return NO_CMD; // игнорируем мусор
|
||||
|
||||
// -----------------------------
|
||||
// 2. Блокирующий приём CMD + LEN_H + LEN_L
|
||||
uint8_t header[3];
|
||||
res = HAL_UART_Receive(bl->huart, header, 3, FW_RECEIVE_TIMEOUT_MS);
|
||||
if(res != HAL_OK)
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return NO_CMD;
|
||||
}
|
||||
|
||||
cmd = (BootloaderCommand_t)header[0];
|
||||
bl->fw_len = ((uint16_t)header[1] << 8) | header[2];
|
||||
|
||||
if(bl->fw_len > PAGE_SIZE)
|
||||
{
|
||||
bl->error.bit.overflow = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return NO_CMD;
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// 3. Блокирующий приём DATA
|
||||
for(uint16_t i = 0; i < bl->fw_len; i++)
|
||||
{
|
||||
res = HAL_UART_Receive(bl->huart, &bl->fw_buffer[i], 1, FW_RECEIVE_TIMEOUT_MS);
|
||||
if(res != HAL_OK)
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return NO_CMD;
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// 4. Приём CRC32
|
||||
uint8_t crc_buf[4];
|
||||
res = HAL_UART_Receive(bl->huart, crc_buf, 4, FW_RECEIVE_TIMEOUT_MS);
|
||||
if(res != HAL_OK)
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return NO_CMD;
|
||||
}
|
||||
bl->fw_crc = (crc_buf[0]<<24) | (crc_buf[1]<<16) | (crc_buf[2]<<8) | crc_buf[3];
|
||||
|
||||
// -----------------------------
|
||||
// 5. Проверка CRC по всему пакету (CMD + LEN + DATA)
|
||||
uint32_t crc_calc = CRC32_Compute(header, 3); // CMD + LEN
|
||||
crc_calc = CRC32_Compute(bl->fw_buffer, bl->fw_len) ^ crc_calc; // DATA
|
||||
|
||||
if(crc_calc != bl->fw_crc)
|
||||
{
|
||||
bl->error.bit.crc_err = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return NO_CMD;
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// 6. Всё верно — возвращаем команду
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Приём UART: страница + CRC
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
*/
|
||||
void Bootloader_UART_Receive_Page(Bootloader_t *bl)
|
||||
{
|
||||
uint16_t bytes_received = 0;
|
||||
uint8_t crc_buf[4];
|
||||
HAL_StatusTypeDef res;
|
||||
uint32_t start_tick = HAL_GetTick(); // старт таймера
|
||||
|
||||
// Приём данных страницы
|
||||
while(bytes_received < PAGE_SIZE)
|
||||
{
|
||||
uint8_t byte = 0;
|
||||
res = HAL_UART_Receive(bl->huart, &byte, 1, FW_RECEIVE_TIMEOUT_MS); // блокирующий приём 100ms
|
||||
|
||||
if(res == HAL_OK)
|
||||
{
|
||||
bl->fw_buffer[bytes_received++] = byte;
|
||||
start_tick = HAL_GetTick(); // сброс таймера при успешном приёме
|
||||
LED_BOOT_TOOGLE();
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR; // превышен таймаут
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Приём CRC (4 байта)
|
||||
for(uint8_t i = 0; i < 4; i++)
|
||||
{
|
||||
res = HAL_UART_Receive(bl->huart, &crc_buf[i], 1, FW_RECEIVE_TIMEOUT_MS);
|
||||
if(res == HAL_OK)
|
||||
{
|
||||
start_tick = HAL_GetTick(); // сброс таймера
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->error.bit.timeout_receive = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Сохраняем CRC в структуру
|
||||
bl->fw_crc = (crc_buf[0] << 24) | (crc_buf[1] << 16) | (crc_buf[2] << 8) | crc_buf[3];
|
||||
bl->fw_len = bytes_received;
|
||||
bl->state = BL_STATE_IDLE;
|
||||
}
|
487
Core/Bootloader/Src/bootloader.c
Normal file
487
Core/Bootloader/Src/bootloader.c
Normal file
@ -0,0 +1,487 @@
|
||||
/******************************************************************************
|
||||
* @file bootloader.c
|
||||
* @brief Бутлоадер STM32 — реализован как конечный автомат (state machine).
|
||||
*
|
||||
* @details
|
||||
* Логика работы:
|
||||
* - Структура Bootloader_t содержит текущее состояние и ошибки.
|
||||
* - После сброса проверяются предыдущие ошибки.
|
||||
* - Проверяется BOOT KEY, чтобы определить: запускать основное приложение или оставаться в бутлоадере.
|
||||
* - Основной цикл — state machine:
|
||||
* INIT — проверка ключа, инициализация периферии
|
||||
* IDLE — ожидание команд по UART/CAN
|
||||
* RECEIVE_UART/RECEIVE_CAN — приём страницы прошивки
|
||||
* WRITE — запись страницы во Flash
|
||||
* ERASE — стирание приложения
|
||||
* JUMP_TO_APP — проверка прошивки и переход к приложению
|
||||
* JUMP_TO_BOOT— возврат в бутлоадер
|
||||
* RESET — программный сброс
|
||||
* ERROR — обработка ошибок и уведомление внешнего интерфейса
|
||||
* - Команды прошивки (BootloaderCommand_t) обрабатываются через Receive_FW_Command().
|
||||
* - Проверка целостности данных осуществляется через CRC32.
|
||||
*
|
||||
* Подключение бутлоадера в основном приложении:
|
||||
* 0) Подключить boot_jump.h и boot_jump.c для взаимодействия с бутлоадером:
|
||||
* @code #include "boot_jump.h" @endcode
|
||||
* 1) В начале main() вызвать App_Init(), чтобы установить VTOR на
|
||||
* начало приложения:
|
||||
* @code App_Init(); @endcode
|
||||
* 2) Для перехода в бутлоадер (например, при ошибке или обновлении):
|
||||
* @code JumpToBootloader(); @endcode
|
||||
******************************************************************************/
|
||||
#include "bootloader.h"
|
||||
#include "boot_gpio.h"
|
||||
#include "boot_flash.h"
|
||||
#include "boot_uart.h"
|
||||
#include "boot_can.h"
|
||||
#include "boot_jump.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Глобальные переменные для HAL-периферии
|
||||
// -----------------------------------------------------------------------------
|
||||
HAL_StatusTypeDef res_hal;
|
||||
uint32_t led_err_lasttick = 0;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Локальные (static) функции
|
||||
// -----------------------------------------------------------------------------
|
||||
static uint8_t Receive_FW_Command(Bootloader_t *bl);
|
||||
|
||||
/**
|
||||
* @brief Проверка после сброса MCU.
|
||||
* Определяет причину предыдущего сброса, проверяет ошибки и при необходимости
|
||||
* выставляет соответствующие биты в структуре ошибок бутлоадера.
|
||||
*/
|
||||
void Bootloader_StartCheck(Bootloader_t *bl)
|
||||
{
|
||||
uint32_t ErrCodeBoot = 0;
|
||||
uint32_t ErrCntBoot = 0;
|
||||
|
||||
// Проверка watchdog reset (IWDGRSTF или WWDGRSTF в RCC->CSR)
|
||||
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) || __HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST))
|
||||
{
|
||||
//SaveErrorCode(0x0D0D);
|
||||
__HAL_RCC_CLEAR_RESET_FLAGS(); // Очистить флаги сброса, чтобы не повторялось
|
||||
}
|
||||
|
||||
// Чтение сохранённого кода ошибки и количества сбоев
|
||||
ErrCodeBoot = GetErrorCode();
|
||||
ErrCntBoot = GetErrorCnt();
|
||||
// Если ошибок было больше 5, фиксируем тип ошибки и уходим в бутлоадер
|
||||
// Данные ошибки фиксируются только в прерываниях бутлоадера. Hardfault в прерывании приложения не считается
|
||||
if(ErrCntBoot > 5)
|
||||
{
|
||||
ClearErrorCode();
|
||||
if(ErrCodeBoot == 0xDEAD) // HardFault
|
||||
{
|
||||
ResetKey();
|
||||
bl->error.bit.hardfault_cycle = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
else if(ErrCodeBoot == 0xBEEF) // MemManage
|
||||
{
|
||||
ResetKey();
|
||||
bl->error.bit.memmanage_cycle = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
/*else if(ErrCodeBoot == 0x0D0D) пока хз надо ли
|
||||
{
|
||||
ResetKey();
|
||||
bl->error.bit.watchdog_reset = 1; // Добавь бит в структуру BootloaderError_
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Инициализация периферии бутлоадера (UART, CAN, системный такт).
|
||||
* Привязывает дескрипторы HAL к структуре бутлоадера и задаёт
|
||||
* начальный адрес приложения.
|
||||
*/
|
||||
void Bootloader_Init(Bootloader_t *bl)
|
||||
{
|
||||
HAL_Init();
|
||||
|
||||
Boot_SystemClock_Config();
|
||||
MX_BOOT_UART_Init();
|
||||
MX_BOOT_CAN_Init();
|
||||
|
||||
// Привязка дескрипторов к структуре бутлоадера
|
||||
bl->huart = &huart_boot;
|
||||
bl->hcan = &hcan_boot;
|
||||
bl->TxHeader.DLC = 8;
|
||||
bl->TxHeader.StdId = 123;
|
||||
bl->addr = MAIN_APP_START_ADR; // адрес начала приложения
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Основной цикл работы бутлоадера (машина состояний).
|
||||
* Обрабатывает состояния INIT, IDLE, RECEIVE, WRITE, ERASE, JUMP и ERROR.
|
||||
*/
|
||||
void Bootloader_Task(Bootloader_t *bl)
|
||||
{
|
||||
int receive_uart_flag;
|
||||
|
||||
switch (bl->state)
|
||||
{
|
||||
case BL_STATE_INIT:
|
||||
/*
|
||||
* Состояние инициализации.
|
||||
* - включаем индикацию (LED),
|
||||
* - проверяем ошибки,
|
||||
* - читаем "ключ" (метку, что приложение уже записано).
|
||||
* Если ключ установлен -> сразу переход в приложение.
|
||||
* Иначе -> переходим в режим ожидания команд от хоста (IDLE),
|
||||
* инициализируем интерфейсы (CAN/UART, CRC и т.д.).
|
||||
*/
|
||||
bl->prev_state = bl->state;
|
||||
MX_BOOT_GPIO_Init();
|
||||
Bootloader_StartCheck(bl);
|
||||
|
||||
if ((ReadKey() == BL_KEY_APP_WRITTEN))
|
||||
{
|
||||
bl->state = BL_STATE_JUMP_TO_APP;
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->state = BL_STATE_IDLE;
|
||||
Bootloader_Init(bl);
|
||||
}
|
||||
break;
|
||||
|
||||
case BL_STATE_IDLE:
|
||||
/*
|
||||
* Состояние ожидания команд.
|
||||
* - если ошибка уже зафиксирована -> переход в ERROR,
|
||||
* - если это первый вход в IDLE -> отправляем "готов" (0x00) по CAN/UART,
|
||||
* - далее слушаем команды от хоста (erase, write, jump и т.п.).
|
||||
* Неизвестная команда -> ошибка.
|
||||
*/
|
||||
if(bl->error.all)
|
||||
{
|
||||
bl->prev_state = bl->state;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
if((bl->state != bl->prev_state) && (bl->prev_state != BL_STATE_ERROR))
|
||||
{
|
||||
TXDataBoot[0] = 0x00;
|
||||
res_hal = HAL_CAN_AddTxMessage(bl->hcan, &bl->TxHeader, TXDataBoot, &TxMailBoxBoot);
|
||||
res_hal = HAL_UART_Transmit(bl->huart, TXDataBoot, 1, 100);
|
||||
}
|
||||
|
||||
bl->prev_state = bl->state;
|
||||
|
||||
if (Receive_FW_Command(bl) == 0xFF)
|
||||
{
|
||||
bl->error.bit.unknown_cmd = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case BL_STATE_RESET:
|
||||
/*
|
||||
* Состояние сброса.
|
||||
* Вызывает системный reset через NVIC -> контроллер запускается заново.
|
||||
*/
|
||||
NVIC_SystemReset();
|
||||
break;
|
||||
|
||||
case BL_STATE_ERASE:
|
||||
/*
|
||||
* Состояние стирания Flash.
|
||||
* - сбрасываем "ключ" приложения,
|
||||
* - стираем область памяти под приложение,
|
||||
* - при успехе возвращаемся в IDLE,
|
||||
* - при ошибке отмечаем ошибку стирания и уходим в ERROR.
|
||||
* По завершению гасим LED.
|
||||
*/
|
||||
bl->prev_state = bl->state;
|
||||
EraseKey();
|
||||
if (FLASH_Erase_App() == HAL_OK)
|
||||
{
|
||||
HAL_Delay(50);
|
||||
bl->state = BL_STATE_IDLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->error.bit.erase_err = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
LED_BOOT_OFF();
|
||||
break;
|
||||
|
||||
case BL_STATE_RECEIVE_UART:
|
||||
case BL_STATE_RECEIVE_CAN:
|
||||
/*
|
||||
* Состояние приёма страницы прошивки от хоста.
|
||||
* - различаем, пришло ли по UART или CAN,
|
||||
* - отправляем ACK (0x00),
|
||||
* - читаем блок данных (страницу) в буфер,
|
||||
* - после приёма проверяем CRC полученного блока,
|
||||
* - если CRC не совпадает -> очищаем буфер, фиксируем ошибку и уходим в ERROR.
|
||||
* По завершению приёма гасим LED.
|
||||
*/
|
||||
receive_uart_flag = (bl->state == BL_STATE_RECEIVE_UART) ? 1 : 0;
|
||||
|
||||
TXDataBoot[0] = 0x00;
|
||||
bl->prev_state = bl->state;
|
||||
|
||||
if(receive_uart_flag)
|
||||
{
|
||||
res_hal = HAL_UART_Transmit(bl->huart, TXDataBoot, 1, 100);
|
||||
Bootloader_UART_Receive_Page(bl);
|
||||
}
|
||||
else
|
||||
{
|
||||
res_hal = HAL_CAN_AddTxMessage(bl->hcan, &bl->TxHeader, TXDataBoot, &TxMailBoxBoot);
|
||||
Bootloader_CAN_Receive_Page(bl);
|
||||
}
|
||||
|
||||
uint32_t crc_calculated = CRC32_Compute((uint8_t *)bl->fw_buffer, bl->fw_len);
|
||||
if(crc_calculated != bl->fw_crc)
|
||||
{
|
||||
for(int i = 0; i < bl->fw_len; i++)
|
||||
{
|
||||
bl->fw_buffer[i] = 0;
|
||||
}
|
||||
bl->error.bit.crc_err = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
LED_BOOT_OFF();
|
||||
break;
|
||||
|
||||
case BL_STATE_WRITE:
|
||||
/*
|
||||
* Состояние записи страницы прошивки во Flash.
|
||||
* - пытаемся записать буфер в указанную область памяти,
|
||||
* - если успешно -> возвращаемся в IDLE (ждём следующего блока),
|
||||
* - если ошибка -> фиксируем ошибку записи и уходим в ERROR.
|
||||
* После завершения гасим LED.
|
||||
*/
|
||||
bl->prev_state = bl->state;
|
||||
if (FLASH_Write_Page(&bl->addr, bl->fw_buffer, bl->fw_len) == HAL_OK)
|
||||
{
|
||||
bl->state = BL_STATE_IDLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->error.bit.write_err = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
LED_BOOT_OFF();
|
||||
break;
|
||||
|
||||
case BL_STATE_JUMP_TO_APP:
|
||||
/*
|
||||
* Состояние перехода в приложение.
|
||||
* - выполняем проверку корректности прошивки (Verify_Firmware),
|
||||
* - если проверка пройдена -> устанавливаем "ключ" приложения,
|
||||
* чтобы пометить прошивку как валидную,
|
||||
* - если проверка не пройдена -> ошибка verify и переход в ERROR.
|
||||
* В случае успеха вызываем JumpToApplication(), передавая управление основному коду.
|
||||
*/
|
||||
bl->prev_state = bl->state;
|
||||
if (Verify_Firmware() == HAL_OK)
|
||||
{
|
||||
EraseKey();
|
||||
SetKey();
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->error.bit.verify_err = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
break;
|
||||
}
|
||||
JumpToApplocation();
|
||||
break;
|
||||
|
||||
case BL_STATE_JUMP_TO_BOOT:
|
||||
/*
|
||||
* Состояние возврата в bootloader.
|
||||
*/
|
||||
bl->prev_state = bl->state;
|
||||
JumpToBootloader();
|
||||
break;
|
||||
|
||||
case BL_STATE_ERROR:
|
||||
/*
|
||||
* Состояние ошибки.
|
||||
* - при первом входе в ERROR отправляем код ошибки (0xFF + код ошибки),
|
||||
* - продолжаем слушать команды, чтобы можно было сбросить или стереть Flash,
|
||||
* - мигаем LED раз в 500 мс для визуальной индикации ошибки.
|
||||
*/
|
||||
if(bl->state != bl->prev_state)
|
||||
{
|
||||
TXDataBoot[0] = 0xFF;
|
||||
TXDataBoot[1] = (bl->error.all >> 8) & (0xFF);
|
||||
TXDataBoot[2] = bl->error.all & (0xFF);
|
||||
res_hal = HAL_CAN_AddTxMessage(bl->hcan, &bl->TxHeader, TXDataBoot, &TxMailBoxBoot);
|
||||
res_hal = HAL_UART_Transmit(bl->huart, TXDataBoot, 1, 100);
|
||||
}
|
||||
bl->prev_state = bl->state;
|
||||
|
||||
if (Receive_FW_Command(bl) == 0xFF)
|
||||
{
|
||||
bl->error.bit.unknown_cmd = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
}
|
||||
|
||||
if(HAL_GetTick() - led_err_lasttick > 500)
|
||||
{
|
||||
led_err_lasttick = HAL_GetTick();
|
||||
LED_BOOT_TOOGLE();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* Попадание в неизвестное состояние.
|
||||
* Считается ошибкой: ставим unknown_cmd и переходим в ERROR.
|
||||
*/
|
||||
bl->error.bit.unknown_cmd = 1;
|
||||
bl->state = BL_STATE_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Устанавливает новое состояние бутлоадера в зависимости от команды.
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
* @param cmd: команда бутлоадера (BootloaderCommand_t)
|
||||
* @param uart_flag: 1 — команда пришла по UART, 0 — по CAN
|
||||
* @retval 0x00 — команда успешно обработана, 0xFF — неизвестная команда
|
||||
*/
|
||||
static uint8_t SetBootState(Bootloader_t *bl, BootloaderCommand_t cmd, uint8_t uart_flag)
|
||||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case CMD_ERASE: // команда: стереть Flash
|
||||
bl->state = BL_STATE_ERASE;
|
||||
return 0x00;
|
||||
case CMD_START_RECEIVE: // команда: принять блок
|
||||
if(uart_flag)
|
||||
bl->state = BL_STATE_RECEIVE_UART;
|
||||
else
|
||||
bl->state = BL_STATE_RECEIVE_CAN;
|
||||
return 0x00;
|
||||
case CMD_WRITE: // команда: записать блок
|
||||
bl->state = BL_STATE_WRITE;
|
||||
return 0x00;
|
||||
case CMD_GOTOAPP: // команда: прыжок в приложение
|
||||
bl->state = BL_STATE_JUMP_TO_APP;
|
||||
return 0x00;
|
||||
case CMD_RESET: // команда: прыжок в приложение
|
||||
bl->state = BL_STATE_RESET;
|
||||
return 0x00;
|
||||
case CMD_GOTOBOOT: // команда: прыжок в бутлоадер
|
||||
bl->state = BL_STATE_JUMP_TO_BOOT;
|
||||
case CMD_PING: // команда: пинг, отправка текущего состояния бутлоадера
|
||||
bl->prev_state = 0; // обнуляем предыдущее состоояние, чтобы снова отправить комманду с текущим состоянием
|
||||
return 0x00;
|
||||
|
||||
default:
|
||||
return 0xFF; // неизвестная команда
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Обработка команд прошивки по UART или CAN
|
||||
* @param bl: указатель на структуру бутлоадера
|
||||
* @retval 0x00 - команда принята и обработана, 0xFF - ошибка
|
||||
*/
|
||||
static uint8_t Receive_FW_Command(Bootloader_t *bl)
|
||||
{
|
||||
BootloaderCommand_t cmd = 0;
|
||||
HAL_StatusTypeDef res = HAL_ERROR;
|
||||
uint8_t ret_val = 0x00;
|
||||
|
||||
// ---------------------------
|
||||
// Чтение команды по UART
|
||||
// ---------------------------
|
||||
cmd = Bootloader_UART_Receive(bl); // таймаут 10 ms
|
||||
if (cmd != NO_CMD)
|
||||
{
|
||||
ret_val = SetBootState(bl, cmd, 1);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
// Чтение команды по CAN
|
||||
// ---------------------------
|
||||
cmd = Bootloader_CAN_Receive(bl);
|
||||
if (cmd != NO_CMD)
|
||||
{
|
||||
ret_val = SetBootState(bl, cmd, 0);
|
||||
}
|
||||
|
||||
#ifdef TEST_CAN
|
||||
TxHeaderBoot.StdId = 0x200; // ID OF MESSAGE
|
||||
TxHeaderBoot.ExtId = 0; // STANDART FRAME (NOT EXTENTED)
|
||||
TxHeaderBoot.RTR = CAN_RTR_DATA; // TRANSMIT DATA OR
|
||||
TxHeaderBoot.IDE = CAN_ID_STD; // STANDART FRAME
|
||||
TxHeaderBoot.DLC = 8; // DATA SIZE
|
||||
TxHeaderBoot.TransmitGlobalTime = DISABLE; //THIS MODE IS NOT USED, SO DISABLE
|
||||
uint8_t asd[8] = "ABCDEFGL";
|
||||
res_hal = HAL_CAN_AddTxMessage(&hcan_boot, &TxHeaderBoot, asd, &TxMailBoxBoot); // add to mail for transmit
|
||||
HAL_Delay(1000);
|
||||
#endif
|
||||
if((bl->state != BL_STATE_IDLE) && (bl->state != BL_STATE_ERROR))
|
||||
{
|
||||
LED_BOOT_ON();
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Вычисление CRC32 блока данных.
|
||||
* @param data: указатель на массив данных
|
||||
* @param length: длина массива в байтах
|
||||
* @retval CRC32 вычисленное значение
|
||||
*/
|
||||
uint32_t CRC32_Compute(const uint8_t* data, uint32_t length)
|
||||
{
|
||||
const uint32_t polynomial = 0x04C11DB7;
|
||||
uint32_t crc = 0xFFFFFFFF;
|
||||
|
||||
for(uint32_t i = 0; i < length; i++)
|
||||
{
|
||||
crc ^= ((uint32_t)data[i] << 24);
|
||||
for(uint8_t j = 0; j < 8; j++)
|
||||
{
|
||||
if(crc & 0x80000000)
|
||||
crc = (crc << 1) ^ polynomial;
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return crc ^ 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Конфигурация системного тактирования (должна быть переопределена пользователем).
|
||||
*/
|
||||
__WEAK void Boot_SystemClock_Config(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Обработчик ошибок (может быть переопределён пользователем).
|
||||
*/
|
||||
__WEAK void Error_Handler(void)
|
||||
{
|
||||
while(1);
|
||||
}
|
||||
|
@ -41,10 +41,9 @@ extern CAN_HandleTypeDef hcan;
|
||||
void MX_CAN_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
void Setup_CAN_addr(uint8_t mode);
|
||||
int CAN_send(uint16_t data[], int Addr, int Qua);
|
||||
|
||||
void Setup_CAN_addr(uint8_t mode);
|
||||
void CAN_filterConfig(void);
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
116
Core/Inc/gpio.h
116
Core/Inc/gpio.h
@ -33,122 +33,6 @@ extern "C" {
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
#define IN_01_Pin GPIO_PIN_3
|
||||
#define IN_01_GPIO_Port GPIOA
|
||||
#define IN_02_Pin GPIO_PIN_2
|
||||
#define IN_02_GPIO_Port GPIOA
|
||||
#define IN_03_Pin GPIO_PIN_1
|
||||
#define IN_03_GPIO_Port GPIOA
|
||||
#define IN_04_Pin GPIO_PIN_0
|
||||
#define IN_04_GPIO_Port GPIOA
|
||||
#define IN_05_Pin GPIO_PIN_15
|
||||
#define IN_05_GPIO_Port GPIOC
|
||||
#define IN_06_Pin GPIO_PIN_13
|
||||
#define IN_06_GPIO_Port GPIOC
|
||||
#define IN_07_Pin GPIO_PIN_15
|
||||
#define IN_07_GPIO_Port GPIOB
|
||||
#define IN_08_Pin GPIO_PIN_14
|
||||
#define IN_08_GPIO_Port GPIOB
|
||||
#define IN_09_Pin GPIO_PIN_13
|
||||
#define IN_09_GPIO_Port GPIOB
|
||||
#define IN_10_Pin GPIO_PIN_12
|
||||
#define IN_10_GPIO_Port GPIOB
|
||||
#define IN_11_Pin GPIO_PIN_1
|
||||
#define IN_11_GPIO_Port GPIOB
|
||||
#define IN_12_Pin GPIO_PIN_0
|
||||
#define IN_12_GPIO_Port GPIOB
|
||||
#define IN_13_Pin GPIO_PIN_5
|
||||
#define IN_13_GPIO_Port GPIOA
|
||||
#define IN_14_Pin GPIO_PIN_4
|
||||
#define IN_14_GPIO_Port GPIOA
|
||||
|
||||
#define J0_Pin GPIO_PIN_6
|
||||
#define J0_GPIO_Port GPIOA
|
||||
#define J1_Pin GPIO_PIN_7
|
||||
#define J1_GPIO_Port GPIOA
|
||||
#define J2_Pin GPIO_PIN_4
|
||||
#define J2_GPIO_Port GPIOC
|
||||
#define J3_Pin GPIO_PIN_5
|
||||
#define J3_GPIO_Port GPIOC
|
||||
#define Jselect_Pin GPIO_PIN_14
|
||||
#define Jselect_GPIO_Port GPIOC
|
||||
|
||||
#define LED0_Pin GPIO_PIN_5
|
||||
#define LED0_GPIO_Port GPIOB
|
||||
#define LED1_Pin GPIO_PIN_6
|
||||
#define LED1_GPIO_Port GPIOB
|
||||
#define LED2_Pin GPIO_PIN_2
|
||||
#define LED2_GPIO_Port GPIOC
|
||||
#define LED3_Pin GPIO_PIN_3
|
||||
#define LED3_GPIO_Port GPIOC
|
||||
|
||||
#define PVT4_Pin GPIO_PIN_6
|
||||
#define PVT4_GPIO_Port GPIOC
|
||||
#define PVT3_Pin GPIO_PIN_7
|
||||
#define PVT3_GPIO_Port GPIOC
|
||||
#define PVT2_Pin GPIO_PIN_8
|
||||
#define PVT2_GPIO_Port GPIOC
|
||||
#define PVT1_Pin GPIO_PIN_9
|
||||
#define PVT1_GPIO_Port GPIOC
|
||||
|
||||
#define BOOT1_Pin GPIO_PIN_2
|
||||
#define BOOT1_GPIO_Port GPIOB
|
||||
|
||||
#define LED_0_OFF HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_0_ON HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_0_TGL HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin)
|
||||
|
||||
#define LED_1_OFF HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_1_ON HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_1_TGL HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
|
||||
|
||||
#define LED_2_ON HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_2_OFF HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_2_TGL HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin)
|
||||
|
||||
#define LED_3_ON HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_3_OFF HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_3_TGL HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin)
|
||||
|
||||
#define Pvt1_ON HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define Pvt1_OFF HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define Pvt1_TGL HAL_GPIO_TogglePin(PVT1_GPIO_Port, PVT1_Pin)
|
||||
|
||||
#define Pvt2_ON HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_SET) //set - ????????????? ???, reset - ??????? ???
|
||||
#define Pvt2_OFF HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_RESET) //????? ??????? ? main.h ??????? ?????? ?????????????
|
||||
#define Pvt2_TGL HAL_GPIO_TogglePin(PVT2_GPIO_Port, PVT2_Pin)
|
||||
|
||||
#define Pvt3_ON HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_SET)
|
||||
#define Pvt3_OFF HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_RESET)
|
||||
#define Pvt3_TGL HAL_GPIO_TogglePin(PVT3_GPIO_Port, PVT3_Pin)
|
||||
|
||||
#define Pvt4_ON HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_SET)
|
||||
#define Pvt4_OFF HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_RESET)
|
||||
#define Pvt4_TGL HAL_GPIO_TogglePin(PVT4_GPIO_Port, PVT4_Pin)
|
||||
|
||||
#define IN_01 HAL_GPIO_ReadPin(IN_01_GPIO_Port, IN_01_Pin) // ???????? ??1 (??????? ???????????? ???????????)
|
||||
#define IN_02 HAL_GPIO_ReadPin(IN_02_GPIO_Port, IN_02_Pin) // ???????? ??2 (??????? ???????????? ?????????)
|
||||
#define IN_03 HAL_GPIO_ReadPin(IN_03_GPIO_Port, IN_03_Pin) // ???????? ??3 (??????? ??. ??????, ???? ?????????, ????)
|
||||
#define IN_04 HAL_GPIO_ReadPin(IN_04_GPIO_Port, IN_04_Pin) // ???????? ??4 (??????? ???????? ???? ? ?????????? +)
|
||||
#define IN_05 HAL_GPIO_ReadPin(IN_05_GPIO_Port, IN_05_Pin) // ???????? ??5 (??????? ???????? ???? ? ?????????? –)
|
||||
#define IN_06 HAL_GPIO_ReadPin(IN_06_GPIO_Port, IN_06_Pin) // ???????? ??6 (??????? ?????????)
|
||||
#define IN_07 HAL_GPIO_ReadPin(IN_07_GPIO_Port, IN_07_Pin) // ???????? 3? ??????? 380 ?
|
||||
|
||||
#define IN_08 HAL_GPIO_ReadPin(IN_08_GPIO_Port, IN_08_Pin) // ????? ??????????
|
||||
#define IN_09 HAL_GPIO_ReadPin(IN_09_GPIO_Port, IN_09_Pin) // ?????? ??????????
|
||||
#define IN_10 HAL_GPIO_ReadPin(IN_10_GPIO_Port, IN_10_Pin) // ?????? ? ???? 24 ?
|
||||
|
||||
#define IN_11 HAL_GPIO_ReadPin(IN_11_GPIO_Port, IN_11_Pin) // ???????? ??????? ???
|
||||
#define IN_12 HAL_GPIO_ReadPin(IN_12_GPIO_Port, IN_12_Pin) // ??????
|
||||
#define IN_13 HAL_GPIO_ReadPin(IN_13_GPIO_Port, IN_13_Pin) // ??????
|
||||
#define IN_14 HAL_GPIO_ReadPin(IN_14_GPIO_Port, IN_14_Pin) // ???????? ??????? ???
|
||||
|
||||
#define J0 HAL_GPIO_ReadPin(J0_GPIO_Port, J0_Pin) //Read the specified input port pin
|
||||
#define J1 HAL_GPIO_ReadPin(J1_GPIO_Port, J1_Pin)
|
||||
#define J2 HAL_GPIO_ReadPin(J2_GPIO_Port, J2_Pin)
|
||||
#define J3 HAL_GPIO_ReadPin(J3_GPIO_Port, J3_Pin)
|
||||
|
||||
#define Jselect HAL_GPIO_ReadPin(Jselect_GPIO_Port, Jselect_Pin)
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
|
131
Core/Inc/main.h
131
Core/Inc/main.h
@ -7,13 +7,12 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
@ -32,7 +31,7 @@ extern "C" {
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
@ -42,18 +41,6 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t force_pause:1;
|
||||
uint32_t pause;
|
||||
|
||||
|
||||
|
||||
// uint8_t
|
||||
// uint16_t
|
||||
|
||||
}FLAG;
|
||||
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
@ -67,8 +54,6 @@ void Error_Handler(void);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
void Millisecond(void);
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
@ -78,10 +63,10 @@ void Millisecond(void);
|
||||
#define SELEKT_PCH_GPIO_Port GPIOC
|
||||
#define IN_05_Pin GPIO_PIN_15
|
||||
#define IN_05_GPIO_Port GPIOC
|
||||
//#define LED1_Pin GPIO_PIN_2
|
||||
//#define LED1_GPIO_Port GPIOC
|
||||
//#define LED2_Pin GPIO_PIN_3
|
||||
#define LED2_Pin GPIO_PIN_2
|
||||
#define LED2_GPIO_Port GPIOC
|
||||
#define LED3_Pin GPIO_PIN_3
|
||||
#define LED3_GPIO_Port GPIOC
|
||||
#define IN_04_Pin GPIO_PIN_0
|
||||
#define IN_04_GPIO_Port GPIOA
|
||||
#define IN_03_Pin GPIO_PIN_1
|
||||
@ -94,20 +79,20 @@ void Millisecond(void);
|
||||
#define IN_14_GPIO_Port GPIOA
|
||||
#define IN_13_Pin GPIO_PIN_5
|
||||
#define IN_13_GPIO_Port GPIOA
|
||||
//#define J0_Pin GPIO_PIN_7
|
||||
#define J0_Pin GPIO_PIN_6
|
||||
#define J0_GPIO_Port GPIOA
|
||||
//#define J1_Pin GPIO_PIN_4
|
||||
//#define J1_GPIO_Port GPIOC
|
||||
//#define J2_Pin GPIO_PIN_5
|
||||
#define J1_Pin GPIO_PIN_7
|
||||
#define J1_GPIO_Port GPIOA
|
||||
#define J2_Pin GPIO_PIN_4
|
||||
#define J2_GPIO_Port GPIOC
|
||||
//#define J3_Pin GPIO_PIN_0
|
||||
//#define J3_GPIO_Port GPIOB
|
||||
//#define IN_12_Pin GPIO_PIN_1
|
||||
#define J3_Pin GPIO_PIN_5
|
||||
#define J3_GPIO_Port GPIOC
|
||||
#define IN_12_Pin GPIO_PIN_0
|
||||
#define IN_12_GPIO_Port GPIOB
|
||||
#define IN_11_Pin GPIO_PIN_1
|
||||
#define IN_11_GPIO_Port GPIOB
|
||||
#define BOOT1_Pin GPIO_PIN_2
|
||||
#define BOOT1_GPIO_Port GPIOB
|
||||
//#define IN_11_Pin GPIO_PIN_10
|
||||
#define IN_11_GPIO_Port GPIOB
|
||||
#define IN_10_Pin GPIO_PIN_12
|
||||
#define IN_10_GPIO_Port GPIOB
|
||||
#define IN_09_Pin GPIO_PIN_13
|
||||
@ -116,6 +101,7 @@ void Millisecond(void);
|
||||
#define IN_08_GPIO_Port GPIOB
|
||||
#define IN_07_Pin GPIO_PIN_15
|
||||
#define IN_07_GPIO_Port GPIOB
|
||||
#define IN_07_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define PVT4_Pin GPIO_PIN_6
|
||||
#define PVT4_GPIO_Port GPIOC
|
||||
#define PVT3_Pin GPIO_PIN_7
|
||||
@ -124,9 +110,88 @@ void Millisecond(void);
|
||||
#define PVT2_GPIO_Port GPIOC
|
||||
#define PVT1_Pin GPIO_PIN_9
|
||||
#define PVT1_GPIO_Port GPIOC
|
||||
#define LED0_Pin GPIO_PIN_5
|
||||
#define LED0_GPIO_Port GPIOB
|
||||
#define LED1_Pin GPIO_PIN_6
|
||||
#define LED1_GPIO_Port GPIOB
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/////////// USER define /////////
|
||||
#define Jselect HAL_GPIO_ReadPin(Jselect_GPIO_Port, Jselect_Pin)
|
||||
#define Jselect_Pin GPIO_PIN_14
|
||||
#define Jselect_GPIO_Port GPIOC
|
||||
|
||||
#define LED_0_OFF HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_0_ON HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_0_TGL HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin)
|
||||
|
||||
#define LED_1_OFF HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_1_ON HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_1_TGL HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
|
||||
|
||||
#define LED_2_ON HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_2_OFF HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_2_TGL HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin)
|
||||
|
||||
#define LED_3_ON HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define LED_3_OFF HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define LED_3_TGL HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin)
|
||||
|
||||
#define Pvt1_ON HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||||
#define Pvt1_OFF HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||||
#define Pvt1_TGL HAL_GPIO_TogglePin(PVT1_GPIO_Port, PVT1_Pin)
|
||||
|
||||
#define Pvt2_ON HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_SET) //set - ????????????? ???, reset - ??????? ???
|
||||
#define Pvt2_OFF HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_RESET) //????? ??????? ? main.h ??????? ?????? ?????????????
|
||||
#define Pvt2_TGL HAL_GPIO_TogglePin(PVT2_GPIO_Port, PVT2_Pin)
|
||||
|
||||
#define Pvt3_ON HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_SET)
|
||||
#define Pvt3_OFF HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_RESET)
|
||||
#define Pvt3_TGL HAL_GPIO_TogglePin(PVT3_GPIO_Port, PVT3_Pin)
|
||||
|
||||
#define Pvt4_ON HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_SET)
|
||||
#define Pvt4_OFF HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_RESET)
|
||||
#define Pvt4_TGL HAL_GPIO_TogglePin(PVT4_GPIO_Port, PVT4_Pin)
|
||||
|
||||
#define IN_01 HAL_GPIO_ReadPin(IN_01_GPIO_Port, IN_01_Pin) // ???????? ??1 (??????? ???????????? ???????????)
|
||||
#define IN_02 HAL_GPIO_ReadPin(IN_02_GPIO_Port, IN_02_Pin) // ???????? ??2 (??????? ???????????? ?????????)
|
||||
#define IN_03 HAL_GPIO_ReadPin(IN_03_GPIO_Port, IN_03_Pin) // ???????? ??3 (??????? ??. ??????, ???? ?????????, ????)
|
||||
#define IN_04 HAL_GPIO_ReadPin(IN_04_GPIO_Port, IN_04_Pin) // ???????? ??4 (??????? ???????? ???? ? ?????????? +)
|
||||
#define IN_05 HAL_GPIO_ReadPin(IN_05_GPIO_Port, IN_05_Pin) // ???????? ??5 (??????? ???????? ???? ? ?????????? –)
|
||||
#define IN_06 HAL_GPIO_ReadPin(IN_06_GPIO_Port, IN_06_Pin) // ???????? ??6 (??????? ?????????)
|
||||
#define IN_07 HAL_GPIO_ReadPin(IN_07_GPIO_Port, IN_07_Pin) // ???????? 3? ??????? 380 ?
|
||||
|
||||
#define IN_08 HAL_GPIO_ReadPin(IN_08_GPIO_Port, IN_08_Pin) // ????? ??????????
|
||||
#define IN_09 HAL_GPIO_ReadPin(IN_09_GPIO_Port, IN_09_Pin) // ?????? ??????????
|
||||
#define IN_10 HAL_GPIO_ReadPin(IN_10_GPIO_Port, IN_10_Pin) // ?????? ? ???? 24 ?
|
||||
|
||||
#define IN_11 HAL_GPIO_ReadPin(IN_11_GPIO_Port, IN_11_Pin) // ???????? ??????? ???
|
||||
#define IN_12 HAL_GPIO_ReadPin(IN_12_GPIO_Port, IN_12_Pin) // ??????
|
||||
#define IN_13 HAL_GPIO_ReadPin(IN_13_GPIO_Port, IN_13_Pin) // ??????
|
||||
#define IN_14 HAL_GPIO_ReadPin(IN_14_GPIO_Port, IN_14_Pin) // ???????? ??????? ???
|
||||
|
||||
#define J0 HAL_GPIO_ReadPin(J0_GPIO_Port, J0_Pin) //Read the specified input port pin
|
||||
#define J1 HAL_GPIO_ReadPin(J1_GPIO_Port, J1_Pin)
|
||||
#define J2 HAL_GPIO_ReadPin(J2_GPIO_Port, J2_Pin)
|
||||
#define J3 HAL_GPIO_ReadPin(J3_GPIO_Port, J3_Pin)
|
||||
|
||||
|
||||
/////////////////////////////////
|
||||
|
||||
|
||||
int Isit(int num, int i, int z);
|
||||
|
||||
|
||||
typedef struct // ñòðóêòóðà ôëàãîâ
|
||||
{
|
||||
uint8_t force_pause:1;
|
||||
uint32_t pause;
|
||||
|
||||
// uint8_t
|
||||
// uint16_t
|
||||
|
||||
}FLAG;
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -65,7 +65,7 @@
|
||||
/*#define HAL_SPI_MODULE_ENABLED */
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
/*#define HAL_UART_MODULE_ENABLED */
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
|
@ -1,391 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f1xx_hal_conf.h
|
||||
* @brief HAL configuration file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F1xx_HAL_CONF_H
|
||||
#define __STM32F1xx_HAL_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* ########################## Module Selection ############################## */
|
||||
/**
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
*/
|
||||
|
||||
#define HAL_MODULE_ENABLED
|
||||
/*#define HAL_ADC_MODULE_ENABLED */
|
||||
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||
#define HAL_CAN_MODULE_ENABLED
|
||||
/*#define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
/*#define HAL_CEC_MODULE_ENABLED */
|
||||
/*#define HAL_CORTEX_MODULE_ENABLED */
|
||||
/*#define HAL_CRC_MODULE_ENABLED */
|
||||
/*#define HAL_DAC_MODULE_ENABLED */
|
||||
/*#define HAL_DMA_MODULE_ENABLED */
|
||||
/*#define HAL_ETH_MODULE_ENABLED */
|
||||
/*#define HAL_FLASH_MODULE_ENABLED */
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
/*#define HAL_I2C_MODULE_ENABLED */
|
||||
/*#define HAL_I2S_MODULE_ENABLED */
|
||||
/*#define HAL_IRDA_MODULE_ENABLED */
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
/*#define HAL_NOR_MODULE_ENABLED */
|
||||
/*#define HAL_NAND_MODULE_ENABLED */
|
||||
/*#define HAL_PCCARD_MODULE_ENABLED */
|
||||
/*#define HAL_PCD_MODULE_ENABLED */
|
||||
/*#define HAL_HCD_MODULE_ENABLED */
|
||||
/*#define HAL_PWR_MODULE_ENABLED */
|
||||
/*#define HAL_RCC_MODULE_ENABLED */
|
||||
/*#define HAL_RTC_MODULE_ENABLED */
|
||||
/*#define HAL_SD_MODULE_ENABLED */
|
||||
/*#define HAL_MMC_MODULE_ENABLED */
|
||||
/*#define HAL_SDRAM_MODULE_ENABLED */
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
/*#define HAL_SPI_MODULE_ENABLED */
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
/*#define HAL_UART_MODULE_ENABLED */
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#define HAL_CORTEX_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_FLASH_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_PWR_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
|
||||
/* ########################## Oscillator Values adaptation ####################*/
|
||||
/**
|
||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||
#endif /* HSE_VALUE */
|
||||
|
||||
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
|
||||
#endif /* HSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief Internal High Speed oscillator (HSI) value.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSI_VALUE)
|
||||
#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/
|
||||
#endif /* HSI_VALUE */
|
||||
|
||||
/**
|
||||
* @brief Internal Low Speed oscillator (LSI) value.
|
||||
*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */
|
||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||
The real value may vary depending on the variations
|
||||
in voltage and temperature. */
|
||||
|
||||
/**
|
||||
* @brief External Low Speed oscillator (LSE) value.
|
||||
* This value is used by the UART, RTC HAL module to compute the system frequency
|
||||
*/
|
||||
#if !defined (LSE_VALUE)
|
||||
#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
|
||||
#endif /* LSE_VALUE */
|
||||
|
||||
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||
#endif /* LSE_STARTUP_TIMEOUT */
|
||||
|
||||
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||
|
||||
/* ########################### System Configuration ######################### */
|
||||
/**
|
||||
* @brief This is the HAL system configuration section
|
||||
*/
|
||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||
#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority (lowest by default) */
|
||||
#define USE_RTOS 0U
|
||||
#define PREFETCH_ENABLE 1U
|
||||
|
||||
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
|
||||
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
|
||||
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
|
||||
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
|
||||
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
|
||||
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
|
||||
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
|
||||
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
|
||||
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
|
||||
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
|
||||
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
|
||||
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
|
||||
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
|
||||
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
|
||||
#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
|
||||
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
|
||||
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
|
||||
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
|
||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||
|
||||
/* ########################## Assert Selection ############################## */
|
||||
/**
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* HAL drivers code
|
||||
*/
|
||||
/* #define USE_FULL_ASSERT 1U */
|
||||
|
||||
/* ################## Ethernet peripheral configuration ##################### */
|
||||
|
||||
/* Section 1 : Ethernet peripheral configuration */
|
||||
|
||||
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
|
||||
#define MAC_ADDR0 2U
|
||||
#define MAC_ADDR1 0U
|
||||
#define MAC_ADDR2 0U
|
||||
#define MAC_ADDR3 0U
|
||||
#define MAC_ADDR4 0U
|
||||
#define MAC_ADDR5 0U
|
||||
|
||||
/* Definition of the Ethernet driver buffers size and count */
|
||||
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
||||
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
||||
#define ETH_RXBUFNB 8U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||
|
||||
/* Section 2: PHY configuration section */
|
||||
|
||||
/* DP83848_PHY_ADDRESS Address*/
|
||||
#define DP83848_PHY_ADDRESS 0x01U
|
||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||
#define PHY_RESET_DELAY 0x000000FFU
|
||||
/* PHY Configuration delay */
|
||||
#define PHY_CONFIG_DELAY 0x00000FFFU
|
||||
|
||||
#define PHY_READ_TO 0x0000FFFFU
|
||||
#define PHY_WRITE_TO 0x0000FFFFU
|
||||
|
||||
/* Section 3: Common PHY Registers */
|
||||
|
||||
#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
|
||||
#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
|
||||
|
||||
#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
|
||||
#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
|
||||
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
|
||||
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
|
||||
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
|
||||
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
|
||||
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
|
||||
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
|
||||
#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
|
||||
#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
|
||||
|
||||
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
|
||||
#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
|
||||
#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
|
||||
|
||||
/* Section 4: Extended PHY Registers */
|
||||
#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
|
||||
|
||||
#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
|
||||
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
|
||||
|
||||
/* ################## SPI peripheral configuration ########################## */
|
||||
|
||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||
* Activated: CRC code is present inside driver
|
||||
* Deactivated: CRC code cleaned from driver
|
||||
*/
|
||||
|
||||
#define USE_SPI_CRC 0U
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Include module's header file
|
||||
*/
|
||||
|
||||
#ifdef HAL_RCC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_rcc.h"
|
||||
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_gpio.h"
|
||||
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_dma.h"
|
||||
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_eth.h"
|
||||
#endif /* HAL_ETH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_can.h"
|
||||
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#include "Legacy/stm32f1xx_hal_can_legacy.h"
|
||||
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CEC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_cec.h"
|
||||
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_cortex.h"
|
||||
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ADC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_adc.h"
|
||||
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_crc.h"
|
||||
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DAC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_dac.h"
|
||||
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_flash.h"
|
||||
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_i2c.h"
|
||||
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2S_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_i2s.h"
|
||||
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_iwdg.h"
|
||||
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_pwr.h"
|
||||
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RTC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_rtc.h"
|
||||
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCCARD_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_pccard.h"
|
||||
#endif /* HAL_PCCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SD_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_sd.h"
|
||||
#endif /* HAL_SD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_spi.h"
|
||||
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_tim.h"
|
||||
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_uart.h"
|
||||
#endif /* HAL_UART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_USART_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_usart.h"
|
||||
#endif /* HAL_USART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_wwdg.h"
|
||||
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32f1xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0U)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F1xx_HAL_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -6,15 +6,14 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
@ -59,7 +58,9 @@ void SysTick_Handler(void);
|
||||
void USB_HP_CAN1_TX_IRQHandler(void);
|
||||
void USB_LP_CAN1_RX0_IRQHandler(void);
|
||||
void TIM4_IRQHandler(void);
|
||||
void EXTI15_10_IRQHandler(void);
|
||||
void TIM8_UP_IRQHandler(void);
|
||||
void UART4_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
@ -32,12 +32,15 @@ extern "C" {
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern TIM_HandleTypeDef htim2;
|
||||
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_TIM2_Init(void);
|
||||
void MX_TIM4_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
52
Core/Inc/usart.h
Normal file
52
Core/Inc/usart.h
Normal file
@ -0,0 +1,52 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usart.h
|
||||
* @brief This file contains all the function prototypes for
|
||||
* the usart.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __USART_H__
|
||||
#define __USART_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern UART_HandleTypeDef huart4;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_UART4_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __USART_H__ */
|
||||
|
106
Core/Src/can.c
106
Core/Src/can.c
@ -21,10 +21,9 @@
|
||||
#include "can.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
#include "gpio.h"
|
||||
#include "message.h"
|
||||
|
||||
#include "gpio.h"
|
||||
#include "boot_jump.h"
|
||||
void CAN_filterConfig(void);
|
||||
|
||||
CAN_TxHeaderTypeDef TxHeader;
|
||||
@ -44,7 +43,6 @@ uint32_t TX_box_ID = 0;
|
||||
uint32_t RX_box_ID = 0;
|
||||
uint32_t BC_box_ID = 0;
|
||||
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
CAN_HandleTypeDef hcan;
|
||||
@ -61,7 +59,7 @@ void MX_CAN_Init(void)
|
||||
|
||||
/* USER CODE END CAN_Init 1 */
|
||||
hcan.Instance = CAN1;
|
||||
hcan.Init.Prescaler = 10;
|
||||
hcan.Init.Prescaler = 16;
|
||||
hcan.Init.Mode = CAN_MODE_NORMAL;
|
||||
hcan.Init.SyncJumpWidth = CAN_SJW_1TQ;
|
||||
hcan.Init.TimeSeg1 = CAN_BS1_13TQ;
|
||||
@ -80,13 +78,6 @@ void MX_CAN_Init(void)
|
||||
|
||||
CAN_filterConfig();
|
||||
|
||||
msgHeaderSend.StdId = 0x200;
|
||||
msgHeaderSend.ExtId = TX_box_ID;
|
||||
msgHeaderSend.DLC = 8;
|
||||
msgHeaderSend.TransmitGlobalTime = DISABLE;
|
||||
msgHeaderSend.RTR = CAN_RTR_DATA;
|
||||
msgHeaderSend.IDE = CAN_ID_EXT;
|
||||
|
||||
// CAN start
|
||||
if (HAL_CAN_Start(&hcan) != HAL_OK)
|
||||
{
|
||||
@ -99,10 +90,6 @@ void MX_CAN_Init(void)
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* USER CODE END CAN_Init 2 */
|
||||
|
||||
}
|
||||
@ -172,17 +159,8 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* canHandle)
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
void Setup_CAN_addr(uint8_t mode)
|
||||
{
|
||||
BC_box_ID = 0x9F<<20;
|
||||
RX_box_ID = (0x80+mode)<<20;
|
||||
TX_box_ID = RX_box_ID | (1L<<28);
|
||||
}
|
||||
|
||||
void CAN_filterConfig(void)
|
||||
{
|
||||
|
||||
sFilterConfig.FilterBank = 0;
|
||||
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
|
||||
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
|
||||
@ -199,12 +177,6 @@ void CAN_filterConfig(void)
|
||||
Error_Handler();
|
||||
} }
|
||||
|
||||
void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
// HAL_GPIO_TogglePin(LED_2_GPIO_Port, LED_2_Pin);
|
||||
}
|
||||
|
||||
|
||||
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan_i)
|
||||
{
|
||||
CAN_RxHeaderTypeDef msgHeader;
|
||||
@ -219,6 +191,15 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan_i)
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if(msgData[0] == CMD_GOTOBOOT)
|
||||
{
|
||||
JumpToBootloader();
|
||||
}
|
||||
else if(msgData[0] == CMD_RESET)
|
||||
{
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
if((msgHeader.ExtId & 0xFF00000) != RX_box_ID)
|
||||
if((msgHeader.ExtId & 0xFF00000) != BC_box_ID) return;
|
||||
|
||||
@ -238,14 +219,18 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan_i)
|
||||
LED_1_TGL;
|
||||
}
|
||||
|
||||
|
||||
int CAN_send(uint16_t data[], int Addr, int Qua)
|
||||
{
|
||||
int wait = 1000;
|
||||
uint16_t wait = 1000;
|
||||
static uint8_t att=0;
|
||||
uint8_t i;
|
||||
|
||||
while(wait-- && (HAL_CAN_GetTxMailboxesFreeLevel(&hcan) == 0));
|
||||
|
||||
if (HAL_CAN_GetTxMailboxesFreeLevel(&hcan) != 0)
|
||||
{
|
||||
msgHeaderSend.IDE = CAN_ID_EXT;
|
||||
msgHeaderSend.ExtId = TX_box_ID | (Addr & 0xFFFF);
|
||||
msgHeaderSend.DLC = Qua*2;
|
||||
|
||||
@ -260,14 +245,65 @@ int CAN_send(uint16_t data[], int Addr, int Qua)
|
||||
|
||||
HAL_CAN_AddTxMessage(&hcan, &msgHeaderSend, msgDataSend, &mailBoxNum);
|
||||
|
||||
LED_0_TGL;
|
||||
att=0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_CAN_Stop(&hcan);
|
||||
HAL_CAN_Start(&hcan);
|
||||
if(att>=3)
|
||||
{
|
||||
MX_CAN_Init();
|
||||
|
||||
LED_0_OFF;
|
||||
LED_1_OFF;
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
LED_1_TGL; HAL_Delay(30);
|
||||
LED_1_TGL; HAL_Delay(30);
|
||||
LED_0_TGL; HAL_Delay(30);
|
||||
LED_0_TGL; HAL_Delay(30);
|
||||
} }
|
||||
else
|
||||
{
|
||||
att++;
|
||||
|
||||
HAL_CAN_Stop(&hcan);
|
||||
HAL_CAN_Start(&hcan);
|
||||
|
||||
LED_0_OFF;
|
||||
LED_1_OFF;
|
||||
for(i=0;i<10;i++)
|
||||
{
|
||||
LED_0_TGL;
|
||||
LED_1_TGL; HAL_Delay(30);
|
||||
} }
|
||||
|
||||
return 0;
|
||||
} }
|
||||
|
||||
void Setup_CAN_addr(uint8_t mode)
|
||||
{
|
||||
BC_box_ID = 0x9F<<20;
|
||||
RX_box_ID = (0x80+mode)<<20;
|
||||
TX_box_ID = RX_box_ID | (1L<<28);
|
||||
}
|
||||
// Успешная отправка - моргание диодом
|
||||
void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
LED_0_TGL;
|
||||
}
|
||||
void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
LED_0_TGL;
|
||||
}
|
||||
void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
LED_0_TGL;
|
||||
}
|
||||
// Ошибки: выключение диода
|
||||
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
LED_0_OFF;
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "gpio.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
#include "tim.h"
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@ -42,31 +42,27 @@ void MX_GPIO_Init(void)
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, LED1_Pin|LED2_Pin|PVT4_Pin|PVT3_Pin
|
||||
HAL_GPIO_WritePin(GPIOC, LED2_Pin|LED3_Pin|PVT4_Pin|PVT3_Pin
|
||||
|PVT2_Pin|PVT1_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : PCPin PCPin PCPin PC0
|
||||
PC1 PCPin PCPin */
|
||||
GPIO_InitStruct.Pin = IN_06_Pin|SELEKT_PCH_Pin|IN_05_Pin|GPIO_PIN_0
|
||||
|GPIO_PIN_1|J1_Pin|J2_Pin;
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, LED0_Pin|LED1_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pins : PCPin PCPin PCPin PCPin
|
||||
PCPin */
|
||||
GPIO_InitStruct.Pin = IN_06_Pin|SELEKT_PCH_Pin|IN_05_Pin|J2_Pin
|
||||
|J3_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PD0 PD1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PCPin PCPin PCPin PCPin
|
||||
PCPin PCPin */
|
||||
GPIO_InitStruct.Pin = LED1_Pin|LED2_Pin|PVT4_Pin|PVT3_Pin
|
||||
GPIO_InitStruct.Pin = LED2_Pin|LED3_Pin|PVT4_Pin|PVT3_Pin
|
||||
|PVT2_Pin|PVT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
@ -74,34 +70,82 @@ void MX_GPIO_Init(void)
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PAPin PAPin PAPin PAPin
|
||||
PAPin PAPin PA6 PAPin */
|
||||
PAPin PAPin PAPin PAPin */
|
||||
GPIO_InitStruct.Pin = IN_04_Pin|IN_03_Pin|IN_02_Pin|IN_01_Pin
|
||||
|IN_14_Pin|IN_13_Pin|GPIO_PIN_6|J0_Pin;
|
||||
|IN_14_Pin|IN_13_Pin|J0_Pin|J1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin PBPin
|
||||
PB11 PBPin PBPin PBPin
|
||||
PBPin */
|
||||
GPIO_InitStruct.Pin = J3_Pin|IN_12_Pin|BOOT1_Pin|IN_11_Pin
|
||||
|GPIO_PIN_11|IN_10_Pin|IN_09_Pin|IN_08_Pin
|
||||
|IN_07_Pin;
|
||||
PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = IN_12_Pin|IN_11_Pin|BOOT1_Pin|IN_10_Pin
|
||||
|IN_09_Pin|IN_08_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = IN_07_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(IN_07_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PA8 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_8;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure peripheral I/O remapping */
|
||||
__HAL_AFIO_REMAP_PD01_ENABLE();
|
||||
/*Configure GPIO pins : PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = LED0_Pin|LED1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
#define MEASURE_PIN IN_07_Pin
|
||||
#define MEASURE_PORT IN_07_GPIO_Port
|
||||
volatile uint32_t last_tick = 0;
|
||||
volatile uint32_t high_time = 0;
|
||||
volatile uint32_t period_time = 0;
|
||||
volatile uint8_t first_edge = 1;
|
||||
|
||||
float duty_cycle = 0.0f;
|
||||
float frequency = 0.0f;
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||
{
|
||||
if (GPIO_Pin != MEASURE_PIN) return;
|
||||
|
||||
static uint16_t last_tick = 0;
|
||||
static uint16_t low_time = 0;
|
||||
static uint16_t high_time = 0;
|
||||
|
||||
uint16_t now = (uint16_t)__HAL_TIM_GET_COUNTER(&htim2);
|
||||
uint16_t delta = (now >= last_tick) ? (now - last_tick) : (uint16_t)(0x10000 + now - last_tick);
|
||||
last_tick = now;
|
||||
|
||||
if (HAL_GPIO_ReadPin(MEASURE_PORT, MEASURE_PIN) == GPIO_PIN_SET) {
|
||||
// RISING → закончился LOW
|
||||
low_time = delta;
|
||||
} else {
|
||||
// FALLING → закончился HIGH
|
||||
high_time = delta;
|
||||
uint32_t period = (uint32_t)high_time + (uint32_t)low_time;
|
||||
if (period > 0) {
|
||||
frequency = 1e6f / period; // Гц
|
||||
duty_cycle = (high_time * 100.0f) / period; // %
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
#include "main.h"
|
||||
#include "gpio.h"
|
||||
#include "lampa.h"
|
||||
#include "struc.h"
|
||||
@ -9,6 +9,8 @@ void ReadEnteres(void)
|
||||
{
|
||||
WORDE input, alarm, error;
|
||||
|
||||
input.all=0;
|
||||
|
||||
input.bit.bit0 = !IN_06; // Контроль ИП1 (питание управляющего контроллера)
|
||||
input.bit.bit1 = !IN_05; // Контроль ИП2 (питание периферийных устройств)
|
||||
input.bit.bit2 = !IN_04; // Контроль ИП3 (питание эл. замков, ламп освещения, УКСИ)
|
||||
@ -19,12 +21,12 @@ void ReadEnteres(void)
|
||||
input.bit.bit6 = !IN_07; // Контроль 3х фазного 380 В
|
||||
input.bit.bit7 = !IN_08; // Заряд накопителя
|
||||
input.bit.bit8 = !IN_09; // Разряд накопителя
|
||||
input.bit.bit9 = IN_10; // Авария в сети 24 В
|
||||
input.bit.bit9 = IN_10; // Авария в сети 24 В, единственный нормально замкнутый сигнал
|
||||
|
||||
input.bit.bitD = (Squazh_U[3] > Squazh_L[3]);
|
||||
input.bit.bitC = (Squazh_U[2] > Squazh_L[2]);
|
||||
input.bit.bitB = (Squazh_U[1] > Squazh_L[1]);
|
||||
input.bit.bitA = (Squazh_U[0] > Squazh_L[0]);
|
||||
input.bit.bitA = (Squazh_U[0] > Squazh_L[0]); // Контроль питания ЛСУ
|
||||
input.bit.bitB = (Squazh_U[1] > Squazh_L[1]); // Контроль питания СВО
|
||||
input.bit.bitC = (Squazh_U[2] > Squazh_L[2]); // резерв
|
||||
input.bit.bitD = (Squazh_U[3] > Squazh_L[3]); // Контроль питания СКК
|
||||
/*
|
||||
input.bit.bitA = !IN_11; // Контроль питания ЛСУ
|
||||
input.bit.bitB = !IN_12; // Контроль питания СВО
|
||||
@ -33,14 +35,16 @@ void ReadEnteres(void)
|
||||
*/
|
||||
Inputs.all = input.all;
|
||||
|
||||
// Обычно неисправность это отсутствие сигнала, который есть в маске неисправностей
|
||||
alarm.all = ~Inputs.all & Alarm_mask.all;
|
||||
alarm.bit.bit7 = 0; // Заряд накопителя
|
||||
alarm.bit.bit8 = Inputs.bit.bit8; // Разряд накопителя
|
||||
alarm.bit.bit9 = Inputs.bit.bit9; // Авария в сети 24 В
|
||||
alarm.bit.bit7 = 0; // Заряд накопителя никогда не неисправность
|
||||
alarm.bit.bit8 = Inputs.bit.bit8; // Разряд накопителя всегда неисправность
|
||||
alarm.bit.bit9 = Inputs.bit.bit9; // Авария в сети 24 В всегда неисправность
|
||||
Alarms = alarm;
|
||||
|
||||
// Обычно авария это отсутствие сигнала, который есть в маске аварий
|
||||
error.all = ~Inputs.all & Error_mask.all;
|
||||
error.bit.bit9 = Inputs.bit.bit9; // Авария в сети 24 В
|
||||
error.bit.bit9 = Inputs.bit.bit9; // Авария в сети 24 В всегда авария
|
||||
Errors = error;
|
||||
}
|
||||
|
||||
|
672
Core/Src/main.c
672
Core/Src/main.c
@ -6,13 +6,12 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
@ -22,24 +21,25 @@
|
||||
#include "can.h"
|
||||
#include "iwdg.h"
|
||||
#include "tim.h"
|
||||
#include "usart.h"
|
||||
#include "gpio.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "package.h"
|
||||
#include "message.h"
|
||||
#include "lampa.h"
|
||||
|
||||
#include "boot_jump.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
FLAG flag;
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
@ -51,9 +51,16 @@ FLAG flag;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
FLAG flag;
|
||||
|
||||
|
||||
static long Falling_asleep;
|
||||
uint8_t CanGO=0, timGo=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -65,24 +72,6 @@ void SystemClock_Config(void);
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
int Isit(int num, int i, int z)
|
||||
{
|
||||
int res, pls;
|
||||
|
||||
if((num<0)||(num>=0x80)) return 0;
|
||||
res = Maska[i][num/0x10];
|
||||
res &= (1<<(num&0x0F));
|
||||
|
||||
if(z)
|
||||
{
|
||||
pls = (espero[num]>CanRestart[i]/2);
|
||||
pls = pls || county[num];
|
||||
res = res && pls;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
@ -93,12 +82,11 @@ int main(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
static int i,j,n,z,mask,qua;
|
||||
static int i,j,n,z,mask,qua;
|
||||
static int cancount[2]={1,2},cancell[2]={0,0},candid[2]={0,0};
|
||||
static unsigned int masca[8];
|
||||
static uint16_t precom=0;
|
||||
|
||||
App_Init();
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
@ -107,24 +95,25 @@ int main(void)
|
||||
HAL_Init();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
MX_IWDG_Init();
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
MX_IWDG_Init();
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM4_Init();
|
||||
MX_IWDG_Init();
|
||||
MX_UART4_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
LED_0_ON;
|
||||
HAL_TIM_Base_Start(&htim2);
|
||||
LED_0_ON;
|
||||
LED_1_OFF;
|
||||
LED_2_ON;
|
||||
LED_3_OFF;
|
||||
@ -134,10 +123,11 @@ int main(void)
|
||||
LED_0_TGL;
|
||||
LED_1_TGL;
|
||||
LED_2_TGL;
|
||||
LED_3_TGL; HAL_Delay(50);
|
||||
LED_3_TGL;
|
||||
HAL_Delay(50);
|
||||
}
|
||||
|
||||
Mode = ReadJumpers()+1;
|
||||
Mode = ReadJumpers()+1;
|
||||
Setup_CAN_addr(Mode-1);
|
||||
Load_params();
|
||||
LastMode = Mode;
|
||||
@ -155,271 +145,232 @@ int main(void)
|
||||
|
||||
timGo=1;
|
||||
|
||||
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
if (flag.force_pause)
|
||||
{
|
||||
__disable_irq();
|
||||
for(int i=0;i<flag.pause;i++);
|
||||
__enable_irq();
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
//=== БЛОК ПРИНУДИТЕЛЬНОЙ ПАУЗЫ ===//
|
||||
if (flag.force_pause)
|
||||
{
|
||||
__disable_irq(); // Отключаем все прерывания
|
||||
for(int i = 0; i < flag.pause; i++); // Пустой цикл для задержки
|
||||
__enable_irq(); // Включаем прерывания обратно
|
||||
}
|
||||
|
||||
if( CanGO)
|
||||
{ CanGO=0;
|
||||
//=== ОБРАБОТКА CAN-ШИНЫ ===//
|
||||
if (CanGO) // Флаг разрешения работы с CAN-шиной
|
||||
{
|
||||
CanGO = 0; // Сбрасываем флаг
|
||||
|
||||
for(i=0;i<0x80;i++)
|
||||
if(espero[i]<30000) espero[i]++;
|
||||
// Увеличиваем счетчики ожидания для всех элементов (ограничение 30000)
|
||||
for(i = 0; i < 0x80; i++)
|
||||
if(espero[i] < 30000)
|
||||
espero[i]++;
|
||||
|
||||
for(i=0;i<2;i++)
|
||||
if(cancount[i]) cancount[i]--;
|
||||
else cancell[i] = 0;
|
||||
}
|
||||
// Уменьшаем счетчики задержки для двух CAN-каналов
|
||||
for(i = 0; i < 2; i++)
|
||||
if(cancount[i])
|
||||
cancount[i]--;
|
||||
else
|
||||
cancell[i] = 0; // Сброс позиции, если счетчик обнулился
|
||||
}
|
||||
|
||||
for(i=0;i<2;i++)
|
||||
if( Cancount[i])
|
||||
if(!cancount[i])
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
if( cancell[i]>= 0x80)
|
||||
{ cancell[i]=0;
|
||||
//=== ОБРАБОТКА КАНАЛОВ CAN ===//
|
||||
for(i = 0; i < 2; i++) // Для каждого из двух CAN-каналов
|
||||
{
|
||||
if (Cancount[i] && !cancount[i]) // Если есть задержка и счетчик обнулился
|
||||
{
|
||||
// Поиск следующего элемента для обработки
|
||||
while(1)
|
||||
{
|
||||
if (cancell[i] >= 0x80) // Если достигли конца диапазона
|
||||
{
|
||||
cancell[i] = 0; // Сброс позиции
|
||||
|
||||
if( candid[i])
|
||||
{ candid[i]=0;
|
||||
CanCycle[i]++;
|
||||
cancount[i] = CanWait[i];
|
||||
goto Next;
|
||||
} }
|
||||
if (candid[i]) // Если есть кандидат для обработки
|
||||
{
|
||||
candid[i] = 0; // Сброс флага кандидата
|
||||
CanCycle[i]++; // Увеличиваем счетчик циклов
|
||||
cancount[i] = CanWait[i]; // Устанавливаем задержку
|
||||
goto Next; // Переход к следующей итерации
|
||||
}
|
||||
}
|
||||
|
||||
mask = Maska[i][cancell[i]/0x10] >> (cancell[i]&0x0F);
|
||||
if(!mask) cancell[i] = (cancell[i] + 0x10) & 0xFFF0 ;
|
||||
else
|
||||
{
|
||||
while(!(mask & 1))
|
||||
{
|
||||
cancell[i]++; mask >>= 1;
|
||||
}
|
||||
break;
|
||||
} }
|
||||
// Проверка маски для определения активных элементов
|
||||
mask = Maska[i][cancell[i] / 0x10] >> (cancell[i] & 0x0F);
|
||||
if (!mask) // Если маска пустая
|
||||
cancell[i] = (cancell[i] + 0x10) & 0xFFF0; // Переход к следующей группе
|
||||
else
|
||||
{
|
||||
// Поиск первого установленного бита в маске
|
||||
while (!(mask & 1))
|
||||
{
|
||||
cancell[i]++;
|
||||
mask >>= 1;
|
||||
}
|
||||
break; // Найден активный элемент
|
||||
}
|
||||
}
|
||||
|
||||
z=1;
|
||||
if(espero[cancell[i]]>CanRestart[i])
|
||||
{
|
||||
county[cancell[i]]=1;
|
||||
z=0;
|
||||
}
|
||||
z = 1; // Флаг нормального состояния
|
||||
// Проверка превышения времени ожидания
|
||||
if (espero[cancell[i]] > CanRestart[i])
|
||||
{
|
||||
county[cancell[i]] = 1; // Установка флага необходимости отправки
|
||||
z = 0; // Флаг аварийного состояния
|
||||
}
|
||||
|
||||
if(modbus[cancell[i]] != archiv[cancell[i]])
|
||||
{
|
||||
if(cancell[i]==keys)
|
||||
for(j=0;j<CanRptLen;j++)
|
||||
county[cancell[i]+j] = CanRptVez;
|
||||
else
|
||||
county[cancell[i]] = 1;
|
||||
}
|
||||
// Проверка изменения данных для отправки
|
||||
if (modbus[cancell[i]] != archiv[cancell[i]])
|
||||
{
|
||||
if (cancell[i] == keys) // Если это ключевой элемент
|
||||
{
|
||||
// Установка флагов для группы элементов
|
||||
for(j = 0; j < CanRptLen; j++)
|
||||
county[cancell[i] + j] = CanRptVez;
|
||||
}
|
||||
else
|
||||
{
|
||||
county[cancell[i]] = 1; // Установка флага для одиночного элемента
|
||||
}
|
||||
}
|
||||
|
||||
if (county[cancell[i]])
|
||||
{
|
||||
for(j= 3; j>0 && !Isit(cancell[i]+j,i,z); j--);
|
||||
for(n=j-3; n<0 && !Isit(cancell[i]+n,i,1); n++);
|
||||
// Обработка элементов, требующих отправки
|
||||
if (county[cancell[i]])
|
||||
{
|
||||
// Поиск границ группы измененных элементов
|
||||
for(j = 3; j > 0 && !Isit(cancell[i] + j, i, z); j--);
|
||||
for(n = j - 3; n < 0 && !Isit(cancell[i] + n, i, 1); n++);
|
||||
|
||||
qua = 1 + j - n;
|
||||
cancell[i]+= n;
|
||||
qua = 1 + j - n; // Расчет количества элементов в группе
|
||||
cancell[i] += n; // Корректировка позиции
|
||||
|
||||
for(j=0;j<qua;j++)
|
||||
{
|
||||
n=cancell[i]+j;
|
||||
archiv[n]= modbus[n];
|
||||
espero[n]= 0;
|
||||
// Обработка каждого элемента в группе
|
||||
for(j = 0; j < qua; j++)
|
||||
{
|
||||
n = cancell[i] + j;
|
||||
archiv[n] = modbus[n]; // Сохранение текущего значения
|
||||
espero[n] = 0; // Сброс счетчика ожидания
|
||||
|
||||
if( county[n])
|
||||
{ county[n]--;
|
||||
if(!county[n] && n != cancyclo+i) candid[i]=1;
|
||||
}
|
||||
if(!county[n]) masca[n/0x10] |= (1<<(n&0x0F));
|
||||
}
|
||||
if (county[n]) // Если элемент требует обработки
|
||||
{
|
||||
county[n]--; // Уменьшение счетчика
|
||||
// Если счетчик обнулился и это не циклический элемент
|
||||
if (!county[n] && n != cancyclo + i)
|
||||
candid[i] = 1; // Установка флага кандидата
|
||||
}
|
||||
// Обновление маски активных элементов
|
||||
if (!county[n])
|
||||
masca[n / 0x10] |= (1 << (n & 0x0F));
|
||||
}
|
||||
|
||||
CAN_send(archiv,cancell[i],qua);
|
||||
// Отправка данных через CAN-шину
|
||||
CAN_send(archiv, cancell[i], qua);
|
||||
|
||||
cancount[i] = Cancount[i];
|
||||
cancell[i]+=qua;
|
||||
cancount[i] = Cancount[i]; // Установка задержки
|
||||
cancell[i] += qua; // Переход к следующей позиции
|
||||
|
||||
for(j=0;j<8;j++)
|
||||
if((masca[j] & Maska[i][j]) != Maska[i][j]) break;
|
||||
if(j==8)
|
||||
{
|
||||
for(j=0;j<8;j++) masca[j]&=~Maska[i][j];
|
||||
CanRound[i]++;
|
||||
}
|
||||
// Проверка завершения обработки всех элементов
|
||||
for(j = 0; j < 8; j++)
|
||||
if ((masca[j] & Maska[i][j]) != Maska[i][j])
|
||||
break;
|
||||
|
||||
if( Cancount[i]>1)
|
||||
if(!cancount[!i])
|
||||
cancount[!i]=1;
|
||||
}
|
||||
else
|
||||
cancell[i]++;
|
||||
}
|
||||
if (j == 8) // Если все элементы обработаны
|
||||
{
|
||||
// Сброс соответствующих битов маски
|
||||
for(j = 0; j < 8; j++)
|
||||
masca[j] &= ~Maska[i][j];
|
||||
CanRound[i]++; // Увеличение счетчика раундов
|
||||
}
|
||||
|
||||
Next:
|
||||
// Управление параллельной обработкой каналов
|
||||
if (Cancount[i] > 1 && !cancount[!i])
|
||||
cancount[!i] = 1; // Запуск другого канала
|
||||
}
|
||||
else
|
||||
{
|
||||
cancell[i]++; // Переход к следующему элементу
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReadEnteres();
|
||||
Next: // Метка для перехода к следующей части цикла
|
||||
|
||||
if(Errors.all|Alarms.all)
|
||||
Pvt4_OFF;
|
||||
else Pvt4_ON; // ñèãíàë "Ñèñòåìà ÂÝÏ â íîðìå"
|
||||
//=== ЧТЕНИЕ ВХОДНЫХ СИГНАЛОВ ===//
|
||||
ReadEnteres(); // Функция чтения дискретных входов
|
||||
|
||||
if(Errors.all) Pvt3_ON; // ñèãíàë "Àâàðèÿ ñèñòåìû ÂÝÏ"
|
||||
else Pvt3_OFF;
|
||||
//=== УПРАВЛЕНИЕ ВЫХОДНЫМИ СИГНАЛАМИ ===//
|
||||
if (Errors.all | Alarms.all)
|
||||
Pvt4_OFF; // Выключение сигнала "Система ВЭП в норме"
|
||||
else
|
||||
Pvt4_ON; // Включение сигнала "Система ВЭП в норме"
|
||||
|
||||
if(Falling_asleep) Pvt2_ON; // Ïîêà íå ñïèì, ýòî çàìêíóòî
|
||||
else Pvt2_OFF; // ñèãíàë "Óïðàâëåíèå ñåòüþ 24Â"
|
||||
if (Errors.all)
|
||||
Pvt3_ON; // Включение сигнала "Авария системы ВЭП"
|
||||
else
|
||||
Pvt3_OFF; // Выключение сигнала "Авария системы ВЭП"
|
||||
|
||||
if (Falling_asleep)
|
||||
Pvt2_ON; // Включение сигнала управления
|
||||
else
|
||||
Pvt2_OFF; // Выключение сигнала управления
|
||||
|
||||
//=== ОБРАБОТКА КОМАНД ===//
|
||||
if (Commands != precom) // Если команды изменились
|
||||
{
|
||||
command = (~precom | command) & Commands; // Обновление активных команд
|
||||
}
|
||||
precom = Commands; // Сохранение текущих команд для следующей итерации
|
||||
|
||||
//=== ОБРАБОТКА СИСТЕМНЫХ КОМАНД ===//
|
||||
if (cDefParam) // Команда сброса параметров по умолчанию
|
||||
{
|
||||
cDefParam = 0;
|
||||
Default_params(); // Вызов функции сброса параметров
|
||||
}
|
||||
|
||||
if (cSaveParam) // Команда сохранения параметров
|
||||
{
|
||||
cSaveParam = 0;
|
||||
Save_params(); // Вызов функции сохранения параметров
|
||||
}
|
||||
|
||||
if (cLoadParam) // Команда загрузки параметров
|
||||
{
|
||||
cLoadParam = 0;
|
||||
Load_params(); // Вызов функции загрузки параметров
|
||||
}
|
||||
|
||||
if (cCanReset) // Команда сброса CAN-системы
|
||||
{
|
||||
cCanReset = 0;
|
||||
|
||||
// Сброс всех счетчиков и состояний CAN-системы
|
||||
for(i = 0; i < 0x80; i++)
|
||||
county[i] = 1; // Установка флагов отправки для всех элементов
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
CanCycle[i] = 0; // Сброс счетчиков циклов
|
||||
CanRound[i] = 0; // Сброс счетчиков раундов
|
||||
cancount[i] = 0; // Сброс счетчиков задержки
|
||||
cancell[i] = 0; // Сброс позиций
|
||||
}
|
||||
|
||||
for(i = 0; i < 8; i++)
|
||||
masca[i] = 0; // Сброс масок
|
||||
}
|
||||
|
||||
|
||||
if(Commands!=precom)
|
||||
{
|
||||
command= (~precom|command) & Commands;
|
||||
}
|
||||
precom = Commands;
|
||||
|
||||
if(cDefParam)
|
||||
{
|
||||
cDefParam=0;
|
||||
Default_params();
|
||||
}
|
||||
|
||||
if(cSaveParam)
|
||||
{
|
||||
cSaveParam=0;
|
||||
Save_params();
|
||||
}
|
||||
|
||||
if(cLoadParam)
|
||||
{
|
||||
cLoadParam=0;
|
||||
Load_params();
|
||||
}
|
||||
|
||||
if(cCanReset)
|
||||
{
|
||||
cCanReset=0;
|
||||
|
||||
for(i=0;i<0x80;i++)
|
||||
county[i]=1;
|
||||
for(i=0;i<2;i++)
|
||||
CanCycle[i]=
|
||||
CanRound[i]=
|
||||
cancount[i]=
|
||||
cancell[i]=0;
|
||||
for(i=0;i<8;i++)
|
||||
masca[i]=0;
|
||||
} } }
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
||||
void Millisecond()
|
||||
{
|
||||
static int CanPowse;
|
||||
|
||||
static unsigned int
|
||||
count_blink=0, count_bright=0, count_mode,
|
||||
blink_over, blink_alarm, power_lamp, work_diod, norm_diod;
|
||||
static int preTest;
|
||||
int TST;
|
||||
|
||||
#define CANPOWSE 10 // 10 msec
|
||||
#define BLINK_TIME 250 // .25 sec
|
||||
|
||||
if(!cReset)
|
||||
IWDG->KR = 0xAAAA;//HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
if(!timGo) return;
|
||||
|
||||
Jumpers.byt.byte_1 = ReadJumpers();
|
||||
Jumpers.bit.bit0 =
|
||||
Buttons.bit.bit0 = TestJumper();
|
||||
|
||||
if(++CanPowse >= CANPOWSE)
|
||||
{
|
||||
CanPowse = 0; CanGO = 1;
|
||||
}
|
||||
|
||||
if(Alarms.bit.bit8) // Ðàçðÿä áàòàðåè
|
||||
{
|
||||
if (Falling_asleep) Falling_asleep--;
|
||||
}
|
||||
else Falling_asleep = 1000L * Sleep_time;
|
||||
|
||||
TST = TestJumper() | cTestLamp;
|
||||
|
||||
if(TST & !preTest)
|
||||
{
|
||||
count_blink = BLINK_TIME;
|
||||
count_mode = 0;
|
||||
}
|
||||
preTest = TST;
|
||||
|
||||
if(++count_blink >= BLINK_TIME)
|
||||
{
|
||||
count_blink=0;
|
||||
count_mode++;
|
||||
blink_over = (count_mode & 1)?1:0;
|
||||
blink_alarm = (count_mode & 7)?1:0;
|
||||
}
|
||||
|
||||
power_lamp= 1;
|
||||
norm_diod = 1;
|
||||
work_diod =!blink_over;
|
||||
|
||||
if(TST)
|
||||
{
|
||||
power_lamp = blink_over;
|
||||
norm_diod = blink_over;
|
||||
work_diod = blink_over;
|
||||
}
|
||||
else
|
||||
if(Lightness)
|
||||
{
|
||||
power_lamp = norm_diod = 0;
|
||||
if(Lightness==2) power_lamp = norm_diod = 1;
|
||||
if(Lightness==3) power_lamp = norm_diod = blink_over;
|
||||
if(Lightness==4) power_lamp = norm_diod = blink_alarm;
|
||||
if(Lightness==5) power_lamp = norm_diod = !blink_alarm;
|
||||
}
|
||||
else
|
||||
if(Errors.all)
|
||||
{
|
||||
power_lamp = blink_over;
|
||||
norm_diod = blink_over;
|
||||
}
|
||||
else
|
||||
if(Alarms.all)
|
||||
{
|
||||
power_lamp = blink_alarm;
|
||||
norm_diod = blink_alarm;
|
||||
}
|
||||
|
||||
if(++count_bright == 10) //maximum_bright
|
||||
{ count_bright = 0 ;
|
||||
|
||||
if(power_lamp) Pvt1_ON;
|
||||
else Pvt1_OFF;
|
||||
}
|
||||
|
||||
if(count_bright == Brightness)
|
||||
if(!TST) Pvt1_OFF; //îòêëþ÷åíèå ëàìïî÷êè
|
||||
|
||||
if(work_diod) LED_2_ON;
|
||||
else LED_2_OFF;
|
||||
|
||||
if(norm_diod) LED_3_ON;
|
||||
else LED_3_OFF;
|
||||
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
@ -460,10 +411,182 @@ void SystemClock_Config(void)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1);
|
||||
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_1);
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
//////////////// USER FUNC ////////////////////
|
||||
/**
|
||||
* @brief Проверяет, активен ли указанный элемент для обработки в CAN-шине
|
||||
* @param num Номер элемента (0x00-0x7F)
|
||||
* @param i Номер CAN-канала (0 или 1)
|
||||
* @param z Флаг дополнительных проверок (1 - включить доп. проверки, 0 - только маска)
|
||||
* @return 1 - элемент активен, 0 - элемент не активен
|
||||
*/
|
||||
int Isit(int num, int i, int z)
|
||||
{
|
||||
int res, pls;
|
||||
|
||||
//=== ПРОВЕРКА ДИАПАЗОНА ===//
|
||||
// Если номер элемента вне допустимого диапазона (0x00-0x7F)
|
||||
if((num < 0) || (num >= 0x80))
|
||||
return 0; // Элемент не активен
|
||||
|
||||
//=== ПРОВЕРКА МАСКИ КАНАЛА ===//
|
||||
// Определяем битовую маску для данного элемента
|
||||
// num/0x10 - определяем индекс в массиве масок (0-7)
|
||||
// num&0x0F - определяем позицию бита в слове (0-15)
|
||||
res = Maska[i][num / 0x10]; // Получаем маску для группы элементов
|
||||
res &= (1 << (num & 0x0F)); // Проверяем конкретный бит в маске
|
||||
|
||||
//=== ДОПОЛНИТЕЛЬНЫЕ ПРОВЕРКИ (если z != 0) ===//
|
||||
if(z)
|
||||
{
|
||||
// Проверка времени ожидания: если превышена половина времени перезапуска
|
||||
pls = (espero[num] > CanRestart[i] / 2);
|
||||
|
||||
// ИЛИ проверка счетчика отправки (если county[num] != 0)
|
||||
pls = pls || county[num];
|
||||
|
||||
// Комбинированная проверка: должен быть установлен в маске И выполнять условия
|
||||
res = res && pls;
|
||||
}
|
||||
|
||||
return res; // Возвращаем результат проверки
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Функция обработки милисекундных событий системы
|
||||
* @note Вызывается каждую миллисекунду из SysTick_Handler
|
||||
*/
|
||||
void Millisecond()
|
||||
{
|
||||
// Статические переменные для хранения состояния между вызовами
|
||||
static int CanPowse; // Счетчик для управления CAN-шиной
|
||||
static unsigned int count_blink = 0, // Счетчик для мигания
|
||||
count_bright = 0, // Счетчик для управления яркостью
|
||||
count_mode, // Счетчик режимов мигания
|
||||
blink_over, // Флаг переключения состояния мигания
|
||||
blink_alarm, // Флаг мигания аварии
|
||||
power_lamp, // Состояние силовой лампы
|
||||
work_diod, // Состояние рабочего светодиода
|
||||
norm_diod; // Состояние нормального светодиода
|
||||
static int preTest; // Предыдущее состояние теста
|
||||
int TST; // Текущее состояние теста
|
||||
|
||||
// Константы времени
|
||||
#define CANPOWSE 10 // 10 msec - период обновления CAN
|
||||
#define BLINK_TIME 250 // 0.25 sec - период мигания
|
||||
|
||||
//=== ОБНОВЛЕНИЕ WATCHDOG ===//
|
||||
if(!cReset)
|
||||
IWDG->KR = 0xAAAA; // Сброс watchdog таймера
|
||||
|
||||
//=== ПРОВЕРКА АКТИВНОСТИ ТАЙМЕРА ===//
|
||||
if(!timGo) return; // Если таймер не активен - выход
|
||||
|
||||
//=== ЧТЕНИЕ ПЕРЕКЛЮЧАТЕЛЕЙ И КНОПОК ===//
|
||||
Jumpers.byt.byte_1 = ReadJumpers(); // Чтение состояния переключателей
|
||||
Jumpers.bit.bit0 = Buttons.bit.bit0 = TestJumper(); // Чтение состояния кнопки
|
||||
|
||||
//=== УПРАВЛЕНИЕ CAN-ШИНОЙ ===//
|
||||
if(++CanPowse >= CANPOWSE)
|
||||
{
|
||||
CanPowse = 0; // Сброс счетчика
|
||||
CanGO = 1; // Установка флага разрешения работы CAN
|
||||
}
|
||||
|
||||
//=== УПРАВЛЕНИЕ РЕЖИМОМ "ЗАСЫПАНИЯ" ===//
|
||||
if(Alarms.bit.bit8) // Разряд батареи
|
||||
{
|
||||
if (Falling_asleep) Falling_asleep--; // Уменьшение времени до "сна"
|
||||
}
|
||||
else
|
||||
Falling_asleep = 1000L * Sleep_time; // Установка времени до "сна"
|
||||
|
||||
//=== ОБРАБОТКА ТЕСТОВОГО РЕЖИМА ===//
|
||||
TST = TestJumper() | cTestLamp; // Текущее состояние теста (кнопка или команда)
|
||||
|
||||
if(TST & !preTest) // Обнаружение фронта нажатия кнопки
|
||||
{
|
||||
count_blink = BLINK_TIME; // Сброс счетчика мигания
|
||||
count_mode = 0; // Сброс счетчика режимов
|
||||
}
|
||||
preTest = TST; // Сохранение состояния для следующего вызова
|
||||
|
||||
//=== УПРАВЛЕНИЕ МИГАНИЕМ ИНДИКАТОРОВ ===//
|
||||
if(++count_blink >= BLINK_TIME)
|
||||
{
|
||||
count_blink = 0; // Сброс счетчика
|
||||
count_mode++; // Переключение режима
|
||||
blink_over = (count_mode & 1) ? 1 : 0; // Мигание 1:1 (50%)
|
||||
blink_alarm = (count_mode & 7) ? 1 : 0; // Мигание 1:7 (12.5%)
|
||||
}
|
||||
|
||||
//=== УСТАНОВКА СТАНДАРТНЫХ СОСТОЯНИЙ ИНДИКАТОРОВ ===//
|
||||
power_lamp = 1; // Силовая лампа включена
|
||||
norm_diod = 1; // Нормальный светодиод включен
|
||||
work_diod = !blink_over; // Рабочий светодиод синхронизирован с миганием
|
||||
|
||||
//=== РЕЖИМ ТЕСТИРОВАНИЯ ===//
|
||||
if(TST)
|
||||
{
|
||||
power_lamp = blink_over; // Мигание силовой лампы
|
||||
norm_diod = blink_over; // Мигание нормального светодиода
|
||||
work_diod = blink_over; // Мигание рабочего светодиода
|
||||
}
|
||||
//=== РЕЖИМ ОСВЕЩЕНИЯ ===//
|
||||
else if(Lightness)
|
||||
{
|
||||
power_lamp = norm_diod = 0; // Базовое состояние - выключено
|
||||
|
||||
// Уровень освещенности 2: постоянно включено
|
||||
if(Lightness == 2) power_lamp = norm_diod = 1;
|
||||
|
||||
// Уровень освещенности 3: медленное мигание (50%)
|
||||
if(Lightness == 3) power_lamp = norm_diod = blink_over;
|
||||
|
||||
// Уровень освещенности 4: быстрое мигание (12.5%)
|
||||
if(Lightness == 4) power_lamp = norm_diod = blink_alarm;
|
||||
|
||||
// Уровень освещенности 5: инверсное быстрое мигание (87.5%)
|
||||
if(Lightness == 5) power_lamp = norm_diod = !blink_alarm;
|
||||
}
|
||||
//=== РЕЖИМ ОШИБОК ===//
|
||||
else if(Errors.all)
|
||||
{
|
||||
power_lamp = blink_over; // Мигание при ошибках
|
||||
norm_diod = blink_over; // Мигание при ошибках
|
||||
}
|
||||
//=== РЕЖИМ ТРЕВОГ ===//
|
||||
else if(Alarms.all)
|
||||
{
|
||||
power_lamp = blink_alarm; // Быстрое мигание при тревогах
|
||||
norm_diod = blink_alarm; // Быстрое мигание при тревогах
|
||||
}
|
||||
|
||||
//=== ШИМ УПРАВЛЕНИЕ ЯРКОСТЬЮ СИЛОВОЙ ЛАМПЫ ===//
|
||||
if(++count_bright == 10) // maximum_bright (100%)
|
||||
{
|
||||
count_bright = 0;
|
||||
if(power_lamp) Pvt1_ON; // Включение на полную яркость
|
||||
else Pvt1_OFF; // Выключение
|
||||
}
|
||||
|
||||
//=== УПРАВЛЕНИЕ ЯРКОСТЬЮ ===//
|
||||
if(count_bright == Brightness)
|
||||
if(!TST) Pvt1_OFF; // Отключение лампочки с регулировкой яркости
|
||||
|
||||
//=== УПРАВЛЕНИЕ СВЕТОДИОДАМИ ===//
|
||||
if(work_diod) LED_2_ON; // Включение рабочего светодиода
|
||||
else LED_2_OFF; // Выключение рабочего светодиода
|
||||
|
||||
if(norm_diod) LED_3_ON; // Включение нормального светодиода
|
||||
else LED_3_OFF; // Выключение нормального светодиода
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
@ -479,12 +602,15 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
if(htim->Instance == TIM4) //check if the interrupt comes from TIM4
|
||||
ReadSeanus();
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM8) {
|
||||
HAL_IncTick();
|
||||
}
|
||||
Millisecond();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
|
@ -1,492 +0,0 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "can.h"
|
||||
#include "iwdg.h"
|
||||
#include "tim.h"
|
||||
#include "gpio.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "package.h"
|
||||
#include "message.h"
|
||||
#include "lampa.h"
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
static long Falling_asleep;
|
||||
uint8_t CanGO=0, timGo=0;
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void SystemClock_Config(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
int Isit(int num, int i, int z)
|
||||
{
|
||||
int res, pls;
|
||||
|
||||
if((num<0)||(num>=0x80)) return 0;
|
||||
res = Maska[i][num/0x10];
|
||||
res &= (1<<(num&0x0F));
|
||||
|
||||
if(z)
|
||||
{
|
||||
pls = (espero[num]>CanRestart[i]/2);
|
||||
pls = pls || county[num];
|
||||
res = res && pls;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
static int i,j,n,z,mask,qua;
|
||||
static int cancount[2]={1,2},cancell[2]={0,0},candid[2]={0,0};
|
||||
static unsigned int masca[8];
|
||||
static uint16_t precom=0;
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||
HAL_Init();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
MX_TIM4_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
LED_0_OFF;
|
||||
LED_1_OFF;
|
||||
LED_2_OFF;
|
||||
LED_3_OFF;
|
||||
|
||||
for(i=0;i<10;i++)
|
||||
{
|
||||
LED_0_TGL; HAL_Delay(15);
|
||||
LED_1_TGL; HAL_Delay(15);
|
||||
LED_2_TGL; HAL_Delay(15);
|
||||
LED_3_TGL; HAL_Delay(15);
|
||||
}
|
||||
|
||||
Mode = ReadJumpers()+1;
|
||||
Setup_CAN_addr(Mode-1);
|
||||
Load_params();
|
||||
LastMode = Mode;
|
||||
Protokol = PROTOKOL;
|
||||
|
||||
command=0;
|
||||
|
||||
for(i=0;i<0x80;i++)
|
||||
county[i]=1;
|
||||
for(i=0;i<8;i++)
|
||||
masca[i]=0;
|
||||
for(i=0;i<2;i++)
|
||||
CanRound[i]=
|
||||
CanCycle[i]=0;
|
||||
|
||||
timGo=1;
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
if( CanGO)
|
||||
{ CanGO=0;
|
||||
|
||||
for(i=0;i<0x80;i++)
|
||||
if(espero[i]<30000) espero[i]++;
|
||||
|
||||
for(i=0;i<2;i++)
|
||||
if(cancount[i]) cancount[i]--;
|
||||
else cancell[i] = 0;
|
||||
}
|
||||
|
||||
for(i=0;i<2;i++)
|
||||
if( Cancount[i])
|
||||
if(!cancount[i])
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
if( cancell[i]>= 0x80)
|
||||
{ cancell[i]=0;
|
||||
|
||||
if( candid[i])
|
||||
{ candid[i]=0;
|
||||
CanCycle[i]++;
|
||||
cancount[i] = CanWait[i];
|
||||
goto Next;
|
||||
} }
|
||||
|
||||
mask = Maska[i][cancell[i]/0x10] >> (cancell[i]&0x0F);
|
||||
if(!mask) cancell[i] = (cancell[i] + 0x10) & 0xFFF0 ;
|
||||
else
|
||||
{
|
||||
while(!(mask & 1))
|
||||
{
|
||||
cancell[i]++; mask >>= 1;
|
||||
}
|
||||
break;
|
||||
} }
|
||||
|
||||
z=1;
|
||||
if(espero[cancell[i]]>CanRestart[i])
|
||||
{
|
||||
county[cancell[i]]=1;
|
||||
z=0;
|
||||
}
|
||||
|
||||
if(modbus[cancell[i]] != archiv[cancell[i]])
|
||||
{
|
||||
if(cancell[i]==keys)
|
||||
for(j=0;j<CanRptLen;j++)
|
||||
county[cancell[i]+j] = CanRptVez;
|
||||
else
|
||||
county[cancell[i]] = 1;
|
||||
}
|
||||
|
||||
if (county[cancell[i]])
|
||||
{
|
||||
for(j= 3; j>0 && !Isit(cancell[i]+j,i,z); j--);
|
||||
for(n=j-3; n<0 && !Isit(cancell[i]+n,i,1); n++);
|
||||
|
||||
qua = 1 + j - n;
|
||||
cancell[i]+= n;
|
||||
|
||||
for(j=0;j<qua;j++)
|
||||
{
|
||||
n=cancell[i]+j;
|
||||
archiv[n]= modbus[n];
|
||||
espero[n]= 0;
|
||||
|
||||
if( county[n])
|
||||
{ county[n]--;
|
||||
if(!county[n] && n != cancyclo+i) candid[i]=1;
|
||||
}
|
||||
if(!county[n]) masca[n/0x10] |= (1<<(n&0x0F));
|
||||
}
|
||||
|
||||
CAN_send(archiv,cancell[i],qua);
|
||||
|
||||
cancount[i] = Cancount[i];
|
||||
cancell[i]+=qua;
|
||||
|
||||
for(j=0;j<8;j++)
|
||||
if((masca[j] & Maska[i][j]) != Maska[i][j]) break;
|
||||
if(j==8)
|
||||
{
|
||||
for(j=0;j<8;j++) masca[j]&=~Maska[i][j];
|
||||
CanRound[i]++;
|
||||
}
|
||||
|
||||
if( Cancount[i]>1)
|
||||
if(!cancount[!i])
|
||||
cancount[!i]=1;
|
||||
}
|
||||
else
|
||||
cancell[i]++;
|
||||
}
|
||||
|
||||
Next:
|
||||
|
||||
ReadEnteres();
|
||||
|
||||
if(Errors.all|Alarms.all)
|
||||
Pvt4_OFF;
|
||||
else Pvt4_ON; // ñèãíàë "Ñèñòåìà ÂÝÏ â íîðìå"
|
||||
|
||||
if(Errors.all) Pvt3_ON; // ñèãíàë "Àâàðèÿ ñèñòåìû ÂÝÏ"
|
||||
else Pvt3_OFF;
|
||||
|
||||
if(Falling_asleep) Pvt2_ON; // Ïîêà íå ñïèì, ýòî çàìêíóòî
|
||||
else Pvt2_OFF; // ñèãíàë "Óïðàâëåíèå ñåòüþ 24Â"
|
||||
|
||||
|
||||
if(Commands!=precom)
|
||||
{
|
||||
command= (~precom|command) & Commands;
|
||||
modbus[23]=command;
|
||||
}
|
||||
precom = Commands;
|
||||
|
||||
if(cDefParam)
|
||||
{
|
||||
cDefParam=0;
|
||||
Default_params();
|
||||
}
|
||||
|
||||
if(cSaveParam)
|
||||
{
|
||||
cSaveParam=0;
|
||||
Save_params();
|
||||
}
|
||||
|
||||
if(cLoadParam)
|
||||
{
|
||||
cLoadParam=0;
|
||||
Load_params();
|
||||
}
|
||||
|
||||
if(cCanReset)
|
||||
{
|
||||
cCanReset=0;
|
||||
|
||||
for(i=0;i<0x80;i++)
|
||||
county[i]=1;
|
||||
for(i=0;i<2;i++)
|
||||
CanCycle[i]=
|
||||
CanRound[i]=
|
||||
cancount[i]=
|
||||
cancell[i]=0;
|
||||
for(i=0;i<8;i++)
|
||||
masca[i]=0;
|
||||
} } }
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
||||
void Millisecond()
|
||||
{
|
||||
static int CanPowse;
|
||||
|
||||
static unsigned int
|
||||
count_blink=0, count_bright=0, count_mode,
|
||||
blink_over, blink_alarm, power_lamp, work_diod, norm_diod;
|
||||
static int preTest;
|
||||
int TST;
|
||||
|
||||
#define CANPOWSE 10 // 10 msec
|
||||
#define BLINK_TIME 250 // .25 sec
|
||||
|
||||
if(!cReset)
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
if(!timGo) return;
|
||||
|
||||
Jumpers.byt.byte_1 = ReadJumpers();
|
||||
Jumpers.bit.bit0 =
|
||||
Buttons.bit.bit0 = TestJumper();
|
||||
|
||||
if(++CanPowse >= CANPOWSE)
|
||||
{
|
||||
CanPowse = 0; CanGO = 1;
|
||||
}
|
||||
|
||||
if(Alarms.bit.bit8) // Ðàçðÿä áàòàðåè
|
||||
{
|
||||
if (Falling_asleep) Falling_asleep--;
|
||||
}
|
||||
else Falling_asleep = 1000L * Sleep_time;
|
||||
|
||||
TST = TestJumper() | cTestLamp;
|
||||
|
||||
if(TST & !preTest)
|
||||
{
|
||||
count_blink = BLINK_TIME;
|
||||
count_mode = 0;
|
||||
}
|
||||
preTest = TST;
|
||||
|
||||
if(++count_blink >= BLINK_TIME)
|
||||
{
|
||||
count_blink=0;
|
||||
count_mode++;
|
||||
blink_over = (count_mode & 1)?1:0;
|
||||
blink_alarm = (count_mode & 7)?1:0;
|
||||
}
|
||||
|
||||
power_lamp= 1;
|
||||
norm_diod= 1;
|
||||
work_diod = 1;
|
||||
|
||||
if(TST)
|
||||
{
|
||||
power_lamp = blink_over;
|
||||
norm_diod = blink_over;
|
||||
work_diod =!blink_over;
|
||||
}
|
||||
else
|
||||
if(Lightness)
|
||||
{
|
||||
power_lamp = norm_diod = 0;
|
||||
if(Lightness==2) power_lamp = norm_diod = 1;
|
||||
if(Lightness==3) power_lamp = norm_diod = blink_over;
|
||||
if(Lightness==4) power_lamp = norm_diod = blink_alarm;
|
||||
if(Lightness==5) power_lamp = norm_diod = !blink_alarm;
|
||||
}
|
||||
else
|
||||
if(Errors.all)
|
||||
{
|
||||
power_lamp = blink_over;
|
||||
norm_diod = blink_over;
|
||||
}
|
||||
else
|
||||
if(Alarms.all)
|
||||
{
|
||||
power_lamp = blink_alarm;
|
||||
norm_diod = blink_alarm;
|
||||
}
|
||||
|
||||
if(++count_bright == 10) //maximum_bright
|
||||
{ count_bright = 0 ;
|
||||
|
||||
if(power_lamp) Pvt1_ON;
|
||||
else Pvt1_OFF;
|
||||
}
|
||||
|
||||
if(count_bright == Brightness)
|
||||
if(!TST) Pvt1_OFF; //îòêëþ÷åíèå ëàìïî÷êè
|
||||
|
||||
if(work_diod) LED_2_ON;
|
||||
else LED_2_OFF;
|
||||
|
||||
if(norm_diod) LED_3_ON;
|
||||
else LED_3_OFF;
|
||||
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL10;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief Reports the name of the source file and the source line number
|
||||
* where the assert_param error has occurred.
|
||||
* @param file: pointer to the source file name
|
||||
* @param line: assert_param error line source number
|
||||
* @retval None
|
||||
*/
|
||||
void assert_failed(uint8_t *file, uint32_t line)
|
||||
{
|
||||
/* USER CODE BEGIN 6 */
|
||||
/* User can add his own implementation to report the file name and line number,
|
||||
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||
/* USER CODE END 6 */
|
||||
}
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -8,13 +8,12 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
@ -6,13 +6,12 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2022 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
@ -58,6 +57,7 @@
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern CAN_HandleTypeDef hcan;
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
extern UART_HandleTypeDef huart4;
|
||||
extern TIM_HandleTypeDef htim8;
|
||||
|
||||
/* USER CODE BEGIN EV */
|
||||
@ -76,7 +76,7 @@ void NMI_Handler(void)
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
while (1)
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||
@ -244,6 +244,20 @@ void TIM4_IRQHandler(void)
|
||||
/* USER CODE END TIM4_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line[15:10] interrupts.
|
||||
*/
|
||||
void EXTI15_10_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(IN_07_Pin);
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM8 update interrupt.
|
||||
*/
|
||||
@ -254,10 +268,24 @@ void TIM8_UP_IRQHandler(void)
|
||||
/* USER CODE END TIM8_UP_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim8);
|
||||
/* USER CODE BEGIN TIM8_UP_IRQn 1 */
|
||||
Millisecond();
|
||||
|
||||
/* USER CODE END TIM8_UP_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles UART4 global interrupt.
|
||||
*/
|
||||
void UART4_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UART4_IRQn 0 */
|
||||
|
||||
/* USER CODE END UART4_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart4);
|
||||
/* USER CODE BEGIN UART4_IRQn 1 */
|
||||
|
||||
/* USER CODE END UART4_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
@ -1,156 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file syscalls.c
|
||||
* @author Auto-generated by STM32CubeIDE
|
||||
* @brief STM32CubeIDE Minimal System calls file
|
||||
*
|
||||
* For more information about which c-functions
|
||||
* need which of these lowlevel functions
|
||||
* please consult the Newlib libc-manual
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
|
||||
|
||||
/* Variables */
|
||||
extern int __io_putchar(int ch) __attribute__((weak));
|
||||
extern int __io_getchar(void) __attribute__((weak));
|
||||
|
||||
|
||||
char *__env[1] = { 0 };
|
||||
char **environ = __env;
|
||||
|
||||
|
||||
/* Functions */
|
||||
void initialise_monitor_handles()
|
||||
{
|
||||
}
|
||||
|
||||
int _getpid(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _kill(int pid, int sig)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void _exit (int status)
|
||||
{
|
||||
_kill(status, -1);
|
||||
while (1) {} /* Make sure we hang here */
|
||||
}
|
||||
|
||||
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||
{
|
||||
int DataIdx;
|
||||
|
||||
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||
{
|
||||
*ptr++ = __io_getchar();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||
{
|
||||
int DataIdx;
|
||||
|
||||
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||
{
|
||||
__io_putchar(*ptr++);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
int _close(int file)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int _fstat(int file, struct stat *st)
|
||||
{
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _isatty(int file)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _lseek(int file, int ptr, int dir)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _open(char *path, int flags, ...)
|
||||
{
|
||||
/* Pretend like we always fail */
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _wait(int *status)
|
||||
{
|
||||
errno = ECHILD;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _unlink(char *name)
|
||||
{
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _times(struct tms *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _stat(char *file, struct stat *st)
|
||||
{
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _link(char *old, char *new)
|
||||
{
|
||||
errno = EMLINK;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _fork(void)
|
||||
{
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _execve(char *name, char **argv, char **env)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file sysmem.c
|
||||
* @author Generated by STM32CubeIDE
|
||||
* @brief STM32CubeIDE System Memory calls file
|
||||
*
|
||||
* For more information about which C functions
|
||||
* need which of these lowlevel functions
|
||||
* please consult the newlib libc manual
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Pointer to the current high watermark of the heap usage
|
||||
*/
|
||||
static uint8_t *__sbrk_heap_end = NULL;
|
||||
|
||||
/**
|
||||
* @brief _sbrk() allocates memory to the newlib heap and is used by malloc
|
||||
* and others from the C library
|
||||
*
|
||||
* @verbatim
|
||||
* ############################################################################
|
||||
* # .data # .bss # newlib heap # MSP stack #
|
||||
* # # # # Reserved by _Min_Stack_Size #
|
||||
* ############################################################################
|
||||
* ^-- RAM start ^-- _end _estack, RAM end --^
|
||||
* @endverbatim
|
||||
*
|
||||
* This implementation starts allocating at the '_end' linker symbol
|
||||
* The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
|
||||
* The implementation considers '_estack' linker symbol to be RAM end
|
||||
* NOTE: If the MSP stack, at any point during execution, grows larger than the
|
||||
* reserved size, please increase the '_Min_Stack_Size'.
|
||||
*
|
||||
* @param incr Memory size
|
||||
* @return Pointer to allocated memory
|
||||
*/
|
||||
void *_sbrk(ptrdiff_t incr)
|
||||
{
|
||||
extern uint8_t _end; /* Symbol defined in the linker script */
|
||||
extern uint8_t _estack; /* Symbol defined in the linker script */
|
||||
extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
|
||||
const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
|
||||
const uint8_t *max_heap = (uint8_t *)stack_limit;
|
||||
uint8_t *prev_heap_end;
|
||||
|
||||
/* Initialize heap end at first call */
|
||||
if (NULL == __sbrk_heap_end)
|
||||
{
|
||||
__sbrk_heap_end = &_end;
|
||||
}
|
||||
|
||||
/* Protect heap from growing into the reserved MSP stack */
|
||||
if (__sbrk_heap_end + incr > max_heap)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return (void *)-1;
|
||||
}
|
||||
|
||||
prev_heap_end = __sbrk_heap_end;
|
||||
__sbrk_heap_end += incr;
|
||||
|
||||
return (void *)prev_heap_end;
|
||||
}
|
@ -33,17 +33,17 @@
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
* Copyright (c) 2017-2021 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef SYSTEM_STM32F1XX_C
|
||||
#define SYSTEM_STM32F1XX_C
|
||||
/** @addtogroup CMSIS
|
||||
* @{
|
||||
*/
|
||||
@ -139,7 +139,7 @@
|
||||
is no need to call the 2 first functions listed above, since SystemCoreClock
|
||||
variable is updated automatically.
|
||||
*/
|
||||
uint32_t SystemCoreClock = 16000000;
|
||||
uint32_t SystemCoreClock = 8000000;
|
||||
const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
|
||||
const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
|
||||
|
||||
@ -405,4 +405,5 @@ void SystemInit_ExtMemCtl(void)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
#endif /* SYSTEM_STM32F1XX_C */
|
||||
|
@ -22,12 +22,51 @@
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
#include "lampa.h"
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim4;
|
||||
|
||||
/* TIM2 init function */
|
||||
void MX_TIM2_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM2_Init 0 */
|
||||
|
||||
/* USER CODE END TIM2_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM2_Init 1 */
|
||||
|
||||
/* USER CODE END TIM2_Init 1 */
|
||||
htim2.Instance = TIM2;
|
||||
htim2.Init.Prescaler = 64-1;
|
||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim2.Init.Period = 65535;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM2_Init 2 */
|
||||
|
||||
/* USER CODE END TIM2_Init 2 */
|
||||
|
||||
}
|
||||
/* TIM4 init function */
|
||||
void MX_TIM4_Init(void)
|
||||
{
|
||||
@ -76,7 +115,18 @@ void MX_TIM4_Init(void)
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
if(tim_baseHandle->Instance==TIM4)
|
||||
if(tim_baseHandle->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 0 */
|
||||
/* TIM2 clock enable */
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
else if(tim_baseHandle->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||
|
||||
@ -96,7 +146,18 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
if(tim_baseHandle->Instance==TIM4)
|
||||
if(tim_baseHandle->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 1 */
|
||||
}
|
||||
else if(tim_baseHandle->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||
|
||||
@ -114,14 +175,4 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
//void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
//{
|
||||
|
||||
// if(htim->Instance == TIM4) //check if the interrupt comes from TIM1
|
||||
|
||||
// ReadSeanus();
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
121
Core/Src/usart.c
Normal file
121
Core/Src/usart.c
Normal file
@ -0,0 +1,121 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usart.c
|
||||
* @brief This file provides code for the configuration
|
||||
* of the USART instances.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "usart.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
UART_HandleTypeDef huart4;
|
||||
|
||||
/* UART4 init function */
|
||||
void MX_UART4_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN UART4_Init 0 */
|
||||
|
||||
/* USER CODE END UART4_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN UART4_Init 1 */
|
||||
|
||||
/* USER CODE END UART4_Init 1 */
|
||||
huart4.Instance = UART4;
|
||||
huart4.Init.BaudRate = 115200;
|
||||
huart4.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
huart4.Init.StopBits = UART_STOPBITS_1;
|
||||
huart4.Init.Parity = UART_PARITY_NONE;
|
||||
huart4.Init.Mode = UART_MODE_TX_RX;
|
||||
huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
huart4.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if (HAL_UART_Init(&huart4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN UART4_Init 2 */
|
||||
|
||||
/* USER CODE END UART4_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(uartHandle->Instance==UART4)
|
||||
{
|
||||
/* USER CODE BEGIN UART4_MspInit 0 */
|
||||
|
||||
/* USER CODE END UART4_MspInit 0 */
|
||||
/* UART4 clock enable */
|
||||
__HAL_RCC_UART4_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
/**UART4 GPIO Configuration
|
||||
PC10 ------> UART4_TX
|
||||
PC11 ------> UART4_RX
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_10;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_11;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/* UART4 interrupt Init */
|
||||
HAL_NVIC_SetPriority(UART4_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(UART4_IRQn);
|
||||
/* USER CODE BEGIN UART4_MspInit 1 */
|
||||
|
||||
/* USER CODE END UART4_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
|
||||
{
|
||||
|
||||
if(uartHandle->Instance==UART4)
|
||||
{
|
||||
/* USER CODE BEGIN UART4_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END UART4_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_UART4_CLK_DISABLE();
|
||||
|
||||
/**UART4 GPIO Configuration
|
||||
PC10 ------> UART4_TX
|
||||
PC11 ------> UART4_RX
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11);
|
||||
|
||||
/* UART4 interrupt Deinit */
|
||||
HAL_NVIC_DisableIRQ(UART4_IRQn);
|
||||
/* USER CODE BEGIN UART4_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END UART4_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
@ -1,468 +0,0 @@
|
||||
/**
|
||||
*************** (C) COPYRIGHT 2017 STMicroelectronics ************************
|
||||
* @file startup_stm32f103xe.s
|
||||
* @author MCD Application Team
|
||||
* @brief STM32F103xE Devices vector table for Atollic toolchain.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
* - Set the initial PC == Reset_Handler,
|
||||
* - Set the vector table entries with the exceptions ISR address
|
||||
* - Configure the clock system
|
||||
* - Configure external SRAM mounted on STM3210E-EVAL board
|
||||
* to be used as data memory (optional, to be enabled by user)
|
||||
* - Branches to main in the C library (which eventually
|
||||
* calls main()).
|
||||
* After Reset the Cortex-M3 processor is in Thread mode,
|
||||
* priority is Privileged, and the Stack is set to Main.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m3
|
||||
.fpu softvfp
|
||||
.thumb
|
||||
|
||||
.global g_pfnVectors
|
||||
.global Default_Handler
|
||||
|
||||
/* start address for the initialization values of the .data section.
|
||||
defined in linker script */
|
||||
.word _sidata
|
||||
/* start address for the .data section. defined in linker script */
|
||||
.word _sdata
|
||||
/* end address for the .data section. defined in linker script */
|
||||
.word _edata
|
||||
/* start address for the .bss section. defined in linker script */
|
||||
.word _sbss
|
||||
/* end address for the .bss section. defined in linker script */
|
||||
.word _ebss
|
||||
|
||||
.equ BootRAM, 0xF1E0F85F
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor first
|
||||
* starts execution following a reset event. Only the absolutely
|
||||
* necessary set is performed, after which the application
|
||||
* supplied main() routine is called.
|
||||
* @param None
|
||||
* @retval : None
|
||||
*/
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
b LoopCopyDataInit
|
||||
|
||||
CopyDataInit:
|
||||
ldr r3, =_sidata
|
||||
ldr r3, [r3, r1]
|
||||
str r3, [r0, r1]
|
||||
adds r1, r1, #4
|
||||
|
||||
LoopCopyDataInit:
|
||||
ldr r0, =_sdata
|
||||
ldr r3, =_edata
|
||||
adds r2, r0, r1
|
||||
cmp r2, r3
|
||||
bcc CopyDataInit
|
||||
ldr r2, =_sbss
|
||||
b LoopFillZerobss
|
||||
/* Zero fill the bss segment. */
|
||||
FillZerobss:
|
||||
movs r3, #0
|
||||
str r3, [r2], #4
|
||||
|
||||
LoopFillZerobss:
|
||||
ldr r3, = _ebss
|
||||
cmp r2, r3
|
||||
bcc FillZerobss
|
||||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
/* Call static constructors */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor receives an
|
||||
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||
* the system state for examination by a debugger.
|
||||
*
|
||||
* @param None
|
||||
* @retval : None
|
||||
*/
|
||||
.section .text.Default_Handler,"ax",%progbits
|
||||
Default_Handler:
|
||||
Infinite_Loop:
|
||||
b Infinite_Loop
|
||||
.size Default_Handler, .-Default_Handler
|
||||
/******************************************************************************
|
||||
*
|
||||
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||
* must be placed on this to ensure that it ends up at physical address
|
||||
* 0x0000.0000.
|
||||
*
|
||||
******************************************************************************/
|
||||
.section .isr_vector,"a",%progbits
|
||||
.type g_pfnVectors, %object
|
||||
.size g_pfnVectors, .-g_pfnVectors
|
||||
|
||||
|
||||
g_pfnVectors:
|
||||
|
||||
.word _estack
|
||||
.word Reset_Handler
|
||||
.word NMI_Handler
|
||||
.word HardFault_Handler
|
||||
.word MemManage_Handler
|
||||
.word BusFault_Handler
|
||||
.word UsageFault_Handler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word SVC_Handler
|
||||
.word DebugMon_Handler
|
||||
.word 0
|
||||
.word PendSV_Handler
|
||||
.word SysTick_Handler
|
||||
.word WWDG_IRQHandler
|
||||
.word PVD_IRQHandler
|
||||
.word TAMPER_IRQHandler
|
||||
.word RTC_IRQHandler
|
||||
.word FLASH_IRQHandler
|
||||
.word RCC_IRQHandler
|
||||
.word EXTI0_IRQHandler
|
||||
.word EXTI1_IRQHandler
|
||||
.word EXTI2_IRQHandler
|
||||
.word EXTI3_IRQHandler
|
||||
.word EXTI4_IRQHandler
|
||||
.word DMA1_Channel1_IRQHandler
|
||||
.word DMA1_Channel2_IRQHandler
|
||||
.word DMA1_Channel3_IRQHandler
|
||||
.word DMA1_Channel4_IRQHandler
|
||||
.word DMA1_Channel5_IRQHandler
|
||||
.word DMA1_Channel6_IRQHandler
|
||||
.word DMA1_Channel7_IRQHandler
|
||||
.word ADC1_2_IRQHandler
|
||||
.word USB_HP_CAN1_TX_IRQHandler
|
||||
.word USB_LP_CAN1_RX0_IRQHandler
|
||||
.word CAN1_RX1_IRQHandler
|
||||
.word CAN1_SCE_IRQHandler
|
||||
.word EXTI9_5_IRQHandler
|
||||
.word TIM1_BRK_IRQHandler
|
||||
.word TIM1_UP_IRQHandler
|
||||
.word TIM1_TRG_COM_IRQHandler
|
||||
.word TIM1_CC_IRQHandler
|
||||
.word TIM2_IRQHandler
|
||||
.word TIM3_IRQHandler
|
||||
.word TIM4_IRQHandler
|
||||
.word I2C1_EV_IRQHandler
|
||||
.word I2C1_ER_IRQHandler
|
||||
.word I2C2_EV_IRQHandler
|
||||
.word I2C2_ER_IRQHandler
|
||||
.word SPI1_IRQHandler
|
||||
.word SPI2_IRQHandler
|
||||
.word USART1_IRQHandler
|
||||
.word USART2_IRQHandler
|
||||
.word USART3_IRQHandler
|
||||
.word EXTI15_10_IRQHandler
|
||||
.word RTC_Alarm_IRQHandler
|
||||
.word USBWakeUp_IRQHandler
|
||||
.word TIM8_BRK_IRQHandler
|
||||
.word TIM8_UP_IRQHandler
|
||||
.word TIM8_TRG_COM_IRQHandler
|
||||
.word TIM8_CC_IRQHandler
|
||||
.word ADC3_IRQHandler
|
||||
.word FSMC_IRQHandler
|
||||
.word SDIO_IRQHandler
|
||||
.word TIM5_IRQHandler
|
||||
.word SPI3_IRQHandler
|
||||
.word UART4_IRQHandler
|
||||
.word UART5_IRQHandler
|
||||
.word TIM6_IRQHandler
|
||||
.word TIM7_IRQHandler
|
||||
.word DMA2_Channel1_IRQHandler
|
||||
.word DMA2_Channel2_IRQHandler
|
||||
.word DMA2_Channel3_IRQHandler
|
||||
.word DMA2_Channel4_5_IRQHandler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word BootRAM /* @0x1E0. This is for boot in RAM mode for
|
||||
STM32F10x High Density devices. */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||
* As they are weak aliases, any function with the same name will override
|
||||
* this definition.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
.weak NMI_Handler
|
||||
.thumb_set NMI_Handler,Default_Handler
|
||||
|
||||
.weak HardFault_Handler
|
||||
.thumb_set HardFault_Handler,Default_Handler
|
||||
|
||||
.weak MemManage_Handler
|
||||
.thumb_set MemManage_Handler,Default_Handler
|
||||
|
||||
.weak BusFault_Handler
|
||||
.thumb_set BusFault_Handler,Default_Handler
|
||||
|
||||
.weak UsageFault_Handler
|
||||
.thumb_set UsageFault_Handler,Default_Handler
|
||||
|
||||
.weak SVC_Handler
|
||||
.thumb_set SVC_Handler,Default_Handler
|
||||
|
||||
.weak DebugMon_Handler
|
||||
.thumb_set DebugMon_Handler,Default_Handler
|
||||
|
||||
.weak PendSV_Handler
|
||||
.thumb_set PendSV_Handler,Default_Handler
|
||||
|
||||
.weak SysTick_Handler
|
||||
.thumb_set SysTick_Handler,Default_Handler
|
||||
|
||||
.weak WWDG_IRQHandler
|
||||
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||
|
||||
.weak PVD_IRQHandler
|
||||
.thumb_set PVD_IRQHandler,Default_Handler
|
||||
|
||||
.weak TAMPER_IRQHandler
|
||||
.thumb_set TAMPER_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_IRQHandler
|
||||
.thumb_set RTC_IRQHandler,Default_Handler
|
||||
|
||||
.weak FLASH_IRQHandler
|
||||
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||
|
||||
.weak RCC_IRQHandler
|
||||
.thumb_set RCC_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI0_IRQHandler
|
||||
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI1_IRQHandler
|
||||
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI2_IRQHandler
|
||||
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI3_IRQHandler
|
||||
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI4_IRQHandler
|
||||
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel1_IRQHandler
|
||||
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel2_IRQHandler
|
||||
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel3_IRQHandler
|
||||
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel4_IRQHandler
|
||||
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel5_IRQHandler
|
||||
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel6_IRQHandler
|
||||
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Channel7_IRQHandler
|
||||
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler
|
||||
|
||||
.weak ADC1_2_IRQHandler
|
||||
.thumb_set ADC1_2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USB_HP_CAN1_TX_IRQHandler
|
||||
.thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak USB_LP_CAN1_RX0_IRQHandler
|
||||
.thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX1_IRQHandler
|
||||
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_SCE_IRQHandler
|
||||
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI9_5_IRQHandler
|
||||
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_BRK_IRQHandler
|
||||
.thumb_set TIM1_BRK_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_UP_IRQHandler
|
||||
.thumb_set TIM1_UP_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_TRG_COM_IRQHandler
|
||||
.thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_CC_IRQHandler
|
||||
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM2_IRQHandler
|
||||
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM3_IRQHandler
|
||||
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM4_IRQHandler
|
||||
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_EV_IRQHandler
|
||||
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_ER_IRQHandler
|
||||
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_EV_IRQHandler
|
||||
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_ER_IRQHandler
|
||||
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI1_IRQHandler
|
||||
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI2_IRQHandler
|
||||
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART1_IRQHandler
|
||||
.thumb_set USART1_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART2_IRQHandler
|
||||
.thumb_set USART2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART3_IRQHandler
|
||||
.thumb_set USART3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI15_10_IRQHandler
|
||||
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_Alarm_IRQHandler
|
||||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||
|
||||
.weak USBWakeUp_IRQHandler
|
||||
.thumb_set USBWakeUp_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_BRK_IRQHandler
|
||||
.thumb_set TIM8_BRK_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_UP_IRQHandler
|
||||
.thumb_set TIM8_UP_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_TRG_COM_IRQHandler
|
||||
.thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_CC_IRQHandler
|
||||
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak ADC3_IRQHandler
|
||||
.thumb_set ADC3_IRQHandler,Default_Handler
|
||||
|
||||
.weak FSMC_IRQHandler
|
||||
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||
|
||||
.weak SDIO_IRQHandler
|
||||
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM5_IRQHandler
|
||||
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI3_IRQHandler
|
||||
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART4_IRQHandler
|
||||
.thumb_set UART4_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART5_IRQHandler
|
||||
.thumb_set UART5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM6_IRQHandler
|
||||
.thumb_set TIM6_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM7_IRQHandler
|
||||
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Channel1_IRQHandler
|
||||
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Channel2_IRQHandler
|
||||
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Channel3_IRQHandler
|
||||
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Channel4_5_IRQHandler
|
||||
.thumb_set DMA2_Channel4_5_IRQHandler,Default_Handler
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -1,83 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
1.You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
2.You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX:
|
||||
|
||||
Copyright [2019] [STMicroelectronics]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -1,232 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f1xx_hal_iwdg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header file of IWDG HAL module.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef STM32F1xx_HAL_IWDG_H
|
||||
#define STM32F1xx_HAL_IWDG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f1xx_hal_def.h"
|
||||
|
||||
/** @addtogroup STM32F1xx_HAL_Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IWDG IWDG
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Exported_Types IWDG Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief IWDG Init structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Prescaler; /*!< Select the prescaler of the IWDG.
|
||||
This parameter can be a value of @ref IWDG_Prescaler */
|
||||
|
||||
uint32_t Reload; /*!< Specifies the IWDG down-counter reload value.
|
||||
This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */
|
||||
|
||||
} IWDG_InitTypeDef;
|
||||
|
||||
/**
|
||||
* @brief IWDG Handle Structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
IWDG_TypeDef *Instance; /*!< Register base address */
|
||||
|
||||
IWDG_InitTypeDef Init; /*!< IWDG required parameters */
|
||||
} IWDG_HandleTypeDef;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Exported_Constants IWDG Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IWDG_Prescaler IWDG Prescaler
|
||||
* @{
|
||||
*/
|
||||
#define IWDG_PRESCALER_4 0x00000000U /*!< IWDG prescaler set to 4 */
|
||||
#define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */
|
||||
#define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */
|
||||
#define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */
|
||||
#define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */
|
||||
#define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */
|
||||
#define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macros -----------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Exported_Macros IWDG Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Enable the IWDG peripheral.
|
||||
* @param __HANDLE__ IWDG handle
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE)
|
||||
|
||||
/**
|
||||
* @brief Reload IWDG counter with value defined in the reload register
|
||||
* (write access to IWDG_PR and IWDG_RLR registers disabled).
|
||||
* @param __HANDLE__ IWDG handle
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Exported_Functions IWDG Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IWDG_Exported_Functions_Group1 Initialization and Start functions
|
||||
* @{
|
||||
*/
|
||||
/* Initialization/Start functions ********************************************/
|
||||
HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IWDG_Exported_Functions_Group2 IO operation functions
|
||||
* @{
|
||||
*/
|
||||
/* I/O operation functions ****************************************************/
|
||||
HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Private_Constants IWDG Private Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief IWDG Key Register BitMask
|
||||
*/
|
||||
#define IWDG_KEY_RELOAD 0x000000AAU /*!< IWDG Reload Counter Enable */
|
||||
#define IWDG_KEY_ENABLE 0x000000CCU /*!< IWDG Peripheral Enable */
|
||||
#define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00000055U /*!< IWDG KR Write Access Enable */
|
||||
#define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000U /*!< IWDG KR Write Access Disable */
|
||||
|
||||
//#define IWDG_KEY_RELOAD 0x0000AAAAU /*!< IWDG Reload Counter Enable */
|
||||
//#define IWDG_KEY_ENABLE 0x0000CCCCU /*!< IWDG Peripheral Enable */
|
||||
//#define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555U /*!< IWDG KR Write Access Enable */
|
||||
//#define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000U /*!< IWDG KR Write Access Disable */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/** @defgroup IWDG_Private_Macros IWDG Private Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Enable write access to IWDG_PR and IWDG_RLR registers.
|
||||
* @param __HANDLE__ IWDG handle
|
||||
* @retval None
|
||||
*/
|
||||
#define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE)
|
||||
|
||||
/**
|
||||
* @brief Disable write access to IWDG_PR and IWDG_RLR registers.
|
||||
* @param __HANDLE__ IWDG handle
|
||||
* @retval None
|
||||
*/
|
||||
#define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE)
|
||||
|
||||
/**
|
||||
* @brief Check IWDG prescaler value.
|
||||
* @param __PRESCALER__ IWDG prescaler value
|
||||
* @retval None
|
||||
*/
|
||||
#define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_8) || \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_16) || \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_32) || \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_64) || \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_128)|| \
|
||||
((__PRESCALER__) == IWDG_PRESCALER_256))
|
||||
|
||||
/**
|
||||
* @brief Check IWDG reload value.
|
||||
* @param __RELOAD__ IWDG reload value
|
||||
* @retval None
|
||||
*/
|
||||
#define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32F1xx_HAL_IWDG_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -1,3 +0,0 @@
|
||||
# Copyright (c) 2016 STMicroelectronics
|
||||
|
||||
This software component is licensed by STMicroelectronics under the **BSD 3-Clause** license. You may not use this file except in compliance with this license. You may obtain a copy of the license [here](https://opensource.org/licenses/BSD-3-Clause).
|
36
MDK-ARM/DebugConfig/bootloader_STM32F103RC_1.0.0.dbgconf
Normal file
36
MDK-ARM/DebugConfig/bootloader_STM32F103RC_1.0.0.dbgconf
Normal file
@ -0,0 +1,36 @@
|
||||
// File: STM32F101_102_103_105_107.dbgconf
|
||||
// Version: 1.0.0
|
||||
// Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008)
|
||||
// STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Debug MCU configuration register (DBGMCU_CR)
|
||||
// <i> Reserved bits must be kept at reset value
|
||||
// <o.30> DBG_TIM11_STOP <i> TIM11 counter stopped when core is halted
|
||||
// <o.29> DBG_TIM10_STOP <i> TIM10 counter stopped when core is halted
|
||||
// <o.28> DBG_TIM9_STOP <i> TIM9 counter stopped when core is halted
|
||||
// <o.27> DBG_TIM14_STOP <i> TIM14 counter stopped when core is halted
|
||||
// <o.26> DBG_TIM13_STOP <i> TIM13 counter stopped when core is halted
|
||||
// <o.25> DBG_TIM12_STOP <i> TIM12 counter stopped when core is halted
|
||||
// <o.21> DBG_CAN2_STOP <i> Debug CAN2 stopped when core is halted
|
||||
// <o.20> DBG_TIM7_STOP <i> TIM7 counter stopped when core is halted
|
||||
// <o.19> DBG_TIM6_STOP <i> TIM6 counter stopped when core is halted
|
||||
// <o.18> DBG_TIM5_STOP <i> TIM5 counter stopped when core is halted
|
||||
// <o.17> DBG_TIM8_STOP <i> TIM8 counter stopped when core is halted
|
||||
// <o.16> DBG_I2C2_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
|
||||
// <o.15> DBG_I2C1_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
|
||||
// <o.14> DBG_CAN1_STOP <i> Debug CAN1 stopped when Core is halted
|
||||
// <o.13> DBG_TIM4_STOP <i> TIM4 counter stopped when core is halted
|
||||
// <o.12> DBG_TIM3_STOP <i> TIM3 counter stopped when core is halted
|
||||
// <o.11> DBG_TIM2_STOP <i> TIM2 counter stopped when core is halted
|
||||
// <o.10> DBG_TIM1_STOP <i> TIM1 counter stopped when core is halted
|
||||
// <o.9> DBG_WWDG_STOP <i> Debug window watchdog stopped when core is halted
|
||||
// <o.8> DBG_IWDG_STOP <i> Debug independent watchdog stopped when core is halted
|
||||
// <o.2> DBG_STANDBY <i> Debug standby mode
|
||||
// <o.1> DBG_STOP <i> Debug stop mode
|
||||
// <o.0> DBG_SLEEP <i> Debug sleep mode
|
||||
// </h>
|
||||
DbgMCU_CR = 0x00000007;
|
||||
|
||||
// <<< end of configuration section >>>
|
4803
MDK-ARM/JLinkLog.txt
4803
MDK-ARM/JLinkLog.txt
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
||||
[BREAKPOINTS]
|
||||
ForceImpTypeAny = 0
|
||||
ShowInfoWin = 1
|
||||
EnableFlashBP = 2
|
||||
BPDuringExecution = 0
|
||||
[CFI]
|
||||
CFISize = 0x00
|
||||
CFIAddr = 0x00
|
||||
[CPU]
|
||||
MonModeVTableAddr = 0xFFFFFFFF
|
||||
MonModeDebug = 0
|
||||
MaxNumAPs = 0
|
||||
LowPowerHandlingMode = 0
|
||||
OverrideMemMap = 0
|
||||
AllowSimulation = 1
|
||||
ScriptFile=""
|
||||
[FLASH]
|
||||
CacheExcludeSize = 0x00
|
||||
CacheExcludeAddr = 0x00
|
||||
MinNumBytesFlashDL = 0
|
||||
SkipProgOnCRCMatch = 1
|
||||
VerifyDownload = 1
|
||||
AllowCaching = 1
|
||||
EnableFlashDL = 2
|
||||
Override = 0
|
||||
Device="ARM7"
|
||||
[GENERAL]
|
||||
WorkRAMSize = 0x00
|
||||
WorkRAMAddr = 0x00
|
||||
RAMUsageLimit = 0x00
|
||||
[SWO]
|
||||
SWOLogFile=""
|
||||
[MEM]
|
||||
RdOverrideOrMask = 0x00
|
||||
RdOverrideAndMask = 0xFFFFFFFF
|
||||
RdOverrideAddr = 0xFFFFFFFF
|
||||
WrOverrideOrMask = 0x00
|
||||
WrOverrideAndMask = 0xFFFFFFFF
|
||||
WrOverrideAddr = 0xFFFFFFFF
|
21
MDK-ARM/RTE/_bootloader/RTE_Components.h
Normal file
21
MDK-ARM/RTE/_bootloader/RTE_Components.h
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
/*
|
||||
* Auto generated Run-Time-Environment Configuration File
|
||||
* *** Do not modify ! ***
|
||||
*
|
||||
* Project: 'uksvep_2_2_v1'
|
||||
* Target: 'bootloader'
|
||||
*/
|
||||
|
||||
#ifndef RTE_COMPONENTS_H
|
||||
#define RTE_COMPONENTS_H
|
||||
|
||||
|
||||
/*
|
||||
* Define the Device Header File:
|
||||
*/
|
||||
#define CMSIS_device_header "stm32f10x.h"
|
||||
|
||||
|
||||
|
||||
#endif /* RTE_COMPONENTS_H */
|
16
MDK-ARM/bootloader/bootloader.sct
Normal file
16
MDK-ARM/bootloader/bootloader.sct
Normal file
@ -0,0 +1,16 @@
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x08000000 0x0000C000 { ; load region size_region
|
||||
ER_IROM1 0x08000000 0x0000C000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
RW_IRAM1 0x20000000 0x0000C000 { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x08000000 0x00040000 { ; load region size_region
|
||||
ER_IROM1 0x08000000 0x00040000 { ; load address = execution address
|
||||
LR_IROM1 0x0800C000 0x00040000 { ; load region size_region
|
||||
ER_IROM1 0x0800C000 0x00040000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
File diff suppressed because it is too large
Load Diff
@ -14,13 +14,12 @@
|
||||
;******************************************************************************
|
||||
;* @attention
|
||||
;*
|
||||
;* Copyright (c) 2017 STMicroelectronics.
|
||||
;* Copyright (c) 2017-2021 STMicroelectronics.
|
||||
;* All rights reserved.
|
||||
;*
|
||||
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||
;* the "License"; You may not use this file except in compliance with the
|
||||
;* License. You may obtain a copy of the License at:
|
||||
;* opensource.org/licenses/BSD-3-Clause
|
||||
;* This software is licensed under terms that can be found in the LICENSE file
|
||||
;* in the root directory of this software component.
|
||||
;* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
;*
|
||||
;******************************************************************************
|
||||
|
||||
@ -353,4 +352,3 @@ __user_initial_stackheap
|
||||
|
||||
END
|
||||
|
||||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -12,7 +12,7 @@
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<CppX>*.cpp; *.cc; *.cxx</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
@ -25,6 +25,161 @@
|
||||
<TargetName>uksvep_2_2_v1</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>8000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>0</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath></ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>0</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\UL2CM3.DLL</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512 -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>1</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Target>
|
||||
<TargetName>bootloader</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>8000000</CLKADS>
|
||||
<OPTTT>
|
||||
@ -93,7 +248,7 @@
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>1</tRfunc>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
@ -117,11 +272,6 @@
|
||||
<pMon>Segger\JL2CM3.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
@ -137,103 +287,63 @@
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U60145543 -O14 -S3 -ZTIFSpeedSel3000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(4) -N01("Unknown JTAG device") -D01(06414041) -L01(5) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||
<Name>-U60145543 -O14 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(4) -N01("Unknown JTAG device") -D01(06414041) -L01(5) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512 -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U52FF6D067188485535530767 -O2190 -SF268436581 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL040000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint>
|
||||
<Bp>
|
||||
<Number>0</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>240</LineNumber>
|
||||
<LineNumber>368</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>26</Address>
|
||||
<Address>134230816</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>../Core/Src/system_stm32f1xx.c</Filename>
|
||||
<Filename>..\Core\Bootloader\Src\bootloader.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\uksvep_2_2_v1\../Core/Src/system_stm32f1xx.c\240</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>1</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>107</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134235170</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>../Core/Src/main.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\uksvep_2_2_v1\../Core/Src/main.c\107</Expression>
|
||||
<Expression>\\bootloader\../Core/Bootloader/Src/bootloader.c\368</Expression>
|
||||
</Bp>
|
||||
</Breakpoint>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>CanGo</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>cancell[i]</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>hiwdg</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>flag,0x0A</ItemText>
|
||||
<ItemText>boot</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<WatchWindow2>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>modbus</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>~precom</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>params[128]</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow2>
|
||||
<MemoryWindow1>
|
||||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>0</SubType>
|
||||
<ItemText>0</ItemText>
|
||||
<ItemText>0x0800c000</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
<MemoryWindow2>
|
||||
<Mm>
|
||||
<WinNumber>2</WinNumber>
|
||||
<SubType>0</SubType>
|
||||
<ItemText>0x08009800</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow2>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
@ -258,7 +368,7 @@
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>1</StkLoc>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
@ -276,37 +386,19 @@
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<SystemViewers>
|
||||
<Entry>
|
||||
<Name>System Viewer\DBG</Name>
|
||||
<WinId>35904</WinId>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Name>System Viewer\GPIOC</Name>
|
||||
<WinId>35903</WinId>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Name>System Viewer\IWDG</Name>
|
||||
<WinId>35905</WinId>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Name>System Viewer\RCC</Name>
|
||||
<WinId>35902</WinId>
|
||||
</Entry>
|
||||
</SystemViewers>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableFlashSeq>1</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>1</Protocol>
|
||||
<DbgClock>-2146358648</DbgClock>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/MDK-ARM</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -326,7 +418,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User/Core</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -373,8 +465,8 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Src\message.c</PathWithFileName>
|
||||
<FilenameWithoutPath>message.c</FilenameWithoutPath>
|
||||
<PathWithFileName>../Core/Src/main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
@ -385,8 +477,8 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<PathWithFileName>..\Core\Src\message.c</PathWithFileName>
|
||||
<FilenameWithoutPath>message.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
@ -394,7 +486,7 @@
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/gpio.c</PathWithFileName>
|
||||
@ -421,7 +513,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Src\iwdg.c</PathWithFileName>
|
||||
<PathWithFileName>../Core/Src/iwdg.c</PathWithFileName>
|
||||
<FilenameWithoutPath>iwdg.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@ -445,6 +537,18 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/usart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>usart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>12</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Core/Src/stm32f1xx_it.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32f1xx_it.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -452,7 +556,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>12</FileNumber>
|
||||
<FileNumber>13</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -464,7 +568,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>13</FileNumber>
|
||||
<FileNumber>14</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -478,13 +582,13 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Drivers/STM32F1xx_HAL_Driver</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>14</FileNumber>
|
||||
<FileNumber>15</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -496,7 +600,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>15</FileNumber>
|
||||
<FileNumber>16</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -508,7 +612,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>16</FileNumber>
|
||||
<FileNumber>17</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -520,7 +624,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>17</FileNumber>
|
||||
<FileNumber>18</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -532,7 +636,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>18</FileNumber>
|
||||
<FileNumber>19</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -544,7 +648,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>19</FileNumber>
|
||||
<FileNumber>20</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -556,7 +660,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>20</FileNumber>
|
||||
<FileNumber>21</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -568,7 +672,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>21</FileNumber>
|
||||
<FileNumber>22</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -580,7 +684,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>22</FileNumber>
|
||||
<FileNumber>23</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -592,7 +696,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>23</FileNumber>
|
||||
<FileNumber>24</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -604,7 +708,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>24</FileNumber>
|
||||
<FileNumber>25</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -616,7 +720,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>25</FileNumber>
|
||||
<FileNumber>26</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -628,19 +732,19 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>26</FileNumber>
|
||||
<FileNumber>27</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_iwdg.c</PathWithFileName>
|
||||
<PathWithFileName>../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32f1xx_hal_iwdg.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>27</FileNumber>
|
||||
<FileNumber>28</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -652,7 +756,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>28</FileNumber>
|
||||
<FileNumber>29</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -662,6 +766,18 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>30</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32f1xx_hal_uart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
@ -672,7 +788,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>29</FileNumber>
|
||||
<FileNumber>31</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@ -684,6 +800,110 @@
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Bootloader</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>32</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Inc\boot_project_setup.h</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_project_setup.h</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>33</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>34</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\bootloader.c</PathWithFileName>
|
||||
<FilenameWithoutPath>bootloader.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>35</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_uart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_uart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>36</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_can.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_can.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>37</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_flash.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_flash.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>38</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_gpio.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_gpio.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>39</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Bootloader\Src\boot_jump.c</PathWithFileName>
|
||||
<FilenameWithoutPath>boot_jump.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
[EXTDLL]
|
||||
Count=0
|
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
uksvep_2_2_v1/can.o: ..\Core\Src\can.c ..\Core\Inc\can.h \
|
||||
..\Core\Inc\main.h ..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
|
||||
..\Core\Inc\gpio.h ..\Core\Inc\message.h ..\Core\Inc\struc.h
|
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
uksvep_2_2_v1/crc16.o: ..\Core\Src\crc16.c ..\Core\Inc\crc16.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h
|
Binary file not shown.
Binary file not shown.
@ -1,37 +0,0 @@
|
||||
uksvep_2_2_v1\ecan.o: ..\Core\Src\ecan.c
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/stm32f1xx_hal_conf.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Include/core_cm3.h
|
||||
uksvep_2_2_v1\ecan.o: d:\Keil\ARM\ARMCC\Bin\..\include\stdint.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Include/cmsis_version.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
|
||||
uksvep_2_2_v1\ecan.o: d:\Keil\ARM\ARMCC\Bin\..\include\stddef.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h
|
||||
uksvep_2_2_v1\ecan.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/gpio.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/main.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/struc.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/package.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/ecan.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/message.h
|
||||
uksvep_2_2_v1\ecan.o: ../Core/Inc/lampa.h
|
||||
uksvep_2_2_v1\ecan.o: d:\Keil\ARM\ARMCC\Bin\..\include\stdbool.h
|
Binary file not shown.
Binary file not shown.
@ -1,31 +0,0 @@
|
||||
uksvep_2_2_v1/eeprom.o: ..\Core\Src\eeprom.c ..\Core\Inc\eeprom.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
@ -1,31 +0,0 @@
|
||||
uksvep_2_2_v1/gpio.o: ..\Core\Src\gpio.c ..\Core\Inc\gpio.h \
|
||||
..\Core\Inc\main.h ..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
@ -1,31 +0,0 @@
|
||||
uksvep_2_2_v1/iwdg.o: ..\Core\Src\iwdg.c ..\Core\Inc\iwdg.h \
|
||||
..\Core\Inc\main.h ..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
@ -1,33 +0,0 @@
|
||||
uksvep_2_2_v1/lampa.o: ..\Core\Src\lampa.c ..\Core\Inc\gpio.h \
|
||||
..\Core\Inc\main.h ..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
|
||||
..\Core\Inc\lampa.h C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdbool.h \
|
||||
..\Core\Inc\struc.h ..\Core\Inc\message.h ..\Core\Inc\package.h
|
Binary file not shown.
Binary file not shown.
@ -1,35 +0,0 @@
|
||||
uksvep_2_2_v1/main.o: ..\Core\Src\main.c ..\Core\Inc\main.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
|
||||
..\Core\Inc\can.h ..\Core\Inc\iwdg.h ..\Core\Inc\tim.h \
|
||||
..\Core\Inc\gpio.h ..\Core\Inc\package.h ..\Core\Inc\message.h \
|
||||
..\Core\Inc\struc.h ..\Core\Inc\lampa.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdbool.h
|
Binary file not shown.
Binary file not shown.
@ -1,33 +0,0 @@
|
||||
uksvep_2_2_v1/message.o: ..\Core\Src\message.c \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
|
||||
..\Core\Inc\struc.h ..\Core\Inc\crc16.h ..\Core\Inc\package.h \
|
||||
..\Core\Inc\message.h ..\Core\Inc\eeprom.h
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
uksvep_2_2_v1\startup_stm32f103xe.o: startup_stm32f103xe.s
|
Binary file not shown.
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
uksvep_2_2_v1/stm32f1xx_hal.o: \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
@ -1,30 +0,0 @@
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Core/Inc/stm32f1xx_hal_conf.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Include/core_cm3.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: d:\Keil\ARM\ARMCC\Bin\..\include\stdint.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Include/cmsis_version.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: d:\Keil\ARM\ARMCC\Bin\..\include\stddef.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
|
Binary file not shown.
Binary file not shown.
@ -1,30 +0,0 @@
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Core/Inc/stm32f1xx_hal_conf.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Include/core_cm3.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: d:\Keil\ARM\ARMCC\Bin\..\include\stdint.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Include/cmsis_version.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: d:\Keil\ARM\ARMCC\Bin\..\include\stddef.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
uksvep_2_2_v1\stm32f1xx_hal_adc_ex.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
|
Binary file not shown.
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
uksvep_2_2_v1/stm32f1xx_hal_can.o: \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_can.c \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
uksvep_2_2_v1/stm32f1xx_hal_cortex.o: \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
|
||||
..\Core\Inc\stm32f1xx_hal_conf.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h \
|
||||
..\Drivers\CMSIS\Include\core_cm3.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_version.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_compiler.h \
|
||||
..\Drivers\CMSIS\Include\cmsis_armclang.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
|
||||
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
|
||||
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_can.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_iwdg.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
|
||||
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h
|
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user