-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- BMS Boss NVM bringup - BMS Worker NVM bringup - Support NVM in Bootloader to not overwrite NVM on download - Support NVM in the F105 - Added NVM FeatureDef
- Loading branch information
1 parent
5328b8f
commit f5a8ebe
Showing
44 changed files
with
1,523 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
featureDefs: "#/components/bms_boss/FeatureDefs.yaml" | ||
featureDefs: | ||
- "#/components/bms_boss/FeatureDefs.yaml" | ||
- "#/components/shared/FeatureDefs/NVM_FeatureDefs.yaml" | ||
features: | ||
feature_cantx_swi: | ||
feature_canrx_swi: | ||
nvm_lib_enabled: true | ||
nvm_flash_backed: true | ||
nvm_block_size: 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* LIB_nvm_config.h | ||
* LIB_nvm Component Specific file | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "HW_tim.h" | ||
#include "HW_flash.h" | ||
#include "LIB_nvm.h" | ||
|
||
/****************************************************************************** | ||
* T Y P E D E F S | ||
******************************************************************************/ | ||
|
||
#define LIB_NVM_GET_TIME_MS HW_TIM_getTimeMS | ||
#define LIB_NVM_GET_FLASH_PAGE_SIZE FLASH_getPageSize | ||
#define LIB_NVM_CLEAR_FLASH_PAGES FLASH_erasePages | ||
#define LIB_NVM_WRITE_TO_FLASH(addr, data, bytes) FLASH_writeHalfwords(addr, data, bytes / sizeof(storage_t)) | ||
|
||
typedef enum | ||
{ | ||
NVM_ENTRYID_COUNT = 0U, | ||
} lib_nvm_entryId_E; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* libcrc_componentSpecific.h | ||
* | ||
* Configuration for the libcrc module | ||
*/ | ||
|
||
#define LIBCRC_CRC8_FAST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @file NVM.c | ||
* @brief Source code for Non Volatile Memory Manager | ||
*/ | ||
|
||
/****************************************************************************** | ||
* I N C L U D E S | ||
******************************************************************************/ | ||
|
||
#include "LIB_nvm.h" | ||
|
||
/****************************************************************************** | ||
* P U B L I C V A R S | ||
******************************************************************************/ | ||
|
||
const lib_nvm_entry_S lib_nvm_entries[NVM_ENTRYID_COUNT]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
featureDefs: "#/components/bms_worker/FeatureDefs.yaml" | ||
featureDefs: | ||
- "#/components/bms_worker/FeatureDefs.yaml" | ||
- "#/components/shared/FeatureDefs/NVM_FeatureDefs.yaml" | ||
features: | ||
feature_max14921_calibrate: | ||
feature_cantx_swi: | ||
feature_canrx_swi: | ||
feature_cell_diagnostics: | ||
nvm_lib_enabled: false # true Disabled due to RTOS bug with NVM manager | ||
nvm_flash_backed: false # true | ||
nvm_block_size: 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* @file HW.c | ||
* @brief Source code for generic firmware functions | ||
*/ | ||
|
||
/****************************************************************************** | ||
* I N C L U D E S | ||
******************************************************************************/ | ||
|
||
// Header file | ||
#include "HW.h" | ||
|
||
// System Includes | ||
#include "stdbool.h" | ||
|
||
// Firmware Includes | ||
#include "include/HW_tim.h" | ||
#include "stm32f1xx.h" | ||
#include "LIB_nvm.h" | ||
|
||
typedef struct | ||
{ | ||
volatile uint32_t const CPUID; | ||
volatile uint32_t ICSR; | ||
volatile uint32_t VTOR; | ||
volatile uint32_t AIRCR; | ||
volatile uint32_t SCR; | ||
volatile uint32_t CCR; | ||
volatile uint32_t SHPR[3]; | ||
volatile uint32_t SHCSR; | ||
volatile uint32_t CFSR; | ||
volatile uint32_t HFSR; | ||
volatile uint32_t DFSR; | ||
volatile uint32_t MMFAR; | ||
volatile uint32_t BFAR; | ||
volatile uint32_t AFSR; | ||
} SCB_regMap; | ||
#define pSCB ((SCB_regMap*)SCB_BASE) | ||
|
||
#define AIRCR_RESET (0x05FA0000UL) | ||
#define AIRCR_RESET_REQ (AIRCR_RESET | 0x04UL) | ||
|
||
/****************************************************************************** | ||
* P U B L I C F U N C T I O N P R O T O T Y P E S | ||
******************************************************************************/ | ||
|
||
/** | ||
* @brief Initializes the generic low-level firmware | ||
* | ||
* @retval HW_OK | ||
*/ | ||
HW_StatusTypeDef_E HW_init(void) | ||
{ | ||
HAL_Init(); | ||
return HW_OK; | ||
} | ||
|
||
/** | ||
* @brief Deinitializes the generic low-level firmware | ||
* | ||
* @retval HW_OK | ||
*/ | ||
HW_StatusTypeDef_E HW_deInit(void) | ||
{ | ||
HAL_DeInit(); | ||
return HW_OK; | ||
} | ||
|
||
void HW_systemHardReset(void) | ||
{ | ||
#if FEATURE_IS_ENABLED(NVM_LIB_ENABLED) | ||
lib_nvm_cleanUp(); | ||
#endif | ||
pSCB->AIRCR = AIRCR_RESET_REQ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.