优化freertos堆
This commit is contained in:
parent
21fd13e6c3
commit
5dd11c231d
@ -73,7 +73,7 @@
|
||||
#define configTICK_RATE_HZ ((TickType_t)1000)
|
||||
#define configMAX_PRIORITIES ( 56 )
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)0x6000)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)0x10000)
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configGENERATE_RUN_TIME_STATS 1
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
@ -187,6 +187,7 @@ standard names. */
|
||||
|
||||
/* USER CODE BEGIN Defines */
|
||||
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
||||
// #define configAPPLICATION_ALLOCATED_HEAP 1
|
||||
/* USER CODE END Defines */
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Variables */
|
||||
|
||||
uint8_t ucHeap[configTOTAL_HEAP_SIZE] __attribute__((section(".ccmram")));
|
||||
/* USER CODE END Variables */
|
||||
/* Definitions for defaultTask */
|
||||
osThreadId_t defaultTaskHandle;
|
||||
|
||||
5
DevC.ioc
5
DevC.ioc
@ -141,14 +141,15 @@ FREERTOS.INCLUDE_xSemaphoreGetMutexHolder=1
|
||||
FREERTOS.INCLUDE_xTaskAbortDelay=1
|
||||
FREERTOS.INCLUDE_xTaskGetCurrentTaskHandle=1
|
||||
FREERTOS.INCLUDE_xTaskGetHandle=1
|
||||
FREERTOS.IPParameters=Tasks01,FootprintOK,configENABLE_FPU,configENABLE_BACKWARD_COMPATIBILITY,configRECORD_STACK_HIGH_ADDRESS,configCHECK_FOR_STACK_OVERFLOW,configGENERATE_RUN_TIME_STATS,configUSE_STATS_FORMATTING_FUNCTIONS,configTOTAL_HEAP_SIZE,INCLUDE_xTaskGetCurrentTaskHandle,INCLUDE_xTaskGetHandle,INCLUDE_uxTaskGetStackHighWaterMark2,INCLUDE_xEventGroupSetBitFromISR,INCLUDE_xTaskAbortDelay,INCLUDE_pcTaskGetTaskName,INCLUDE_xSemaphoreGetMutexHolder,INCLUDE_vTaskCleanUpResources
|
||||
FREERTOS.IPParameters=Tasks01,FootprintOK,configENABLE_FPU,configENABLE_BACKWARD_COMPATIBILITY,configRECORD_STACK_HIGH_ADDRESS,configCHECK_FOR_STACK_OVERFLOW,configGENERATE_RUN_TIME_STATS,configUSE_STATS_FORMATTING_FUNCTIONS,configTOTAL_HEAP_SIZE,INCLUDE_xTaskGetCurrentTaskHandle,INCLUDE_xTaskGetHandle,INCLUDE_uxTaskGetStackHighWaterMark2,INCLUDE_xEventGroupSetBitFromISR,INCLUDE_xTaskAbortDelay,INCLUDE_pcTaskGetTaskName,INCLUDE_xSemaphoreGetMutexHolder,INCLUDE_vTaskCleanUpResources,configUSE_APPLICATION_TASK_TAG
|
||||
FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
|
||||
FREERTOS.configCHECK_FOR_STACK_OVERFLOW=2
|
||||
FREERTOS.configENABLE_BACKWARD_COMPATIBILITY=0
|
||||
FREERTOS.configENABLE_FPU=1
|
||||
FREERTOS.configGENERATE_RUN_TIME_STATS=1
|
||||
FREERTOS.configRECORD_STACK_HIGH_ADDRESS=1
|
||||
FREERTOS.configTOTAL_HEAP_SIZE=0x6000
|
||||
FREERTOS.configTOTAL_HEAP_SIZE=0x10000
|
||||
FREERTOS.configUSE_APPLICATION_TASK_TAG=0
|
||||
FREERTOS.configUSE_STATS_FORMATTING_FUNCTIONS=1
|
||||
File.Version=6
|
||||
GPIO.groupedBy=Group By Peripherals
|
||||
|
||||
@ -680,7 +680,6 @@ int8_t BSP_CAN_WaitTxMailboxEmpty(BSP_CAN_t can, uint32_t timeout) {
|
||||
}
|
||||
}
|
||||
|
||||
// 短暂延时,避免占用过多CPU
|
||||
osDelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,51 +22,7 @@ Config_RobotParam_t robot_config = {
|
||||
.device_id = 0x42,
|
||||
.master_id = 0x43,
|
||||
},
|
||||
.joint_motors[0] = { // 左膝关节
|
||||
.can = BSP_CAN_1,
|
||||
.motor_id = 124,
|
||||
.host_id = 0XFF,
|
||||
.module = MOTOR_LZ_RSO3,
|
||||
.reverse = false,
|
||||
.mode = MOTOR_LZ_MODE_MOTION,
|
||||
},
|
||||
.joint_motors[1] = { // 左髋关节
|
||||
.can = BSP_CAN_1,
|
||||
.motor_id = 125,
|
||||
.host_id = 0XFF,
|
||||
.module = MOTOR_LZ_RSO3,
|
||||
.reverse = false,
|
||||
.mode = MOTOR_LZ_MODE_MOTION,
|
||||
},
|
||||
.joint_motors[2] = { // 右髋关节
|
||||
.can = BSP_CAN_1,
|
||||
.motor_id = 126,
|
||||
.host_id = 0XFF,
|
||||
.module = MOTOR_LZ_RSO3,
|
||||
.reverse = false,
|
||||
.mode = MOTOR_LZ_MODE_MOTION,
|
||||
},
|
||||
.joint_motors[3] = { // 右膝关节
|
||||
.can = BSP_CAN_1,
|
||||
.motor_id = 127,
|
||||
.host_id = 0XFF,
|
||||
.module = MOTOR_LZ_RSO3,
|
||||
.reverse = false,
|
||||
.mode = MOTOR_LZ_MODE_MOTION,
|
||||
},
|
||||
.wheel_motors[0] = { // 左轮电机
|
||||
.can = BSP_CAN_1,
|
||||
.id = 1, // 电机ID为1,对应命令ID=0x141,反馈ID=0x181
|
||||
.module = MOTOR_LK_MF9025,
|
||||
.reverse = false,
|
||||
},
|
||||
.wheel_motors[1] = { // 右轮电机
|
||||
.can = BSP_CAN_1,
|
||||
.id = 2, // 电机ID为2,对应命令ID=0x142,反馈ID=0x182
|
||||
.module = MOTOR_LK_MF9025,
|
||||
.reverse = true,
|
||||
},
|
||||
|
||||
|
||||
.chassis_param = {
|
||||
.yaw={
|
||||
.k=1.0f,
|
||||
|
||||
@ -30,9 +30,7 @@ Chassis_CMD_t chassis_cmd = {
|
||||
.height = 0.0f,
|
||||
};
|
||||
Chassis_IMU_t chassis_imu;
|
||||
|
||||
MOTOR_Feedback_t left_wheel_fb;
|
||||
MOTOR_Feedback_t right_wheel_fb;
|
||||
Chassis_t chassis1;
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
|
||||
@ -22,12 +22,12 @@ void OnProjectLoad (void) {
|
||||
//
|
||||
// Dialog-generated settings
|
||||
//
|
||||
Project.AddPathSubstitute ("/Users/lvzucheng/Documents/R/balance_infantry", "$(ProjectDir)");
|
||||
Project.AddPathSubstitute ("/users/lvzucheng/documents/r/balance_infantry", "$(ProjectDir)");
|
||||
Project.SetDevice ("STM32F407IG");
|
||||
Project.SetHostIF ("USB", "207400620");
|
||||
Project.SetTargetIF ("SWD");
|
||||
Project.SetTIFSpeed ("4 MHz");
|
||||
Project.AddPathSubstitute ("/Users/lvzucheng/Documents/R/balance_infantry", "$(ProjectDir)");
|
||||
Project.AddPathSubstitute ("/users/lvzucheng/documents/r/balance_infantry", "$(ProjectDir)");
|
||||
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4F.svd");
|
||||
//
|
||||
// User settings
|
||||
|
||||
Loading…
Reference in New Issue
Block a user