Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .cubemx-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "CubeMX code sync manifest - do not edit manually",
"boards": {
"BMS": {
"ioc_checksum": "08670b75875f2feedea3280eecc4821f36b742ccf7680976ae6f87bc3937ebfc",
"generated_at": "2026-04-08T20:26:54Z",
"ioc_checksum": "d67d86ebf5db71a331f07042109552fb61b459ede2b94d512dd9e4b8919f1170",
"generated_at": "2026-04-16T22:21:24Z",
"files": {
"Core/Inc/FreeRTOSConfig.h": "363755b7a21dd5a790f0bafbfd68f00abe141fd8691720b3604bc84b7dbaa81b",
"Core/Inc/adc.h": "0ac97025a4065f07b7b65a906bd0c45ea800215434ed43c287c1685507f3f612",
Expand All @@ -20,10 +20,10 @@
"Core/Src/adc.c": "e6351e04830c932155617799c4a53104b7c413c09cfb1e4448242d550042fbfa",
"Core/Src/can.c": "f5e04678eadb76f6d822b060057362085c98d93b76b176dd249d0a86fcd6c8f6",
"Core/Src/dma.c": "f4e0e37c96eb641193fda73df20c30bc1977cdb8fa419cd2892aacdbe5bdf78b",
"Core/Src/freertos.c": "2863f13e59f92c380f5012e5ba06221ed92ae41da5a34d12fba6f2c1dc69212c",
"Core/Src/freertos.c": "ff171fb0ff35576b7805f167934fbe7f587cad8c78819766ce8078a2c938ca48",
"Core/Src/gpio.c": "9067f79d80bf4c169b51c12a357fb5f56d8aff27ed23815d9e42ac2fe87e4705",
"Core/Src/i2c.c": "d616e686a119d6a1cfad6eee39d81b9245743036d643477d1fb9a3a2b588a157",
"Core/Src/main.c": "fad0e58d62b91861f7c9252e01664e7ec54c89e0e60f72157168a302fbb140ff",
"Core/Src/main.c": "568b1449496d66fa37dbbefc91f305a0b47cff76772011461b24e6c1e77866b5",
"Core/Src/spi.c": "e09e1d6ad9f52bfa7dc9f6357596136692cb67c3c1fdf6f198832de47703ad7f",
"Core/Src/stm32f4xx_hal_msp.c": "c220f834705b367cec12ff62da970a90769c5ce57259670aac76df5240f1f577",
"Core/Src/stm32f4xx_hal_timebase_tim.c": "b466164af62aa9edce6b63ba955915c0bee9cf1aaf4b9aa70014ff632cf12686",
Expand Down Expand Up @@ -75,7 +75,7 @@
},
"DASH": {
"ioc_checksum": "e95ffc17bdded4d5b6be3894345d7149e5c93fd84b09279cd8888540662ce95e",
"generated_at": "2026-04-08T20:26:56Z",
"generated_at": "2026-04-16T22:21:26Z",
"files": {
"Core/Inc/FreeRTOSConfig.h": "692168cbc9c915133ce3f329cec850c5372c1759ec0412ced61fc14741de14be",
"Core/Inc/can.h": "d9c82c8382c196a76d472a6b82a292a0384a086536ca280ce701ebbba9f5c682",
Expand Down Expand Up @@ -177,7 +177,7 @@
},
"DART": {
"ioc_checksum": "ec3c85c2c8b4e4d94362ddb58b54f6882bbe337678213a16363428dc83171245",
"generated_at": "2026-04-08T20:26:57Z",
"generated_at": "2026-04-16T22:21:26Z",
"files": {
"Core/Inc/gpio.h": "e2d62f964a0b7f238384ed6a20a181d09df9647240a268dc547acf5b35099f74",
"Core/Inc/main.h": "e07a43ebc634ce451e2f80884378d112e048e06235fb49fdc2d9a2b5057d28c5",
Expand All @@ -197,7 +197,7 @@
},
"DCU": {
"ioc_checksum": "75f4a1174af99a72596dd7f739c38e22b0459b215bc0ddb3e22a6cfd49a8e736",
"generated_at": "2026-04-08T20:26:57Z",
"generated_at": "2026-04-16T22:21:26Z",
"files": {
"Core/Inc/gpio.h": "e2d62f964a0b7f238384ed6a20a181d09df9647240a268dc547acf5b35099f74",
"Core/Inc/main.h": "e07a43ebc634ce451e2f80884378d112e048e06235fb49fdc2d9a2b5057d28c5",
Expand All @@ -217,7 +217,7 @@
},
"LVPDB": {
"ioc_checksum": "35fab767f9e0e1027a136ca482edf00568850e7bd941f793ae156215fec1ca33",
"generated_at": "2026-04-08T20:26:58Z",
"generated_at": "2026-04-16T22:21:27Z",
"files": {
"Core/Inc/can.h": "17611aeff90b90e352bc2ace2749644663492ecb10c71539567ef9b1441fd5d9",
"Core/Inc/dma.h": "7cf6f7450a29d26303cbba5a3ca8c6cb24a02635d6a5ba4d05141fdfc75c4c49",
Expand Down Expand Up @@ -245,7 +245,7 @@
},
"PCU": {
"ioc_checksum": "dd91de27d45363f02d89b5341de246826cc4d72a9f77d219c6bf4ac072c24126",
"generated_at": "2026-04-08T20:26:58Z",
"generated_at": "2026-04-16T22:21:27Z",
"files": {
"Core/Inc/adc.h": "e36acfe1b822eff1de7e9f93073b8da32c94dd5b09484b716e190c6aa63eb3d0",
"Core/Inc/can.h": "98925d7f4010f054e17d240116244377377c15248a5413a09ff811cdc23084e5",
Expand Down Expand Up @@ -275,7 +275,7 @@
},
"Sensor_Nodes": {
"ioc_checksum": "8c69b14e19d1dd61e329967ee4aad14fac48a8c30fc502bc9055c4a5eb52e5ab",
"generated_at": "2026-04-08T20:26:59Z",
"generated_at": "2026-04-16T22:21:28Z",
"files": {
"Core/Inc/adc.h": "0ac97025a4065f07b7b65a906bd0c45ea800215434ed43c287c1685507f3f612",
"Core/Inc/can.h": "98925d7f4010f054e17d240116244377377c15248a5413a09ff811cdc23084e5",
Expand Down Expand Up @@ -303,7 +303,7 @@
},
"UART_TEST": {
"ioc_checksum": "06c9618835096e44e3f73cd158bbc2e3fcf76e65dc9a29db68fe607180843efd",
"generated_at": "2026-04-08T20:27:00Z",
"generated_at": "2026-04-16T22:21:29Z",
"files": {
"Core/Inc/FreeRTOSConfig.h": "773dad076864ff18d5d85603d348d4931d29dde9925486e58f95a97ac98b8404",
"Core/Inc/app_freertos.h": "6229601c2ebf192d40ceef377f3c1785571eaf6407f10bc87be5b06357dd3515",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
"[cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools",
"editor.formatOnSave": true
},
"files.associations": {
"random": "cpp"
}
}
2 changes: 1 addition & 1 deletion BMS/BMS.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ FREERTOS.FootprintOK=true
FREERTOS.IPParameters=Tasks01,configENABLE_FPU,FootprintOK,configCHECK_FOR_STACK_OVERFLOW,Mutexes01,configTOTAL_HEAP_SIZE,CountingSemaphores01,Queues01
FREERTOS.Mutexes01=ADBMSMutex,Dynamic,NULL,Available;canTxMutex,Dynamic,NULL,Available;canRxMutex,Dynamic,NULL,Available;tpsDataMutex,Dynamic,NULL,Available;tpsI2cMutex,Dynamic,NULL,Available;logMutex,Dynamic,NULL,Available;uartTxMutex,Dynamic,NULL,Available
FREERTOS.Queues01=canTxQueue,16,FEB_CAN_Message_t,0,Dynamic,NULL,NULL;canRxQueue,32,FEB_CAN_Message_t,0,Dynamic,NULL,NULL;uartRxQueue,8,FEB_UART_RxQueueMsg_t,0,Dynamic,NULL,NULL
FREERTOS.Tasks01=uartRxTask,24,512,StartUartRxTask,As weak,NULL,Dynamic,NULL,NULL;ADBMSTask,48,2048,StartADBMSTask,As weak,NULL,Dynamic,NULL,NULL;TPSTask,8,256,StartTPSTask,As weak,NULL,Dynamic,NULL,NULL;BMSTaskRx,8,512,StartBMSTaskRx,As weak,NULL,Dynamic,NULL,NULL;BMSTaskTx,8,512,StartBMSTaskTx,As weak,NULL,Dynamic,NULL,NULL;SMTask,24,512,StartSMTask,As weak,NULL,Dynamic,NULL,NULL
FREERTOS.Tasks01=uartRxTask,24,512,StartUartRxTask,As weak,NULL,Dynamic,NULL,NULL;ADBMSTask,48,2048,StartADBMSTask,As weak,NULL,Dynamic,NULL,NULL;TPSTask,8,256,StartTPSTask,As weak,NULL,Dynamic,NULL,NULL;BMSTaskRx,8,512,StartBMSTaskRx,As weak,NULL,Dynamic,NULL,NULL;BMSTaskTx,8,512,StartBMSTaskTx,As weak,NULL,Dynamic,NULL,NULL;SMTask,24,512,StartSMTask,As weak,NULL,Dynamic,NULL,NULL;BMSProcessingTask,32,1024,StartBMSProcessingTask,As weak,NULL,Dynamic,NULL,NULL
FREERTOS.configCHECK_FOR_STACK_OVERFLOW=2
FREERTOS.configENABLE_FPU=1
FREERTOS.configTOTAL_HEAP_SIZE=65536
Expand Down
2 changes: 1 addition & 1 deletion BMS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ add_executable(${PROJECT_NAME} ${ALL_SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE ${BASE_INCLUDES})

target_link_libraries(${PROJECT_NAME} PRIVATE m feb_io feb_tps feb_rtos_utils feb_uart feb_log feb_console)
target_link_libraries(${PROJECT_NAME} PRIVATE m feb_io feb_tps feb_rtos_utils feb_uart feb_log feb_console feb_adbms)

# Enable floating-point printf/scanf for newlib-nano
target_link_options(${PROJECT_NAME} PRIVATE
Expand Down
29 changes: 29 additions & 0 deletions BMS/Core/Src/freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ const osThreadAttr_t SMTask_attributes = {
.stack_size = 512 * 4,
.priority = (osPriority_t) osPriorityNormal,
};
/* Definitions for BMSProcessingTask */
osThreadId_t BMSProcessingTaskHandle;
const osThreadAttr_t BMSProcessingTask_attributes = {
.name = "BMSProcessingTask",
.stack_size = 1024 * 4,
.priority = (osPriority_t) osPriorityAboveNormal,
};
/* Definitions for canTxQueue */
osMessageQueueId_t canTxQueueHandle;
const osMessageQueueAttr_t canTxQueue_attributes = {
Expand Down Expand Up @@ -169,6 +176,7 @@ void StartTPSTask(void *argument);
void StartBMSTaskRx(void *argument);
void StartBMSTaskTx(void *argument);
void StartSMTask(void *argument);
void StartBMSProcessingTask(void *argument);

void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */

Expand Down Expand Up @@ -262,6 +270,9 @@ void MX_FREERTOS_Init(void) {
/* creation of SMTask */
SMTaskHandle = osThreadNew(StartSMTask, NULL, &SMTask_attributes);

/* creation of BMSProcessingTask */
BMSProcessingTaskHandle = osThreadNew(StartBMSProcessingTask, NULL, &BMSProcessingTask_attributes);

/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
/* USER CODE END RTOS_THREADS */
Expand Down Expand Up @@ -381,6 +392,24 @@ __weak void StartSMTask(void *argument)
/* USER CODE END StartSMTask */
}

/* USER CODE BEGIN Header_StartBMSProcessingTask */
/**
* @brief Function implementing the BMSProcessingTask thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartBMSProcessingTask */
__weak void StartBMSProcessingTask(void *argument)
{
/* USER CODE BEGIN StartBMSProcessingTask */
/* Infinite loop */
for(;;)
{
osDelay(1);
}
/* USER CODE END StartBMSProcessingTask */
}

/* Private application code --------------------------------------------------*/
/* USER CODE BEGIN Application */

Expand Down
4 changes: 2 additions & 2 deletions BMS/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "FEB_ADBMS6830B.h"
#include <stdio.h>
#include "FEB_ADBMS_App.h"
#include "FEB_CAN_State.h"
#include "FEB_CAN_PingPong.h"
#include "FEB_HW.h"
#include "FEB_Main.h"
#include "FEB_SM.h"
#include "task.h"
Expand Down
212 changes: 0 additions & 212 deletions BMS/Core/User/Inc/ADBMS6830B_Commands.h

This file was deleted.

Loading