From 212d1cd684d7e8922b20c97277f2339d29276372 Mon Sep 17 00:00:00 2001 From: Tenocha Date: Wed, 20 Nov 2024 11:33:59 +0300 Subject: [PATCH] Separating the project from the legacy of bootloader --- ...r.ioc => CAN_Request-Response_protocol.ioc | 16 +- Core/Inc/boot_project_setup.h | 36 - Core/Inc/custom_flash.h | 9 - Core/Inc/custom_receive_and_write.h | 20 - Core/Inc/custom_usart.h | 20 - Core/Inc/main.h | 1 - Core/Src/bootloader.c | 614 -------------- Core/Src/custom_flash.c | 94 --- Core/Src/custom_receive_and_write.c | 105 --- Core/Src/custom_usart.c | 125 --- Core/Src/main.c | 15 +- Core/Src/stm32f1xx_it.c | 6 +- MDK-ARM/CAN_Request-Response_protocol.uvoptx | 752 ++++++++++++++++++ MDK-ARM/CAN_Request-Response_protocol.uvprojx | 650 +++++++++++++++ .../CAN_Request-Response_protocol.sct | 19 + ...esponse_protocol_STM32F103RG_1.0.0.dbgconf | 36 + ...esponse_protocol_STM32F103RG_1.0.0.dbgconf | 36 + .../RTE_Components.h | 21 + .../RTE_Components.h | 21 + MDK-ARM/stm32f103rgtx_bootloader.uvoptx | 120 +-- MDK-ARM/stm32f103rgtx_bootloader.uvprojx | 19 +- 21 files changed, 1589 insertions(+), 1146 deletions(-) rename stm32f103rgtx_bootloader.ioc => CAN_Request-Response_protocol.ioc (96%) delete mode 100644 Core/Inc/boot_project_setup.h delete mode 100644 Core/Inc/custom_flash.h delete mode 100644 Core/Inc/custom_receive_and_write.h delete mode 100644 Core/Inc/custom_usart.h delete mode 100644 Core/Src/bootloader.c delete mode 100644 Core/Src/custom_flash.c delete mode 100644 Core/Src/custom_receive_and_write.c delete mode 100644 Core/Src/custom_usart.c create mode 100644 MDK-ARM/CAN_Request-Response_protocol.uvoptx create mode 100644 MDK-ARM/CAN_Request-Response_protocol.uvprojx create mode 100644 MDK-ARM/CAN_Request-Response_protocol/CAN_Request-Response_protocol.sct create mode 100644 MDK-ARM/DebugConfig/CAN_Request-Response_protocol_STM32F103RG_1.0.0.dbgconf create mode 100644 MDK-ARM/DebugConfig/stm32f103rgtx_CAN_Request_Response_protocol_STM32F103RG_1.0.0.dbgconf create mode 100644 MDK-ARM/RTE/_CAN_Request-Response_protocol/RTE_Components.h create mode 100644 MDK-ARM/RTE/_stm32f103rgtx_CAN_Request_Response_protocol/RTE_Components.h diff --git a/stm32f103rgtx_bootloader.ioc b/CAN_Request-Response_protocol.ioc similarity index 96% rename from stm32f103rgtx_bootloader.ioc rename to CAN_Request-Response_protocol.ioc index e942510..d76302b 100644 --- a/stm32f103rgtx_bootloader.ioc +++ b/CAN_Request-Response_protocol.ioc @@ -5,12 +5,12 @@ CAD.provider= CAN.ABOM=ENABLE CAN.BS1=CAN_BS1_13TQ CAN.BS2=CAN_BS2_2TQ -CAN.CalculateBaudRate=50000 -CAN.CalculateTimeBit=20000 -CAN.CalculateTimeQuantum=1250.0 +CAN.CalculateBaudRate=1000000 +CAN.CalculateTimeBit=1000 +CAN.CalculateTimeQuantum=62.5 CAN.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,Prescaler,BS2,BS1,SJW,ABOM,TXFP,Mode CAN.Mode=CAN_MODE_LOOPBACK -CAN.Prescaler=40 +CAN.Prescaler=2 CAN.SJW=CAN_SJW_1TQ CAN.TXFP=ENABLE Dma.Request0=SDIO @@ -169,8 +169,8 @@ ProjectManager.MainLocation=Core/Src ProjectManager.NoMain=false ProjectManager.PreviousToolchain= ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=stm32f103rgtx_bootloader.ioc -ProjectManager.ProjectName=stm32f103rgtx_bootloader +ProjectManager.ProjectFileName=CAN_Request-Response_protocol.ioc +ProjectManager.ProjectName=CAN_Request-Response_protocol ProjectManager.ProjectStructure= ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 @@ -209,8 +209,8 @@ RTC.IPParameters=Format,AutoPrediv SDIO.ClockDiv=4 SDIO.IPParameters=ClockDiv TIM7.IPParameters=Prescaler,Period -TIM7.Period=3000 -TIM7.Prescaler=8000-1 +TIM7.Period=1000 +TIM7.Prescaler=64000-1 USART3.BaudRate=9600*2 USART3.IPParameters=VirtualMode,BaudRate USART3.VirtualMode=VM_ASYNC diff --git a/Core/Inc/boot_project_setup.h b/Core/Inc/boot_project_setup.h deleted file mode 100644 index 5ee3e05..0000000 --- a/Core/Inc/boot_project_setup.h +++ /dev/null @@ -1,36 +0,0 @@ -// BOOTLOADER defines - -// RCC defines -#define __RCC_UART_BOOT_CLK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() -#define __RCC_UART_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() -#define __RCC_DMA_UART_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() -#define __RCC_DMA_SDIO_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE() -#define __RCC_TIM_BOOT_CLK_ENABLE() __HAL_RCC_TIM7_CLK_ENABLE() - - -// USART defines -#define UART_BOOT USART3 // usart -#define UART_SPEED 256000 -#define UART_BOOT_IRQn USART3_IRQn - -#define UART_PORT GPIOB // usart port -#define UART_PIN_TX GPIO_PIN_10 -#define UART_PIN_RX GPIO_PIN_11 - - -// DMA defines -#define DMA_UART_Channel DMA1_Channel3 -#define DMA_SDIO_Channel DMA2_Channel4 -#define DMA_UART_IRQn DMA1_Channel3_IRQn -#define DMA_SDIO_IRQn DMA2_Channel4_5_IRQn - -// TIM defines -#define TIM_BOOT TIM7 -#define TIM_BOOT_Prescaler 64000 // set up for 1 tick - 1 ms (no decrement needed) -#define TIM_BOOT_IRQn TIM7_IRQn - -// SDIO defines -#define SDIO_SDCard_In_PORT GPIOB -#define SDIO_SDCard_In_PIN GPIO_PIN_5 -#define SDIO_SDCard_In_IRQn EXTI9_5_IRQn - diff --git a/Core/Inc/custom_flash.h b/Core/Inc/custom_flash.h deleted file mode 100644 index 54a75d5..0000000 --- a/Core/Inc/custom_flash.h +++ /dev/null @@ -1,9 +0,0 @@ -#include "main.h" - -#define PAGE_SIZE 2048 - - -HAL_StatusTypeDef FLASH_Write_Page(uint32_t *Address, uint8_t *Data, int Data_size); -HAL_StatusTypeDef FLASH_Write_Word(uint32_t Address, uint64_t Data); -HAL_StatusTypeDef FLASH_Erase_App(void); -uint8_t *FLASH_Read(uint32_t add); diff --git a/Core/Inc/custom_receive_and_write.h b/Core/Inc/custom_receive_and_write.h deleted file mode 100644 index 05534ba..0000000 --- a/Core/Inc/custom_receive_and_write.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "main.h" -#include "ff.h" - -//#include "usart.h" -#define sizebuff 16 -struct flags -{ - unsigned writting:1; -}; - -extern struct flags flags_UART_FATFS; - -FRESULT CreateAndOpenMessageFile(FIL *MessageFile, const TCHAR* path); -FRESULT OpenMessageFile(FIL *MessageFile, const TCHAR* path); -FRESULT WriteMessage(FIL *MessageFile, char *Message, UINT SizeOfMessage); -FRESULT CloseMessageFile(FIL *MessageFile); -void WriteFile(char *Data, int Num_of_Data); - -void Check_USART(void); - diff --git a/Core/Inc/custom_usart.h b/Core/Inc/custom_usart.h deleted file mode 100644 index 4960370..0000000 --- a/Core/Inc/custom_usart.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "main.h" - -#define __USER_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \ - do{ \ - (__HANDLE__)->__PPP_DMA_FIELD__ = (__DMA_HANDLE__); \ - (__DMA_HANDLE__)->Parent = (__HANDLE__);} while(0U) - -struct UARTSettings -{ - USART_TypeDef *UARTx; - uint32_t UART_Speed; - GPIO_TypeDef *GPIOx; - uint16_t GPIO_PIN_RX; - uint16_t GPIO_PIN_TX; - DMA_Channel_TypeDef *DMAChannel; // DMAChannel = 0 if doesnt need -}; - -void User_UART_Init(UART_HandleTypeDef* huart, DMA_HandleTypeDef *DMAhuart, struct UARTSettings *uuart); -void UART_GPIO_Init(GPIO_TypeDef *GPIOx, uint16_t GPIO_PIN_RX, uint16_t GPIO_PIN_TX); -void UART_DMA_Init(UART_HandleTypeDef *huart, DMA_HandleTypeDef *hdma_rx, DMA_Channel_TypeDef *DMAhuart); diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 0ff4316..e865791 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -31,7 +31,6 @@ extern "C" { /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "boot_project_setup.h" #include "requester.h" /* USER CODE END Includes */ diff --git a/Core/Src/bootloader.c b/Core/Src/bootloader.c deleted file mode 100644 index acc9cd7..0000000 --- a/Core/Src/bootloader.c +++ /dev/null @@ -1,614 +0,0 @@ -#include "bootloader.h" -#include "custom_receive_and_write.h" - -extern FLASH_EraseInitTypeDef EraseInitStruct; - -struct flag FLAGS; -struct Bootloader_Errors_Counters BOOTLOADER_ERRORS_COUNTERS; -struct Bootloader_Errors BOOTLOADER_ERRORS; - -uint32_t app_current_add; // address for writing pages -int cnt_tim_reset = 0; // WD Tim counter - - -uint8_t ReceiveDataUART[4]; // buffer for CMD -uint8_t Data2Write[PAGE_SIZE*2]; // DMA buffer for application -uint8_t CAN_Data[8]; - - -CAN_TxHeaderTypeDef TxHeader; -CAN_RxHeaderTypeDef RxHeader; -uint32_t TxMailBox = 0; // num of used mail - - -extern UART_HandleTypeDef huart_boot; // uart handler for boot uart -extern DMA_HandleTypeDef hdma_usart_boot_rx; // dma handler for boot uart -struct UARTSettings UARTSet; // settings for uart - -void Bootloader_Init(void) -{ - HAL_Init(); - Boot_SystemClock_Config(); - MX_DMA_Init(); - //Если используется ЮСАРТ - инициализация -#ifdef __USART_H__ - - UARTSet.UARTx = UART_BOOT; - UARTSet.UART_Speed = UART_SPEED; - UARTSet.GPIOx = UART_PORT; - UARTSet.GPIO_PIN_RX = UART_PIN_RX; - UARTSet.GPIO_PIN_TX = UART_PIN_TX; - UARTSet.DMAChannel = DMA_UART_Channel; - - User_UART_Init(&huart_boot, &hdma_usart_boot_rx, &UARTSet); -#endif - - //Если используется SD-карта - инициализация -#ifdef __SDIO_H__ - BSP_SD_ITConfig(); -#endif - -#ifdef __CAN_H__ - MX_CAN_Init(); -#endif - - //Инициализация светодиодов - MX_GPIO_Init(); - MX_TIM7_Init(); -} - -HAL_StatusTypeDef res_hal; -void Bootloader_main(void) // main function, that defines bootloader behaviour -{ - /* - // Настройка доступной переферии с помощью define - Bootloader_Init(); - */ - - /* START APPLICATION */ - if (ReadKey() == BL_KEY_APP_WRITTEN) - { - // jump to main app - //Задаётся адрес программы со смещением от начала вектора прерываний - uint32_t app_jump_adr; - app_jump_adr=*((volatile uint32_t*)(MAIN_APP_START_ADR+4)); - void(*GoToApp)(void); - - //Деинициализация HAL - HAL_DeInit(); - - GoToApp = (void (*) (void)) app_jump_adr; - //Перенос вектора прерываний на начало зашитой программы - __disable_irq(); - __set_MSP(*((volatile uint32_t*)MAIN_APP_START_ADR)); - __enable_irq(); - //Переход к выполнению зашитой программы - GoToApp(); - } - else /* START PROGRAMMING MCU */ - { - /* MCU Configuration for bootloader-------------------------------------------*/ - /* Reset of all peripherals, Initializes the Flash BootloaderCMD and the Systick. */ - Bootloader_Init(); - FLAGS.InitOrWait = 0; - - // waif for commant for programming - do{ - res_hal=HAL_UART_Receive_IT(&huart_boot, ReceiveDataUART, sizeof(ReceiveDataUART)); - if(res_hal!=HAL_OK){ - BOOTLOADER_ERRORS_COUNTERS.USART_RECEIVE++; - BOOTLOADER_ERRORS.USART_RECEIVE=1; - } - }while(res_hal!=HAL_OK); // if usart err - try start receive again - - HAL_CAN_Start(&hcan); - HAL_CAN_ActivateNotification(&hcan, CAN_IT_RX_FIFO0_MSG_PENDING); - -CAN_FilterTypeDef canFilterConfig; -canFilterConfig.FilterBank = 0; -canFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK; -canFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT; -canFilterConfig.FilterIdHigh = 0x0000; -canFilterConfig.FilterIdLow = 0x0000; -canFilterConfig.FilterMaskIdHigh = 0x0000; -canFilterConfig.FilterMaskIdLow = 0x0000; -canFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0; -canFilterConfig.FilterActivation = ENABLE; -canFilterConfig.SlaveStartFilterBank = 14; -HAL_CAN_ConfigFilter(&hcan, &canFilterConfig); - -// FLAGS.StartInit=1; -// FLAGS.reInitMCU=1; -// FLAGS.BootloaderCMD = 2; - app_current_add = MAIN_APP_START_ADR; -// HAL_CAN_Start(&hcan); - /* Infinite loop */ - while (1) - { -// HAL_Delay(10); -// HAL_UART_Transmit(&huart_boot, (uint8_t *)"000000", 6, HAL_MAX_DELAY); - - // choose interface for programming - if (FLAGS.StartInit) - { - - - if (FLAGS.reInitMCU) // if its reInit request - erase outdate app - { - GPIOB->ODR^=0x2000; - res_hal=FLASH_Erase_App(); - if(res_hal!=HAL_OK) - { - FLAGS.StartInit=1; - - BOOTLOADER_ERRORS.FLASH_ERASE = 1; - continue; - } - BOOTLOADER_ERRORS.FLASH_ERASE = 0; - GPIOB->ODR^=0x2000; - FLAGS.reInitMCU = 0; - } - FLAGS.StartInit = 0; - - HAL_UART_AbortReceive_IT(&huart_boot); - HAL_CAN_Stop(&hcan); - HAL_CAN_DeactivateNotification(&hcan, CAN_IT_RX_FIFO0_MSG_PENDING); - - switch ((int)FLAGS.BootloaderCMD) - { - // UART - #ifdef __USART_H__ - case 1:/* UART */ - FLAGS.InitBootPeriph = 1; - // start receiving app.bin - res_hal = HAL_UART_Receive_DMA(&huart_boot, Data2Write, PAGE_SIZE*2); - if(res_hal!=HAL_OK) - { - FLAGS.StartInit=1; - BOOTLOADER_ERRORS_COUNTERS.USART_RECEIVE++; - BOOTLOADER_ERRORS.USART_RECEIVE = 1; - break; - } - // code of writing app in flash in callbacks functions: - // HAL_UART_RxHalfCpltCallback and HAL_UART_RxCpltCallback - break; - #endif - - #ifdef __CAN_H__ - // CAN - case 2: /* CAN */ - // activate can and start receiving app.bin - FLAGS.InitOrWait=1; - res_hal = HAL_CAN_Start(&hcan); - res_hal = HAL_CAN_ActivateNotification(&hcan, CAN_IT_RX_FIFO0_MSG_PENDING | CAN_IT_ERROR | CAN_IT_BUSOFF | CAN_IT_LAST_ERROR_CODE); - // code of writing app in flash in callback functions: - // HAL_CAN_RxFifo0MsgPendingCallback - break; - #endif - - // SD - #ifdef __SDIO_H__ - case 3: /* SD */ - if (FLAGS.SDCardIn==0) // wait for sd-card - { - FLAGS.StartInit=1; // if there is no card, exit programmator and go in again - BOOTLOADER_ERRORS.SD_CARD_NOT_INSERTED = 1; - //Ошибка SD карты. Начать приём новой cmd - break; - } - HAL_Delay(100); // wait for inputting SD Card - if (FLAGS.SDCardIn==0) - { - FLAGS.StartInit=1; - BOOTLOADER_ERRORS.SD_CARD_NOT_INSERTED = 1; - break; - } - - FRESULT res_fresult; - SD_Programming(&res_fresult, &res_hal); // programming from sd card - // res_fresual - status for sd card read // res_hal - status for flash write - //Если всё удачно - выполнить код ниже. Если нет - StartInit = 1, break - if(res_fresult!=FR_OK || res_hal!=HAL_OK) - { - FLAGS.StartInit=1; - - if(res_fresult!=FR_OK){ - BOOTLOADER_ERRORS_COUNTERS.SD_CARD_READ++; - BOOTLOADER_ERRORS.SD_CARD_READ = 1; - } - if(res_hal!=HAL_OK){ - BOOTLOADER_ERRORS_COUNTERS.FLASH_WRITE++; - BOOTLOADER_ERRORS.FLASH_WRITE = 1; - } - break; - } - // write Key: application in Flash, and reset MCU - { - ResetKey(); - SetKey(); - NVIC_SystemReset(); - }// reset mcu - break; - #endif - - default: // if command is incorrect - wait CMD - BOOTLOADER_ERRORS_COUNTERS.CMD_INVALID++; // uncorrect command - BOOTLOADER_ERRORS.CMD_INVALID=1; - do - { - res_hal=HAL_UART_Receive_IT(&huart_boot, ReceiveDataUART, sizeof(ReceiveDataUART)); - if(res_hal!=HAL_OK){ - BOOTLOADER_ERRORS_COUNTERS.USART_RECEIVE++; // err when initialize uart - BOOTLOADER_ERRORS.USART_RECEIVE=1;} - }while(res_hal!=HAL_OK); - HAL_CAN_Start(&hcan); - HAL_CAN_ActivateNotification(&hcan, CAN_IT_RX_FIFO0_MSG_PENDING); - } - } - -// TxHeader.StdId = 0x200; // ID OF MESSAGE -// TxHeader.ExtId = 0; // STANDART FRAME (NOT EXTENTED) -// TxHeader.RTR = CAN_RTR_DATA; // TRANSMIT DATA OR -// TxHeader.IDE = CAN_ID_STD; // STANDART FRAME -// TxHeader.DLC = 8; // DATA SIZE -// TxHeader.TransmitGlobalTime = DISABLE; //THIS MODE IS NOT USED, SO DISABLE -// uint8_t asd[8] = "ABCDEFGL"; -// while(HAL_CAN_GetTxMailboxesFreeLevel(&hcan) == 0); // wait for free mail box -// res_hal = HAL_CAN_AddTxMessage(&hcan, &TxHeader, asd, &TxMailBox); // add to mail for transmit -// HAL_Delay(1000); - - - } - } -} - - - - -void SD_Programming(FRESULT *res_fresult, HAL_StatusTypeDef *res_hal) -{ - // init peripth - MX_FATFS_Init(); - MX_SDIO_SD_Init(); - FIL MFile; - int SizeApp; - int AppCount; - - // mount disk - uint8_t MOUNT=1; - *res_fresult = f_mount(&SDFatFS, (TCHAR const*)SDPath, 1); - if(*res_fresult != FR_OK) return; - - // name of the application file - static char path[8] = "app.bin"; - path[7] = '\0'; - - - // OPEN AND READ - *res_fresult = f_open(&MFile, (const TCHAR*)path, FA_READ); - if (*res_fresult == FR_OK) - { - SizeApp = MFile.fsize; - AppCount = 0; // counter of written bytes - - - unsigned int bytesRead; - // reading and writing two pages - while(SizeApp - AppCount >= PAGE_SIZE*2) // read while count of rest bytes more than size of two pages - { - *res_fresult = f_read(&MFile, Data2Write, PAGE_SIZE*2, &bytesRead); - - if(*res_fresult != FR_OK) return; - - AppCount += PAGE_SIZE*2; - - *res_hal = FLASH_Write_Page(&app_current_add, Data2Write, PAGE_SIZE*2); - - if(*res_hal != HAL_OK) return; - - GPIOB->ODR^=0x2000; // indicate written two pages - } - // reading and writing rest bytes (less than two pages) - if(SizeApp != AppCount) - { - int NumOfLastBytes = SizeApp - AppCount; - - *res_fresult = f_read(&MFile, Data2Write, NumOfLastBytes, &bytesRead); - - if(*res_fresult != FR_OK) return; - - AppCount += PAGE_SIZE*2; - - *res_hal = FLASH_Write_Page(&app_current_add, Data2Write, NumOfLastBytes); - - if(*res_hal != HAL_OK) return; - - GPIOB->ODR^=0x2000; - } - - *res_fresult = f_close(&MFile); // indicate written two pages - } -} - -void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart) // writing first half of dma buffer (1 page) -{ - if (huart->Instance == UART_BOOT) - { - if (FLAGS.InitOrWait) - { - HAL_StatusTypeDef res_hal; - - if (FLAGS.InitBootPeriph) // if its first received page - { - //HAL_TIM_Base_Start_IT(&htim_boot); // start "wd" timer - FLAGS.InitBootPeriph = 0; // 5 sec silent on RX - mcu reset - } - - res_hal = FLASH_Write_Page(&app_current_add, Data2Write, PAGE_SIZE); - if (res_hal != HAL_OK) - { - BOOTLOADER_ERRORS_COUNTERS.FLASH_WRITE++; // err when initialize uart - BOOTLOADER_ERRORS.FLASH_WRITE=1; - } - // HAL_UART_DMAStop(&huart_boot); - // HAL_UART_AbortReceive_IT(&huart_boot); - // HAL_UART_AbortReceive(&huart_boot); - - FLAGS.HalfOfWrite = 1; // switch unwritten half of DMA buffer - - cnt_tim_reset = 0; // upd WD Tim - GPIOB->ODR^=0x2000; // indicate written page - } - } -} - -void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) // writing second half of dma buffer (1 page) -{ -if (huart->Instance == UART_BOOT) -{ - if (FLAGS.InitOrWait == 0) // if its wait mode (not writting app) - { - // set Init mode, start WDTim after receiving first page - Check_CMD_USART(ReceiveDataUART); // check received uart data - FLAGS.InitOrWait = 1; - FLAGS.StartInit = 1; - FLAGS.InitBootPeriph = 1; - app_current_add = MAIN_APP_START_ADR; // set adress for app - } - else - { - HAL_StatusTypeDef res_hal; - res_hal = FLASH_Write_Page(&app_current_add, Data2Write+PAGE_SIZE, PAGE_SIZE); - if (res_hal != HAL_OK) - { - BOOTLOADER_ERRORS_COUNTERS.FLASH_WRITE++; // err when initialize uart - BOOTLOADER_ERRORS.FLASH_WRITE=1; - } - - FLAGS.HalfOfWrite = 0; // switch unwritten half of DMA buffer - - cnt_tim_reset = 0; // upd WD Tim - GPIOB->ODR^=0x2000; // indicate written page - } -} -} - - -uint32_t temp_app_cur_add; -int app_size; -/*void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) -{ - - if(HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &RxHeader, CAN_Data) == HAL_OK) - { -#ifdef _CAN_PUSH_ID_TO_ADDR_ - if(FLAGS.InitOrWait) - { // if its 1 - Init: writting app.bin in flash - temp_app_cur_add = app_current_add+(RxHeader.ExtId&(0x0000FFFF)); - - FLASH_Write_Page(&temp_app_cur_add, CAN_Data, 8); - app_size-=8; // decrease app_size - if (app_size<=0) // when its gone - reset system and go to the app - { - __ASM(""); - NVIC_SystemReset(); - } - } - else - { // if its 0 - Wait: parsing address to writting and size of app.bin - app_current_add = Data2Write[0]<<24 | Data2Write[1]<<16 | Data2Write[2]<<8 | Data2Write[3]; - app_size = Data2Write[4]<<24 | Data2Write[5]<<16 | Data2Write[6]<<8 | Data2Write[7]; - FLAGS.InitOrWait = 1; // switch to firmware (init) - } -#endif - if(FLAGS.InitOrWait) - { - if (FLAGS.InitBootPeriph) // if its first received page - { - HAL_TIM_Base_Start_IT(&htim_boot); // start "wd" timer - FLAGS.InitBootPeriph = 0; // 5 sec silent on RX - mcu reset - } - FLASH_Write_Page(&app_current_add, CAN_Data, 8); - cnt_tim_reset=0; - } - else - { - - app_current_add = MAIN_APP_START_ADR; // set adress for app - Check_CMD_USART(CAN_Data); - FLAGS.InitBootPeriph=1; - FLAGS.InitOrWait = 1; - FLAGS.StartInit = 1; - } - } -} - -*/ -void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan) -{ - uint32_t er; - er = HAL_CAN_GetError(hcan); - __ASM(""); -} -void Bootloader_TIM_Handler(void) // reset mcu after writing application is done -{ // add this to the TIM handler that is used (TIMx is seting up in project_setup.h) - HAL_StatusTypeDef res_fresult; - cnt_tim_reset++; - if (cnt_tim_reset > 5) // writing is done if there is silence on Rx for 5 second - { - if(FLAGS.BootloaderCMD==1) - { - FLAGS.InitMCUReady = 1; - ResetKey(); - SetKey(); // write key for going to application - int NumOfLastBytes = (PAGE_SIZE - DMA1_Channel3->CNDTR%PAGE_SIZE); // read size of new data in dma buffer - if (NumOfLastBytes != 0) - { - res_fresult = FLASH_Write_Page(&app_current_add, Data2Write+PAGE_SIZE*FLAGS.HalfOfWrite, NumOfLastBytes); // writing last data - } - NVIC_SystemReset(); // reset mcu - } - else if(FLAGS.BootloaderCMD==2) - { - FLAGS.InitMCUReady = 1; - ResetKey(); - SetKey(); - NVIC_SystemReset(); - } - } -} - - -void Check_CMD_USART(uint8_t *DataUART) // choose CMD (interface) -{ // 4 byte: 0xFF - erase app, else - just write app - //USART - if ((DataUART[0]| - DataUART[1]<<8| - DataUART[2]<<16) == 0xFFFFFF) - { - FLAGS.BootloaderCMD = 1; - } - //CAN - else if ((DataUART[0]| - DataUART[1]<<8| - DataUART[2]<<16) == 0xAAAFFF) - { - FLAGS.BootloaderCMD = 2; - } - //SDIO - else if ((DataUART[0]| - DataUART[1]<<8| - DataUART[2]<<16) == 0xAAFAFF) - { - FLAGS.BootloaderCMD = 3; - BSP_SD_DetectIT(); - } - if (DataUART[3]== 0xFF) - { - FLAGS.reInitMCU = 1; - } - else - { - FLAGS.reInitMCU = 0; - } - -} - - - - -// reset/set key function -void SetKey(void) -{ - HAL_FLASH_Unlock(); - - HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, BOOTLOADER_KEY_ADR, BL_KEY_APP_WRITTEN); - - HAL_FLASH_Lock(); -} - -uint32_t ReadKey(void) -{ - return (*(__IO uint32_t*)BOOTLOADER_KEY_ADR); -} - -void ResetKey(void) -{ - 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(); - -} - - -HAL_StatusTypeDef BSP_SD_ITConfig(void) -{ - /* Code to be updated by the user or replaced by one from the FW pack (in a stmxxxx_sd.c file) */ - GPIO_InitTypeDef gpio_init_structure; - - /* Configure Interrupt mode for SD detection pin */ - gpio_init_structure.Pin = SDIO_SDCard_In_PIN; - gpio_init_structure.Pull = GPIO_PULLUP; - gpio_init_structure.Speed = GPIO_SPEED_HIGH; - gpio_init_structure.Mode = GPIO_MODE_IT_RISING_FALLING; - HAL_GPIO_Init(SDIO_SDCard_In_PORT, &gpio_init_structure); - - /* Enable and set SD detect EXTI Interrupt to the lowest priority */ - HAL_NVIC_SetPriority((SDIO_SDCard_In_IRQn), 0x00, 0x00); - HAL_NVIC_EnableIRQ((SDIO_SDCard_In_IRQn)); - - return HAL_OK; -// return (uint8_t)0; -} - - -void BSP_SD_DetectIT(void) -{ // add this to the EXTI handler that is used (EXTIx (GPIO_PIN_x) is seting up in project_setup.h) - - if(SDIO_SDCard_In_PORT->IDR&SDIO_SDCard_In_PIN) - FLAGS.SDCardIn = 0; - else - FLAGS.SDCardIn = 1; -} - - -void Boot_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_MUL16; - 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_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) - { - Error_Handler(); - } - HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_1); -} \ No newline at end of file diff --git a/Core/Src/custom_flash.c b/Core/Src/custom_flash.c deleted file mode 100644 index 75a3946..0000000 --- a/Core/Src/custom_flash.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "custom_flash.h" -#include "bootloader.h" -FLASH_EraseInitTypeDef EraseInitStruct; -//uint32_t PAGE_OFFSET = ((uint32_t)((4-1) * 0x0400)); -uint32_t PAGE_NUMB = 127; - - - - -uint8_t *FLASH_Read(uint32_t add) -{ - return (uint8_t *)add; -} - -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; -} -uint32_t word_data; - - - - -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_Erase_App(void) // -{ - HAL_StatusTypeDef res; - uint32_t PageError = 0x00; - - res = HAL_FLASH_Unlock(); - - if (res != HAL_OK) return res; - - 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; -} diff --git a/Core/Src/custom_receive_and_write.c b/Core/Src/custom_receive_and_write.c deleted file mode 100644 index 40fa401..0000000 --- a/Core/Src/custom_receive_and_write.c +++ /dev/null @@ -1,105 +0,0 @@ -#include "custom_receive_and_write.h" -extern UART_HandleTypeDef huart3; -struct flags flags_UART_FATFS; -extern FIL SDFile; -uint8_t bytescnt; -char Char_Shift = 0x41; -FIL MFile; - -uint8_t Message[sizebuff] = ""; - -uint8_t path_uart[5] = "A.txt"; - - -//void MountSD(void) -//{ -// if((f_mount(&SDFatFS, (TCHAR const*)SDPath, MOUNT)) ==FR_OK) -// { -// for (int i=0;i<5;i++) -// { -// GPIOB->ODR^=1<<14; -// HAL_Delay(500); -// } -// GPIOB->ODR&=~(1<<14); \ -// } -//} - -FRESULT CreateAndOpenMessageFile(FIL *MessageFile, const TCHAR* Path) -{ - return f_open(MessageFile, Path, FA_WRITE | FA_CREATE_ALWAYS); -} - -FRESULT OpenMessageFile(FIL *MessageFile, const TCHAR* Path) -{ - return f_open(MessageFile, Path, FA_READ); -} - -FRESULT WriteMessage(FIL *MessageFile, char *Message, UINT SizeOfMessage) -{ - FRESULT ResultOfOperation; - uint32_t WrittenBytes; - ResultOfOperation = f_lseek(MessageFile,f_size(MessageFile)); - ResultOfOperation = f_write(MessageFile, Message, SizeOfMessage, &WrittenBytes); - if (WrittenBytes!=SizeOfMessage) return FR_INVALID_PARAMETER; - //GPIOB->ODR^=0xf000; - return ResultOfOperation; -} - -FRESULT CloseMessageFile(FIL *MessageFile) -{ - return f_close(MessageFile); -} - -void WriteFile(char *Data, int Num_of_Data) -{ - static int FileOpen = 0; - OpenMessageFile(&MFile, (const TCHAR*)path_uart); - WriteMessage(&MFile, Data, Num_of_Data); - CloseMessageFile(&MFile); -// Char_Shift++; -// path_uart[0] = (char)Char_Shift; -} - -void Check_USART(void) -{ - uint8_t res; - - static FIL MessageFile; - - if (flags_UART_FATFS.writting==0) - { switch((int)Message[0]) - { - case 1: - flags_UART_FATFS.writting = 1; - Message[bytescnt] = '\0'; - res = CreateAndOpenMessageFile(&MessageFile, (const TCHAR*)(Message+1)); - break; - case 2: - flags_UART_FATFS.writting = 1; - res = OpenMessageFile(&MessageFile, (const TCHAR*)path_uart); - break; - } - - } - else - { - if (Message[0] == 0x03) - { - flags_UART_FATFS.writting = 0; - res = CloseMessageFile(&MessageFile); - } - else - { - res = WriteMessage(&MessageFile, (char *)Message, bytescnt); - } - } - HAL_UART_AbortReceive_IT(&huart3); - HAL_UART_Receive_IT(&huart3, Message, sizeof(Message)); - - - bytescnt = 0; - for(int i = 0; iInstance = uuart->UARTx; - huart->Init.BaudRate = uuart->UART_Speed; - - // everything else is default (for now, maybe this settings would be added in UARTSettings structure later) - huart->Init.WordLength = UART_WORDLENGTH_8B; - huart->Init.StopBits = UART_STOPBITS_1; - huart->Init.Parity = UART_PARITY_NONE; - huart->Init.Mode = UART_MODE_TX_RX; - huart->Init.HwFlowCtl = UART_HWCONTROL_NONE; - huart->Init.OverSampling = UART_OVERSAMPLING_16; - if (HAL_UART_Init(huart) != HAL_OK) - { - Error_Handler(); - } - - // init gpio from UARTSettings structure - UART_GPIO_Init(uuart->GPIOx, uuart->GPIO_PIN_RX, uuart->GPIO_PIN_TX); - // init dma from UARTSettings structure if need - if (uuart->DMAChannel != 0) - UART_DMA_Init(huart, DMAhuart, uuart->DMAChannel); -} - - -void UART_GPIO_Init(GPIO_TypeDef *GPIOx, uint16_t GPIO_PIN_RX, uint16_t GPIO_PIN_TX) -{ // function takes port and pins (for rx and tx) - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - // choose port for enable clock - if (GPIOx==GPIOA) - __HAL_RCC_GPIOA_CLK_ENABLE(); - else if (GPIOx==GPIOB) - __HAL_RCC_GPIOB_CLK_ENABLE(); - else if (GPIOx==GPIOC) - __HAL_RCC_GPIOC_CLK_ENABLE(); - else if (GPIOx==GPIOD) - __HAL_RCC_GPIOD_CLK_ENABLE(); - -// USART3 GPIO Configuration -//GPIO_PIN_TX ------> USART_TX - GPIO_InitStruct.Pin = GPIO_PIN_TX; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - HAL_GPIO_Init(GPIOx, &GPIO_InitStruct); - -// GPIO_PIN_RX ------> USART_RX - GPIO_InitStruct.Pin = GPIO_PIN_RX; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOx, &GPIO_InitStruct); -} - - -void UART_DMA_Init(UART_HandleTypeDef *huart, DMA_HandleTypeDef *hdma_rx, DMA_Channel_TypeDef *DMAhuart) -{ // function takes uart and dma handlers and dmachannel for uart - // for now only dma rx is supported, tx maybe later if needed - - /* USART3 DMA Init */ - /* USART3_RX Init */ - hdma_rx->Instance = DMAhuart; - hdma_rx->Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_rx->Init.PeriphInc = DMA_PINC_DISABLE; - hdma_rx->Init.MemInc = DMA_MINC_ENABLE; - hdma_rx->Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; - hdma_rx->Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; - hdma_rx->Init.Mode = DMA_CIRCULAR; - hdma_rx->Init.Priority = DMA_PRIORITY_LOW; - if (HAL_DMA_Init(hdma_rx) != HAL_OK) - { - Error_Handler(); - } - - __USER_LINKDMA(huart,hdmarx,hdma_rx); - // __USER_LINKDMA is need because __HAL_LINKDMA is written for global defined hdma_rx - // so you get error because hal uses . insted of -> -} - - - -void HAL_UART_MspInit(UART_HandleTypeDef* huart) // redefine hal function -{ // left only rcc and interrupt init for USART_1,2,3 (maybe UART_4,5 need to be added) - // GPIO and DMA init was move to their own functions - if(huart->Instance==USART3) - { - /* USART3 clock enable */ - __HAL_RCC_USART3_CLK_ENABLE(); - - /* USART3 interrupt Init */ - HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(USART3_IRQn); - } - else if(huart->Instance==USART2) - { - /* USART3 clock enable */ - __HAL_RCC_USART2_CLK_ENABLE(); - - /* USART3 interrupt Init */ - HAL_NVIC_SetPriority(USART2_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(USART2_IRQn); - } - else if(huart->Instance==USART1) - { - /* USART3 clock enable */ - __HAL_RCC_USART1_CLK_ENABLE(); - - /* USART3 interrupt Init */ - HAL_NVIC_SetPriority(USART1_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(USART1_IRQn); - } -} - -#endif \ No newline at end of file diff --git a/Core/Src/main.c b/Core/Src/main.c index 5965079..bfd40aa 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -23,14 +23,13 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "custom_flash.h" #include "gpio.h" //#include "bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ -int friman=0; + /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ @@ -57,19 +56,7 @@ int friman=0; /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ -//uint32_t programBytes2Read; -//uint32_t programBytesCounter; -//uint32_t currentAddress; -//UINT readBytes; -//FRESULT result; -//extern uint8_t ReceiveDataUART[4]; -//extern uint8_t Data2Write[PAGE_SIZE*2]; -//extern struct flag FLAGS; -//uint8_t *FLASH_Read(uint32_t add) -//{ -// return (uint8_t *)add; -//} /* USER CODE END 0 */ /** diff --git a/Core/Src/stm32f1xx_it.c b/Core/Src/stm32f1xx_it.c index 48be706..6261855 100644 --- a/Core/Src/stm32f1xx_it.c +++ b/Core/Src/stm32f1xx_it.c @@ -22,7 +22,6 @@ #include "stm32f1xx_it.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "custom_flash.h" #include "requester.h" /* USER CODE END Includes */ @@ -65,10 +64,7 @@ extern UART_HandleTypeDef huart3; extern TIM_HandleTypeDef htim8; /* USER CODE BEGIN EV */ -extern uint8_t Data2Write[PAGE_SIZE*2]; -extern uint8_t ReceiveDataUART[4]; -extern struct flag FLAGS; -extern int cnt_tim_reset; + /* USER CODE END EV */ /******************************************************************************/ diff --git a/MDK-ARM/CAN_Request-Response_protocol.uvoptx b/MDK-ARM/CAN_Request-Response_protocol.uvoptx new file mode 100644 index 0000000..e7a3b6d --- /dev/null +++ b/MDK-ARM/CAN_Request-Response_protocol.uvoptx @@ -0,0 +1,752 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + CAN_Request-Response_protocol + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F103RG$Flash\STM32F10x_1024.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U-O142 -O2254 -S0 -C0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F103RG$Flash\STM32F10x_1024.FLM) + + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 1 + 0 + 2 + 10000000 + + + + + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32f103xg.s + startup_stm32f103xg.s + 0 + 0 + + + + + Application/User/Core + 1 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ../Core/Src/main.c + main.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ../Core/Src/gpio.c + gpio.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ../Core/Src/can.c + can.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ../Core/Src/dma.c + dma.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ../Core/Src/rtc.c + rtc.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ../Core/Src/sdio.c + sdio.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ../Core/Src/tim.c + tim.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ../Core/Src/usart.c + usart.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ../Core/Src/stm32f1xx_it.c + stm32f1xx_it.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ../Core/Src/stm32f1xx_hal_msp.c + stm32f1xx_hal_msp.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 + ../Core/Src/stm32f1xx_hal_timebase_tim.c + stm32f1xx_hal_timebase_tim.c + 0 + 0 + + + 2 + 13 + 1 + 0 + 0 + 0 + ..\Core\Src\requester.c + requester.c + 0 + 0 + + + 2 + 14 + 5 + 0 + 0 + 0 + ..\Core\Inc\requester.h + requester.h + 0 + 0 + + + + + Application/User/FATFS/Target + 0 + 0 + 0 + 0 + + 3 + 15 + 1 + 0 + 0 + 0 + ../FATFS/Target/bsp_driver_sd.c + bsp_driver_sd.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ../FATFS/Target/fatfs_platform.c + fatfs_platform.c + 0 + 0 + + + + + Application/User/FATFS/App + 0 + 0 + 0 + 0 + + 4 + 17 + 1 + 0 + 0 + 0 + ../FATFS/App/fatfs.c + fatfs.c + 0 + 0 + + + + + Drivers/STM32F1xx_HAL_Driver + 0 + 0 + 0 + 0 + + 5 + 18 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c + stm32f1xx_hal_gpio_ex.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c + stm32f1xx_hal_can.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c + stm32f1xx_hal.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c + stm32f1xx_hal_rcc.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c + stm32f1xx_hal_rcc_ex.c + 0 + 0 + + + 5 + 23 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c + stm32f1xx_hal_gpio.c + 0 + 0 + + + 5 + 24 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c + stm32f1xx_hal_dma.c + 0 + 0 + + + 5 + 25 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c + stm32f1xx_hal_cortex.c + 0 + 0 + + + 5 + 26 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c + stm32f1xx_hal_pwr.c + 0 + 0 + + + 5 + 27 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c + stm32f1xx_hal_flash.c + 0 + 0 + + + 5 + 28 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c + stm32f1xx_hal_flash_ex.c + 0 + 0 + + + 5 + 29 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c + stm32f1xx_hal_exti.c + 0 + 0 + + + 5 + 30 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c + stm32f1xx_hal_rtc.c + 0 + 0 + + + 5 + 31 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c + stm32f1xx_hal_rtc_ex.c + 0 + 0 + + + 5 + 32 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_sdmmc.c + stm32f1xx_ll_sdmmc.c + 0 + 0 + + + 5 + 33 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c + stm32f1xx_hal_sd.c + 0 + 0 + + + 5 + 34 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c + stm32f1xx_hal_tim.c + 0 + 0 + + + 5 + 35 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c + stm32f1xx_hal_tim_ex.c + 0 + 0 + + + 5 + 36 + 1 + 0 + 0 + 0 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c + stm32f1xx_hal_uart.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 6 + 37 + 1 + 0 + 0 + 0 + ../Core/Src/system_stm32f1xx.c + system_stm32f1xx.c + 0 + 0 + + + + + Middlewares/FatFs + 1 + 0 + 0 + 0 + + 7 + 38 + 1 + 0 + 0 + 0 + ../Middlewares/Third_Party/FatFs/src/diskio.c + diskio.c + 0 + 0 + + + 7 + 39 + 1 + 0 + 0 + 0 + ../Middlewares/Third_Party/FatFs/src/ff.c + ff.c + 0 + 0 + + + 7 + 40 + 1 + 0 + 0 + 0 + ../Middlewares/Third_Party/FatFs/src/ff_gen_drv.c + ff_gen_drv.c + 0 + 0 + + + 7 + 41 + 1 + 0 + 0 + 0 + ../Middlewares/Third_Party/FatFs/src/option/syscall.c + syscall.c + 0 + 0 + + + 7 + 42 + 1 + 0 + 0 + 0 + ../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c + sd_diskio.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/MDK-ARM/CAN_Request-Response_protocol.uvprojx b/MDK-ARM/CAN_Request-Response_protocol.uvprojx new file mode 100644 index 0000000..c523e57 --- /dev/null +++ b/MDK-ARM/CAN_Request-Response_protocol.uvprojx @@ -0,0 +1,650 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + CAN_Request-Response_protocol + 0x4 + ARM-ADS + 6190000::V6.19::ARMCLANG + 6190000::V6.19::ARMCLANG + 1 + + + STM32F103RG + STMicroelectronics + Keil.STM32F1xx_DFP.2.4.0 + http://www.keil.com/pack/ + IRAM(0x20000000-0x20017FFF) IROM(0x8000000-0x80FFFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") TZ + + + + 0 + + + + + + + + + + + $$Device:STM32F103RG$SVD\STM32F103xx.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + CAN_Request-Response_protocol\ + CAN_Request-Response_protocol + 1 + 0 + 1 + 1 + 1 + + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 1 + 0 + fromelf.exe --bin --output .\Listings\@L.bin !L + + 0 + 0 + 0 + 0 + + 1 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4101 + + 1 + BIN\UL2V8M.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 0 + 0 + 0 + 0 + 3 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x100000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x400000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x20018000 + 0x1000 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 3 + 0 + 0 + 1 + 0 + 1 + 3 + 5 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32F103xG + + ../Core/Inc;../FATFS/Target;../FATFS/App;../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FatFs/src;../Middlewares/Third_Party/FatFs/src/drivers;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + + + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32f103xg.s + 2 + startup_stm32f103xg.s + + + + + Application/User/Core + + + main.c + 1 + ../Core/Src/main.c + + + gpio.c + 1 + ../Core/Src/gpio.c + + + can.c + 1 + ../Core/Src/can.c + + + dma.c + 1 + ../Core/Src/dma.c + + + rtc.c + 1 + ../Core/Src/rtc.c + + + sdio.c + 1 + ../Core/Src/sdio.c + + + tim.c + 1 + ../Core/Src/tim.c + + + usart.c + 1 + ../Core/Src/usart.c + + + stm32f1xx_it.c + 1 + ../Core/Src/stm32f1xx_it.c + + + stm32f1xx_hal_msp.c + 1 + ../Core/Src/stm32f1xx_hal_msp.c + + + stm32f1xx_hal_timebase_tim.c + 1 + ../Core/Src/stm32f1xx_hal_timebase_tim.c + + + requester.c + 1 + ..\Core\Src\requester.c + + + requester.h + 5 + ..\Core\Inc\requester.h + + + + + Application/User/FATFS/Target + + + bsp_driver_sd.c + 1 + ../FATFS/Target/bsp_driver_sd.c + + + fatfs_platform.c + 1 + ../FATFS/Target/fatfs_platform.c + + + + + Application/User/FATFS/App + + + fatfs.c + 1 + ../FATFS/App/fatfs.c + + + + + Drivers/STM32F1xx_HAL_Driver + + + stm32f1xx_hal_gpio_ex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c + + + stm32f1xx_hal_can.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c + + + stm32f1xx_hal.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c + + + stm32f1xx_hal_rcc.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c + + + stm32f1xx_hal_rcc_ex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c + + + stm32f1xx_hal_gpio.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c + + + stm32f1xx_hal_dma.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c + + + stm32f1xx_hal_cortex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c + + + stm32f1xx_hal_pwr.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c + + + stm32f1xx_hal_flash.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c + + + stm32f1xx_hal_flash_ex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c + + + stm32f1xx_hal_exti.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c + + + stm32f1xx_hal_rtc.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c + + + stm32f1xx_hal_rtc_ex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c + + + stm32f1xx_ll_sdmmc.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_sdmmc.c + + + stm32f1xx_hal_sd.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c + + + stm32f1xx_hal_tim.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c + + + stm32f1xx_hal_tim_ex.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c + + + stm32f1xx_hal_uart.c + 1 + ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c + + + + + Drivers/CMSIS + + + system_stm32f1xx.c + 1 + ../Core/Src/system_stm32f1xx.c + + + + + Middlewares/FatFs + + + diskio.c + 1 + ../Middlewares/Third_Party/FatFs/src/diskio.c + + + ff.c + 1 + ../Middlewares/Third_Party/FatFs/src/ff.c + + + ff_gen_drv.c + 1 + ../Middlewares/Third_Party/FatFs/src/ff_gen_drv.c + + + syscall.c + 1 + ../Middlewares/Third_Party/FatFs/src/option/syscall.c + + + sd_diskio.c + 1 + ../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/MDK-ARM/CAN_Request-Response_protocol/CAN_Request-Response_protocol.sct b/MDK-ARM/CAN_Request-Response_protocol/CAN_Request-Response_protocol.sct new file mode 100644 index 0000000..d01f18b --- /dev/null +++ b/MDK-ARM/CAN_Request-Response_protocol/CAN_Request-Response_protocol.sct @@ -0,0 +1,19 @@ +; ************************************************************* +; *** Scatter-Loading Description File generated by uVision *** +; ************************************************************* + +LR_IROM1 0x08000000 0x00400000 { ; load region size_region + ER_IROM1 0x08000000 0x00400000 { ; load address = execution address + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + RW_IRAM1 0x20000000 0x00018000 { ; RW data + .ANY (+RW +ZI) + } + RW_IRAM2 0x20018000 0x00001000 { + .ANY (+RW +ZI) + } +} + diff --git a/MDK-ARM/DebugConfig/CAN_Request-Response_protocol_STM32F103RG_1.0.0.dbgconf b/MDK-ARM/DebugConfig/CAN_Request-Response_protocol_STM32F103RG_1.0.0.dbgconf new file mode 100644 index 0000000..66e10b6 --- /dev/null +++ b/MDK-ARM/DebugConfig/CAN_Request-Response_protocol_STM32F103RG_1.0.0.dbgconf @@ -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 >>> + +// Debug MCU configuration register (DBGMCU_CR) +// Reserved bits must be kept at reset value +// DBG_TIM11_STOP TIM11 counter stopped when core is halted +// DBG_TIM10_STOP TIM10 counter stopped when core is halted +// DBG_TIM9_STOP TIM9 counter stopped when core is halted +// DBG_TIM14_STOP TIM14 counter stopped when core is halted +// DBG_TIM13_STOP TIM13 counter stopped when core is halted +// DBG_TIM12_STOP TIM12 counter stopped when core is halted +// DBG_CAN2_STOP Debug CAN2 stopped when core is halted +// DBG_TIM7_STOP TIM7 counter stopped when core is halted +// DBG_TIM6_STOP TIM6 counter stopped when core is halted +// DBG_TIM5_STOP TIM5 counter stopped when core is halted +// DBG_TIM8_STOP TIM8 counter stopped when core is halted +// DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted +// DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted +// DBG_CAN1_STOP Debug CAN1 stopped when Core is halted +// DBG_TIM4_STOP TIM4 counter stopped when core is halted +// DBG_TIM3_STOP TIM3 counter stopped when core is halted +// DBG_TIM2_STOP TIM2 counter stopped when core is halted +// DBG_TIM1_STOP TIM1 counter stopped when core is halted +// DBG_WWDG_STOP Debug window watchdog stopped when core is halted +// DBG_IWDG_STOP Debug independent watchdog stopped when core is halted +// DBG_STANDBY Debug standby mode +// DBG_STOP Debug stop mode +// DBG_SLEEP Debug sleep mode +// +DbgMCU_CR = 0x00000007; + +// <<< end of configuration section >>> diff --git a/MDK-ARM/DebugConfig/stm32f103rgtx_CAN_Request_Response_protocol_STM32F103RG_1.0.0.dbgconf b/MDK-ARM/DebugConfig/stm32f103rgtx_CAN_Request_Response_protocol_STM32F103RG_1.0.0.dbgconf new file mode 100644 index 0000000..66e10b6 --- /dev/null +++ b/MDK-ARM/DebugConfig/stm32f103rgtx_CAN_Request_Response_protocol_STM32F103RG_1.0.0.dbgconf @@ -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 >>> + +// Debug MCU configuration register (DBGMCU_CR) +// Reserved bits must be kept at reset value +// DBG_TIM11_STOP TIM11 counter stopped when core is halted +// DBG_TIM10_STOP TIM10 counter stopped when core is halted +// DBG_TIM9_STOP TIM9 counter stopped when core is halted +// DBG_TIM14_STOP TIM14 counter stopped when core is halted +// DBG_TIM13_STOP TIM13 counter stopped when core is halted +// DBG_TIM12_STOP TIM12 counter stopped when core is halted +// DBG_CAN2_STOP Debug CAN2 stopped when core is halted +// DBG_TIM7_STOP TIM7 counter stopped when core is halted +// DBG_TIM6_STOP TIM6 counter stopped when core is halted +// DBG_TIM5_STOP TIM5 counter stopped when core is halted +// DBG_TIM8_STOP TIM8 counter stopped when core is halted +// DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted +// DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted +// DBG_CAN1_STOP Debug CAN1 stopped when Core is halted +// DBG_TIM4_STOP TIM4 counter stopped when core is halted +// DBG_TIM3_STOP TIM3 counter stopped when core is halted +// DBG_TIM2_STOP TIM2 counter stopped when core is halted +// DBG_TIM1_STOP TIM1 counter stopped when core is halted +// DBG_WWDG_STOP Debug window watchdog stopped when core is halted +// DBG_IWDG_STOP Debug independent watchdog stopped when core is halted +// DBG_STANDBY Debug standby mode +// DBG_STOP Debug stop mode +// DBG_SLEEP Debug sleep mode +// +DbgMCU_CR = 0x00000007; + +// <<< end of configuration section >>> diff --git a/MDK-ARM/RTE/_CAN_Request-Response_protocol/RTE_Components.h b/MDK-ARM/RTE/_CAN_Request-Response_protocol/RTE_Components.h new file mode 100644 index 0000000..040d4e9 --- /dev/null +++ b/MDK-ARM/RTE/_CAN_Request-Response_protocol/RTE_Components.h @@ -0,0 +1,21 @@ + +/* + * Auto generated Run-Time-Environment Configuration File + * *** Do not modify ! *** + * + * Project: 'CAN_Request-Response_protocol' + * Target: 'CAN_Request-Response_protocol' + */ + +#ifndef RTE_COMPONENTS_H +#define RTE_COMPONENTS_H + + +/* + * Define the Device Header File: + */ +#define CMSIS_device_header "stm32f10x.h" + + + +#endif /* RTE_COMPONENTS_H */ diff --git a/MDK-ARM/RTE/_stm32f103rgtx_CAN_Request_Response_protocol/RTE_Components.h b/MDK-ARM/RTE/_stm32f103rgtx_CAN_Request_Response_protocol/RTE_Components.h new file mode 100644 index 0000000..cfa7ef6 --- /dev/null +++ b/MDK-ARM/RTE/_stm32f103rgtx_CAN_Request_Response_protocol/RTE_Components.h @@ -0,0 +1,21 @@ + +/* + * Auto generated Run-Time-Environment Configuration File + * *** Do not modify ! *** + * + * Project: 'stm32f103rgtx_bootloader' + * Target: 'stm32f103rgtx_CAN_Request_Response_protocol' + */ + +#ifndef RTE_COMPONENTS_H +#define RTE_COMPONENTS_H + + +/* + * Define the Device Header File: + */ +#define CMSIS_device_header "stm32f10x.h" + + + +#endif /* RTE_COMPONENTS_H */ diff --git a/MDK-ARM/stm32f103rgtx_bootloader.uvoptx b/MDK-ARM/stm32f103rgtx_bootloader.uvoptx index 168bba3..a24b4c8 100644 --- a/MDK-ARM/stm32f103rgtx_bootloader.uvoptx +++ b/MDK-ARM/stm32f103rgtx_bootloader.uvoptx @@ -22,7 +22,7 @@ - stm32f103rgtx_bootloader + stm32f103rgtx_CAN_Request_Response_protocol 0x4 ARM-ADS @@ -327,42 +327,6 @@ 2 2 - 1 - 0 - 0 - 0 - ..\Core\Src\custom_flash.c - custom_flash.c - 0 - 0 - - - 2 - 3 - 5 - 0 - 0 - 0 - ..\Core\Inc\custom_flash.h - custom_flash.h - 0 - 0 - - - 2 - 4 - 5 - 0 - 0 - 0 - ..\Core\Inc\boot_project_setup.h - boot_project_setup.h - 0 - 0 - - - 2 - 5 5 0 0 @@ -374,7 +338,7 @@ 2 - 6 + 3 1 0 0 @@ -386,9 +350,9 @@ 2 - 7 + 4 1 - 0 + 1 0 0 ../Core/Src/main.c @@ -398,7 +362,7 @@ 2 - 8 + 5 1 0 0 @@ -410,7 +374,7 @@ 2 - 9 + 6 1 0 0 @@ -422,7 +386,7 @@ 2 - 10 + 7 1 0 0 @@ -434,7 +398,7 @@ 2 - 11 + 8 1 0 0 @@ -446,7 +410,7 @@ 2 - 12 + 9 1 0 0 @@ -458,7 +422,7 @@ 2 - 13 + 10 1 0 0 @@ -470,7 +434,7 @@ 2 - 14 + 11 1 0 0 @@ -482,7 +446,7 @@ 2 - 15 + 12 1 0 0 @@ -494,7 +458,7 @@ 2 - 16 + 13 1 0 0 @@ -506,7 +470,7 @@ 2 - 17 + 14 1 0 0 @@ -526,7 +490,7 @@ 0 3 - 18 + 15 1 0 0 @@ -538,7 +502,7 @@ 3 - 19 + 16 1 0 0 @@ -558,7 +522,7 @@ 0 4 - 20 + 17 1 0 0 @@ -578,7 +542,7 @@ 0 5 - 21 + 18 1 0 0 @@ -590,7 +554,7 @@ 5 - 22 + 19 1 0 0 @@ -602,7 +566,7 @@ 5 - 23 + 20 1 0 0 @@ -614,7 +578,7 @@ 5 - 24 + 21 1 0 0 @@ -626,7 +590,7 @@ 5 - 25 + 22 1 0 0 @@ -638,7 +602,7 @@ 5 - 26 + 23 1 0 0 @@ -650,7 +614,7 @@ 5 - 27 + 24 1 0 0 @@ -662,7 +626,7 @@ 5 - 28 + 25 1 0 0 @@ -674,7 +638,7 @@ 5 - 29 + 26 1 0 0 @@ -686,7 +650,7 @@ 5 - 30 + 27 1 0 0 @@ -698,7 +662,7 @@ 5 - 31 + 28 1 0 0 @@ -710,7 +674,7 @@ 5 - 32 + 29 1 0 0 @@ -722,7 +686,7 @@ 5 - 33 + 30 1 0 0 @@ -734,7 +698,7 @@ 5 - 34 + 31 1 0 0 @@ -746,7 +710,7 @@ 5 - 35 + 32 1 0 0 @@ -758,7 +722,7 @@ 5 - 36 + 33 1 0 0 @@ -770,7 +734,7 @@ 5 - 37 + 34 1 0 0 @@ -782,7 +746,7 @@ 5 - 38 + 35 1 0 0 @@ -794,7 +758,7 @@ 5 - 39 + 36 1 0 0 @@ -814,7 +778,7 @@ 0 6 - 40 + 37 1 0 0 @@ -834,7 +798,7 @@ 0 7 - 41 + 38 1 0 0 @@ -846,7 +810,7 @@ 7 - 42 + 39 1 0 0 @@ -858,7 +822,7 @@ 7 - 43 + 40 1 0 0 @@ -870,7 +834,7 @@ 7 - 44 + 41 1 0 0 @@ -882,7 +846,7 @@ 7 - 45 + 42 1 0 0 diff --git a/MDK-ARM/stm32f103rgtx_bootloader.uvprojx b/MDK-ARM/stm32f103rgtx_bootloader.uvprojx index 8d11e5f..824dc41 100644 --- a/MDK-ARM/stm32f103rgtx_bootloader.uvprojx +++ b/MDK-ARM/stm32f103rgtx_bootloader.uvprojx @@ -7,7 +7,7 @@ - stm32f103rgtx_bootloader + stm32f103rgtx_CAN_Request_Response_protocol 0x4 ARM-ADS 6190000::V6.19::ARMCLANG @@ -395,21 +395,6 @@ Application/User/Core - - custom_flash.c - 1 - ..\Core\Src\custom_flash.c - - - custom_flash.h - 5 - ..\Core\Inc\custom_flash.h - - - boot_project_setup.h - 5 - ..\Core\Inc\boot_project_setup.h - requester.h 5 @@ -859,7 +844,7 @@ - +