Bootloader start work
This commit is contained in:
parent
43185a391c
commit
9396bc3fb2
51 changed files with 10145 additions and 9127 deletions
|
@ -173,4 +173,5 @@
|
|||
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}}
|
|
@ -1,4 +1,5 @@
|
|||
2F62501ED4689FB349E356AB974DBE57=9E2193C46F66F22FF98D84DBB5C34D23
|
||||
635E684B79701B039C64EA45C3F84D30=C781131A7B2809FF4382EAF5B3C6C1B2
|
||||
8DF89ED150041C4CBC7CB9A9CAA90856=54C15FA5FFB683D1E813986C9EAD009D
|
||||
8DF89ED150041C4CBC7CB9A9CAA90856=9E2193C46F66F22FF98D84DBB5C34D23
|
||||
DC22A860405A8BF2F2C095E5B6529F12=54C15FA5FFB683D1E813986C9EAD009D
|
||||
eclipse.preferences.version=1
|
||||
|
|
|
@ -44,7 +44,7 @@ void MX_CAN2_Init(void)
|
|||
hcan2.Init.TimeSeg1 = CAN_BS1_12TQ;
|
||||
hcan2.Init.TimeSeg2 = CAN_BS2_2TQ;
|
||||
hcan2.Init.TimeTriggeredMode = DISABLE;
|
||||
hcan2.Init.AutoBusOff = DISABLE;
|
||||
hcan2.Init.AutoBusOff = ENABLE;
|
||||
hcan2.Init.AutoWakeUp = DISABLE;
|
||||
hcan2.Init.AutoRetransmission = DISABLE;
|
||||
hcan2.Init.ReceiveFifoLocked = DISABLE;
|
||||
|
|
|
@ -17,18 +17,19 @@
|
|||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "flash.h"
|
||||
#include "main.h"
|
||||
#include "adc.h"
|
||||
#include "can.h"
|
||||
#include "spi.h"
|
||||
#include "tim.h"
|
||||
#include "usart.h"
|
||||
#include "gpio.h"
|
||||
#include <stdbool.h>
|
||||
#include "can_reg.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "flash.h"
|
||||
#include "can_reg.h"
|
||||
#include <stdbool.h>
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -80,7 +81,7 @@ void send_ack(uint8_t status) {
|
|||
uint8_t tx_data[1] = {status};
|
||||
uint32_t tx_mailbox;
|
||||
|
||||
tx_header.ExtId = ACK_CAN_ID; // id = 0x05
|
||||
tx_header.StdId = ACK_CAN_ID; // id = 0x05
|
||||
tx_header.IDE = CAN_ID_STD; //standart id
|
||||
tx_header.RTR = CAN_RTR_DATA; // data frame
|
||||
tx_header.DLC = 1; // data len = 1 byte
|
||||
|
@ -107,11 +108,11 @@ bool verify_firmware() {
|
|||
|
||||
|
||||
void process_can_message(CAN_RxHeaderTypeDef *header, uint8_t *data) {
|
||||
msg_id = header->ExtId;
|
||||
msg_id = header->StdId;
|
||||
/* 0x697
|
||||
69 - slave addr
|
||||
7 || 8 - REG_READ or REG_WRITE */
|
||||
id_x = (msg_id >> 4) & 0xFFFF; // get addr
|
||||
id_x = (msg_id >> 4) & 0xFFF; // get addr
|
||||
msg_ch = msg_id & 0xF; // check cmd
|
||||
|
||||
// Check addr
|
||||
|
@ -144,7 +145,6 @@ void process_can_message(CAN_RxHeaderTypeDef *header, uint8_t *data) {
|
|||
send_ack(0xAA);
|
||||
write_param(firmw, 0); // Reset firmware update
|
||||
fw_update = false;
|
||||
|
||||
HAL_Delay(500);
|
||||
NVIC_SystemReset();
|
||||
} else {
|
||||
|
@ -156,20 +156,33 @@ void process_can_message(CAN_RxHeaderTypeDef *header, uint8_t *data) {
|
|||
}
|
||||
}
|
||||
|
||||
void jump_to_app() {
|
||||
void jump_to_app(void) {
|
||||
HAL_RCC_DeInit();
|
||||
HAL_DeInit();
|
||||
__disable_irq();
|
||||
jump = *(volatile uint32_t*)(APP_ADDRESS + 4);
|
||||
void (*app_entry)(void);
|
||||
app_entry = (void (*)(void))jump;
|
||||
|
||||
uint32_t *app_vector_table = (uint32_t*)APP_ADDRESS;
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < 8; i++) {
|
||||
// RESET ALL Interrupt
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
NVIC->ICER[i] = 0xFFFFFFFF;
|
||||
NVIC->ICPR[i] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
__set_MSP(*(volatile uint32_t*)APP_ADDRESS);
|
||||
// SCB->VTOR = (uint32_t)0x08008004;
|
||||
app_entry();
|
||||
// APP_ADDR
|
||||
__set_MSP(app_vector_table[0]);
|
||||
|
||||
// Point to go
|
||||
uint32_t app_entry = *(app_vector_table + 1); //APP_ADDR + 4
|
||||
void (*application)(void);
|
||||
application = (void (*)(void))app_entry;
|
||||
|
||||
// Go to application
|
||||
application();
|
||||
|
||||
// If we return go to infinity loop
|
||||
while(1);
|
||||
}
|
||||
|
||||
bool is_app_valid() {
|
||||
|
@ -178,11 +191,11 @@ bool is_app_valid() {
|
|||
|
||||
// Check stack pointer
|
||||
bool sp_valid = (app_vector[0] >= 0x20000000) &&
|
||||
(app_vector[0] <= (0x20000000 + 128*1024)); // Для STM32 с 128K RAM
|
||||
(app_vector[0] <= (0x20000000 + 128*1024));
|
||||
|
||||
// check reset_handler
|
||||
bool pc_valid = (app_vector[1] >= 0x08000000) &&
|
||||
(app_vector[1] <= (0x08000000 + 1024*1024)); // Для 1MB Flash
|
||||
(app_vector[1] <= (0x08000000 + 1024*1024));
|
||||
|
||||
// check two words on reset value
|
||||
bool not_erased = (app_vector[0] != 0xFFFFFFFF) &&
|
||||
|
@ -200,29 +213,7 @@ int main(void)
|
|||
{
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
// Настройка GPIO
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;
|
||||
GPIOC->MODER |= GPIO_MODER_MODE10_0 | GPIO_MODER_MODE11_0;
|
||||
GPIOC->ODR &= ~GPIO_ODR_OD11;
|
||||
GPIOC->ODR |= GPIO_ODR_OD10;
|
||||
|
||||
flash_record = load_params();
|
||||
if(flash_record[firmw].value == UPDATE_FLAG) {
|
||||
fw_update = true;
|
||||
for(int i = 0; i < 5;i++){
|
||||
GPIOC->ODR ^= GPIO_ODR_OD10; // Indecate message
|
||||
HAL_Delay(100);
|
||||
}
|
||||
// write_param(firmw,0); //reset flasg
|
||||
erase_flash_pages();
|
||||
}
|
||||
else{
|
||||
// for st-link update, because he doesnt reset flag_update
|
||||
if(is_app_valid()) jump_to_app(); //firmware exist
|
||||
else fw_update = true; //firmware doesnt exist, but we in bootloader
|
||||
}
|
||||
|
||||
GPIOC->ODR |= GPIO_ODR_OD10;
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
|
@ -255,29 +246,82 @@ int main(void)
|
|||
MX_NVIC_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
// Настройка GPIO
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;
|
||||
GPIOC->MODER |= GPIO_MODER_MODE10_0 | GPIO_MODER_MODE11_0;
|
||||
GPIOC->ODR &= ~GPIO_ODR_OD11;
|
||||
GPIOC->ODR |= GPIO_ODR_OD10;
|
||||
|
||||
flash_record = load_params();
|
||||
if(flash_record[firmw].value == UPDATE_FLAG) {
|
||||
fw_update = true;
|
||||
for(int i = 0; i < 5;i++){
|
||||
GPIOC->ODR ^= GPIO_ODR_OD10; // Indecate message
|
||||
HAL_Delay(100);
|
||||
}
|
||||
// write_param(firmw,0); //reset flasg
|
||||
erase_flash_pages();
|
||||
}
|
||||
else{
|
||||
// for st-link update, because he doesnt reset flag_update
|
||||
if(is_app_valid()) jump_to_app(); //firmware exist
|
||||
else fw_update = true; //firmware doesnt exist, but we in bootloader
|
||||
}
|
||||
|
||||
|
||||
CAN_FilterTypeDef can_filter = {
|
||||
.FilterBank = 14, // Bank 14-27 for CAN2
|
||||
.FilterMode = CAN_FILTERMODE_IDMASK,
|
||||
.FilterScale = CAN_FILTERSCALE_32BIT,
|
||||
.FilterIdHigh = 0x0000,
|
||||
.FilterIdLow = 0x0000,
|
||||
.FilterMaskIdHigh = 0x0000,
|
||||
.FilterMaskIdLow = 0x0000,
|
||||
.FilterFIFOAssignment = CAN_RX_FIFO0,
|
||||
.FilterActivation = ENABLE,
|
||||
.SlaveStartFilterBank = 14
|
||||
};
|
||||
|
||||
if (HAL_CAN_ConfigFilter(&hcan2, &can_filter) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_CAN_Start(&hcan2) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
GPIOC->ODR |= GPIO_ODR_OD10;
|
||||
|
||||
// CAN_TxHeaderTypeDef test_header = {
|
||||
// .StdId = 0x123,
|
||||
// .IDE = CAN_ID_STD,
|
||||
// .RTR = CAN_RTR_DATA,
|
||||
// .DLC = 1,
|
||||
// .TransmitGlobalTime = DISABLE
|
||||
// };
|
||||
// uint8_t test_data = 0x55;
|
||||
// uint32_t tx_mailbox;
|
||||
// HAL_CAN_AddTxMessage(&hcan2, &test_header, &test_data, &tx_mailbox);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1) {
|
||||
if(fw_update) {
|
||||
CAN_RxHeaderTypeDef rx_header;
|
||||
uint8_t rx_data[8];
|
||||
HAL_StatusTypeDef status;
|
||||
if (fw_update) {
|
||||
uint32_t rf0r = CAN2->RF0R;
|
||||
|
||||
// Check message
|
||||
if(HAL_CAN_GetRxFifoFillLevel(&hcan2, CAN_RX_FIFO0) > 0) {
|
||||
status = HAL_CAN_GetRxMessage(&hcan2, CAN_RX_FIFO0, &rx_header, rx_data);
|
||||
// Check count of FIFO
|
||||
if ((rf0r & CAN_RF0R_FMP0) > 0) {
|
||||
CAN_RxHeaderTypeDef rx_header;
|
||||
uint8_t rx_data[8];
|
||||
|
||||
if(status == HAL_OK) {
|
||||
// check message IDE standart
|
||||
if(rx_header.IDE == CAN_ID_STD) {
|
||||
process_can_message(&rx_header, rx_data);
|
||||
|
||||
if (HAL_CAN_GetRxMessage(&hcan2, CAN_RX_FIFO0, &rx_header, rx_data) == HAL_OK) {
|
||||
process_can_message(&rx_header, rx_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
HAL_Delay(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
|
@ -285,9 +329,6 @@ int main(void)
|
|||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
|
|
|
@ -97,7 +97,7 @@ LoopFillZerobss:
|
|||
/* Call static constructors */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bl main
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
../Drivers/CMSIS/Include/core_cm4.h:1938:34:__NVIC_SystemReset 1
|
||||
../Core/Src/main.c:78:6:send_ack 1
|
||||
../Core/Src/main.c:102:6:verify_firmware 1
|
||||
../Core/Src/main.c:109:6:process_can_message 8
|
||||
../Core/Src/main.c:79:6:send_ack 1
|
||||
../Core/Src/main.c:103:6:verify_firmware 1
|
||||
../Core/Src/main.c:110:6:process_can_message 8
|
||||
../Core/Src/main.c:159:6:jump_to_app 2
|
||||
../Core/Src/main.c:175:6:is_app_valid 10
|
||||
../Core/Src/main.c:199:5:main 8
|
||||
../Core/Src/main.c:295:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:349:13:MX_NVIC_Init 1
|
||||
../Core/Src/main.c:368:6:HAL_TIM_PeriodElapsedCallback 2
|
||||
../Core/Src/main.c:385:6:Error_Handler 1
|
||||
../Core/Src/main.c:188:6:is_app_valid 10
|
||||
../Core/Src/main.c:212:5:main 9
|
||||
../Core/Src/main.c:336:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:390:13:MX_NVIC_Init 1
|
||||
../Core/Src/main.c:409:6:HAL_TIM_PeriodElapsedCallback 2
|
||||
../Core/Src/main.c:426:6:Error_Handler 1
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/flash.h \
|
||||
Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/main.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h \
|
||||
../Core/Inc/stm32f4xx_hal_conf.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h \
|
||||
../Drivers/CMSIS/Include/core_cm4.h \
|
||||
../Drivers/CMSIS/Include/cmsis_version.h \
|
||||
|
@ -6,12 +11,6 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/flash.h \
|
|||
../Drivers/CMSIS/Include/cmsis_gcc.h \
|
||||
../Drivers/CMSIS/Include/mpu_armv7.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h \
|
||||
../Core/Inc/main.h ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h \
|
||||
../Core/Inc/stm32f4xx_hal_conf.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h \
|
||||
|
@ -33,16 +32,11 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/flash.h \
|
|||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h \
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h \
|
||||
../Core/Inc/adc.h ../Core/Inc/can.h ../Core/Inc/spi.h ../Core/Inc/tim.h \
|
||||
../Core/Inc/usart.h ../Core/Inc/gpio.h ../Core/Inc/can_reg.h
|
||||
../Core/Inc/flash.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h:
|
||||
../Drivers/CMSIS/Include/core_cm4.h:
|
||||
../Drivers/CMSIS/Include/cmsis_version.h:
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h:
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h:
|
||||
../Drivers/CMSIS/Include/mpu_armv7.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h:
|
||||
../Core/Inc/adc.h ../Core/Inc/main.h ../Core/Inc/can.h ../Core/Inc/spi.h \
|
||||
../Core/Inc/tim.h ../Core/Inc/usart.h ../Core/Inc/gpio.h \
|
||||
../Core/Inc/flash.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h \
|
||||
../Core/Inc/can_reg.h
|
||||
../Core/Inc/main.h:
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h:
|
||||
../Core/Inc/stm32f4xx_hal_conf.h:
|
||||
|
@ -50,6 +44,12 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/flash.h \
|
|||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h:
|
||||
../Drivers/CMSIS/Include/core_cm4.h:
|
||||
../Drivers/CMSIS/Include/cmsis_version.h:
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h:
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h:
|
||||
../Drivers/CMSIS/Include/mpu_armv7.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h:
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h:
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:
|
||||
|
@ -72,9 +72,12 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/flash.h \
|
|||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:
|
||||
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h:
|
||||
../Core/Inc/adc.h:
|
||||
../Core/Inc/main.h:
|
||||
../Core/Inc/can.h:
|
||||
../Core/Inc/spi.h:
|
||||
../Core/Inc/tim.h:
|
||||
../Core/Inc/usart.h:
|
||||
../Core/Inc/gpio.h:
|
||||
../Core/Inc/flash.h:
|
||||
../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h:
|
||||
../Core/Inc/can_reg.h:
|
||||
|
|
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
../Drivers/CMSIS/Include/core_cm4.h:1938:34:__NVIC_SystemReset 4 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:78:6:send_ack 56 static
|
||||
../Core/Src/main.c:102:6:verify_firmware 16 static
|
||||
../Core/Src/main.c:109:6:process_can_message 24 static
|
||||
../Core/Src/main.c:159:6:jump_to_app 24 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:175:6:is_app_valid 16 static
|
||||
../Core/Src/main.c:199:5:main 56 static
|
||||
../Core/Src/main.c:295:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:349:13:MX_NVIC_Init 8 static
|
||||
../Core/Src/main.c:368:6:HAL_TIM_PeriodElapsedCallback 16 static
|
||||
../Core/Src/main.c:385:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:79:6:send_ack 56 static
|
||||
../Core/Src/main.c:103:6:verify_firmware 16 static
|
||||
../Core/Src/main.c:110:6:process_can_message 24 static
|
||||
../Core/Src/main.c:159:6:jump_to_app 32 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:188:6:is_app_valid 16 static
|
||||
../Core/Src/main.c:212:5:main 104 static
|
||||
../Core/Src/main.c:336:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:390:13:MX_NVIC_Init 8 static
|
||||
../Core/Src/main.c:409:6:HAL_TIM_PeriodElapsedCallback 16 static
|
||||
../Core/Src/main.c:426:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -45,7 +45,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
|
|||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
|
||||
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K - 32K
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
|
|
|
@ -16,12 +16,13 @@ ADC2.SamplingTime-6\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
|
|||
CAD.formats=
|
||||
CAD.pinconfig=
|
||||
CAD.provider=
|
||||
CAN2.ABOM=ENABLE
|
||||
CAN2.BS1=CAN_BS1_12TQ
|
||||
CAN2.BS2=CAN_BS2_2TQ
|
||||
CAN2.CalculateBaudRate=1000000
|
||||
CAN2.CalculateTimeBit=999
|
||||
CAN2.CalculateTimeBit=1000
|
||||
CAN2.CalculateTimeQuantum=66.66666666666666
|
||||
CAN2.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,Prescaler,BS1,BS2
|
||||
CAN2.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,Prescaler,BS1,BS2,ABOM
|
||||
CAN2.Prescaler=3
|
||||
File.Version=6
|
||||
GPIO.groupedBy=Group By Peripherals
|
||||
|
@ -215,7 +216,7 @@ ProjectManager.ToolChainLocation=
|
|||
ProjectManager.UAScriptAfterPath=
|
||||
ProjectManager.UAScriptBeforePath=
|
||||
ProjectManager.UnderRoot=true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_TIM1_Init-TIM1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_SPI2_Init-SPI2-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_ADC2_Init-ADC2-false-HAL-true,8-MX_TIM5_Init-TIM5-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_TIM1_Init-TIM1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_SPI2_Init-SPI2-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_ADC2_Init-ADC2-false-HAL-true,8-MX_TIM5_Init-TIM5-false-HAL-true,9-MX_CAN2_Init-CAN2-false-HAL-true
|
||||
RCC.AHBFreq_Value=180000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||
RCC.APB1Freq_Value=45000000
|
||||
|
|
83
controller/fw/bootloader/bootloader_.launch
Normal file
83
controller/fw/bootloader/bootloader_.launch
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.cubeprog_external_loaders" value="[]"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_certif_path" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_check_enable" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_key_path" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.debug_auth_permission" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"Debug/bootloader_.elf","fProjectName":"bootloader_","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="180000000"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_signal_halt" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="D:\library_stmcubeide\wwork_2\servo\controller\fw\bootloader\Debug\st-link_gdbserver_log.txt"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverPort" value="cortex_m0"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyPort" value="60000"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/bootloader_.elf"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bootloader_"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1393514460"/>
|
||||
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/bootloader_"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"/>
|
||||
<stringAttribute key="process_factory_id" value="com.st.stm32cube.ide.mcu.debug.launch.HardwareDebugProcessFactory"/>
|
||||
</launchConfiguration>
|
Loading…
Add table
Add a link
Reference in a new issue