Skip to content

Commit

Permalink
fix driver for stm32h7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiu-xiao committed Apr 23, 2024
1 parent a338b9b commit 5305575
Show file tree
Hide file tree
Showing 19 changed files with 536 additions and 961 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@
[submodule "lib/eigen"]
path = lib/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "hw/mcu/st/stm32h7xx_hal_driver"]
path = hw/mcu/st/stm32h7xx_hal_driver
url = https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_h7"]
path = hw/mcu/st/cmsis_device_h7
url = https://github.com/STMicroelectronics/cmsis_device_h7.git
6 changes: 6 additions & 0 deletions .gitmodules_cn
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@
[submodule "lib/eigen"]
path = lib/eigen
url = https://gitee.com/x-robot/eigen.git
[submodule "hw/mcu/st/stm32h7xx_hal_driver"]
path = hw/mcu/st/stm32h7xx_hal_driver
url = https://gitee.com/x-robot/stm32h7xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_h7"]
path = hw/mcu/st/cmsis_device_h7
url = https://gitee.com/x-robot/cmsis_device_h7.git
142 changes: 0 additions & 142 deletions hw/bsp/mc02/config/7dofengineer.config

This file was deleted.

61 changes: 22 additions & 39 deletions hw/bsp/mc02/config/blink.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# CONFIG_auto_generated_config_prefix_board-esp32-c3-arduino is not set
# CONFIG_auto_generated_config_prefix_board-esp32-c3-idf is not set
# CONFIG_auto_generated_config_prefix_board-f103_can is not set
# CONFIG_auto_generated_config_prefix_board-f334_supercap is not set
# CONFIG_auto_generated_config_prefix_board-mangopi_r818 is not set
CONFIG_auto_generated_config_prefix_board-mc02=y
# CONFIG_auto_generated_config_prefix_board-microswitch is not set
Expand All @@ -12,6 +11,10 @@ CONFIG_auto_generated_config_prefix_board-mc02=y
# CONFIG_auto_generated_config_prefix_board-node_imu is not set
# CONFIG_auto_generated_config_prefix_board-rm-c is not set
# CONFIG_auto_generated_config_prefix_board-Webots is not set
# CONFIG_auto_generated_config_prefix_board-canfd_imu_bsp is not set
# CONFIG_auto_generated_config_prefix_board-collar is not set
# CONFIG_auto_generated_config_prefix_board-emg-bsp-stm32g431cb is not set
# CONFIG_auto_generated_config_prefix_board-esp32c3_wifi_imu is not set
# CONFIG_auto_generated_config_prefix_system-Bootloader is not set
CONFIG_auto_generated_config_prefix_system-FreeRTOS=y
# CONFIG_auto_generated_config_prefix_system-Linux is not set
Expand All @@ -35,9 +38,9 @@ CONFIG_auto_generated_config_prefix_robot-blink=y
# CONFIG_auto_generated_config_prefix_robot-can_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-custom_controller is not set
# CONFIG_auto_generated_config_prefix_robot-dart is not set
# CONFIG_auto_generated_config_prefix_robot-dev_7darm is not set
# CONFIG_auto_generated_config_prefix_robot-dev_supercap is not set
# CONFIG_auto_generated_config_prefix_robot-drone_gimbal is not set
# CONFIG_auto_generated_config_prefix_robot-engineer is not set
# CONFIG_auto_generated_config_prefix_robot-helm_infantry is not set
# CONFIG_auto_generated_config_prefix_robot-hero is not set
# CONFIG_auto_generated_config_prefix_robot-infantry is not set
# CONFIG_auto_generated_config_prefix_robot-microswitch is not set
Expand All @@ -47,8 +50,8 @@ CONFIG_auto_generated_config_prefix_robot-blink=y
# CONFIG_auto_generated_config_prefix_robot-uart_net_config is not set
# CONFIG_auto_generated_config_prefix_robot-udp_to_uart is not set
# CONFIG_auto_generated_config_prefix_robot-wearlab_imu is not set
# CONFIG_auto_generated_config_prefix_robot-wheelleg_chassis is not set
# CONFIG_auto_generated_config_prefix_robot-wheelleg_gimbal is not set
# CONFIG_auto_generated_config_prefix_robot-robot_collar is not set
# CONFIG_auto_generated_config_prefix_robot-robot_wifi_imu is not set

#
# 组件
Expand All @@ -61,58 +64,38 @@ CONFIG_auto_generated_config_prefix_robot-blink=y
# CONFIG_auto_generated_config_prefix_device-ahrs-9 is not set
# CONFIG_auto_generated_config_prefix_device-ai is not set
CONFIG_auto_generated_config_prefix_device-blink_led=y
CONFIG_auto_generated_config_prefix_device-bmi088=y
CONFIG_DEVICE_BMI088_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-bmi088 is not set
# CONFIG_auto_generated_config_prefix_device-bq27220 is not set
# CONFIG_auto_generated_config_prefix_device-buzzer is not set
# CONFIG_auto_generated_config_prefix_device-can is not set
# CONFIG_auto_generated_config_prefix_device-canfd is not set
# CONFIG_auto_generated_config_prefix_device-cap is not set
# CONFIG_auto_generated_config_prefix_device-custom_controller is not set
CONFIG_auto_generated_config_prefix_device-dr16=y
CONFIG_DEVICE_DR16_TASK_STACK_DEPTH=256
# CONFIG_auto_generated_config_prefix_device-dev_bw16 is not set
# CONFIG_auto_generated_config_prefix_device-dr16 is not set
# CONFIG_auto_generated_config_prefix_device-icm42688 is not set
# CONFIG_auto_generated_config_prefix_device-imu is not set
# CONFIG_auto_generated_config_prefix_device-ina226 is not set
CONFIG_auto_generated_config_prefix_device-ins=y
CONFIG_DEVICE_QEKFIns_TASK_STACK_DEPTH=1024
# CONFIG_auto_generated_config_prefix_device-laser is not set
# CONFIG_auto_generated_config_prefix_device-led_rgb is not set
# CONFIG_auto_generated_config_prefix_device-mech is not set
# CONFIG_auto_generated_config_prefix_device-microswitch is not set
# CONFIG_auto_generated_config_prefix_device-mmc5603 is not set
# CONFIG_auto_generated_config_prefix_device-motor is not set
# CONFIG_auto_generated_config_prefix_device-net_config is not set
CONFIG_auto_generated_config_prefix_device-referee=y
CONFIG_DEVICE_REF_TRANS_TASK_STACK_DEPTH=256
CONFIG_DEVICE_REF_RECV_TASK_STACK_DEPTH=256

#
# 裁判系统
#
# CONFIG_REF_VIRTUAL is not set
CONFIG_REF_LAUNCH_SPEED=30
CONFIG_REF_HEAT_LIMIT_17=100
CONFIG_REF_HEAT_LIMIT_42=100
CONFIG_REF_POWER_LIMIT=200
CONFIG_REF_POWER_BUFF=100
# end of 裁判系统

#
# 操作手UI
#
CONFIG_UI_DYNAMIC_CYCLE=20
CONFIG_UI_STATIC_CYCLE=1000
# end of 操作手UI

# CONFIG_auto_generated_config_prefix_device-referee is not set
# CONFIG_auto_generated_config_prefix_device-servo is not set
# CONFIG_auto_generated_config_prefix_device-simulator is not set
# CONFIG_auto_generated_config_prefix_device-spl06_001 is not set
# CONFIG_auto_generated_config_prefix_device-tof is not set
# CONFIG_auto_generated_config_prefix_device-dev_gps is not set
# CONFIG_auto_generated_config_prefix_device-dev_net_config_smartconfig is not set
# CONFIG_auto_generated_config_prefix_device-dev_rdss is not set
# end of 设备

#
# 模块
#
# CONFIG_auto_generated_config_prefix_module-7dof_arm is not set
# CONFIG_auto_generated_config_prefix_module-balance is not set
# CONFIG_auto_generated_config_prefix_module-ble_net_config is not set
# CONFIG_auto_generated_config_prefix_module-canfd_to_uart is not set
Expand All @@ -124,17 +107,17 @@ CONFIG_UI_STATIC_CYCLE=1000
# CONFIG_auto_generated_config_prefix_module-dart_gimbal is not set
# CONFIG_auto_generated_config_prefix_module-dart_launcher is not set
# CONFIG_auto_generated_config_prefix_module-engineer_chassis is not set
# CONFIG_auto_generated_config_prefix_module-free_gimbal is not set
# CONFIG_auto_generated_config_prefix_module-gimbal is not set
# CONFIG_auto_generated_config_prefix_module-helm_chassis is not set
# CONFIG_auto_generated_config_prefix_module-launcher is not set
# CONFIG_auto_generated_config_prefix_module-launcher_can is not set
# CONFIG_auto_generated_config_prefix_module-launcher_drone is not set
# CONFIG_auto_generated_config_prefix_module-microswitch is not set
# CONFIG_auto_generated_config_prefix_module-ore_collect is not set
CONFIG_auto_generated_config_prefix_module-performance=y
# CONFIG_auto_generated_config_prefix_module-super_cap_buck is not set
# CONFIG_auto_generated_config_prefix_module-topic_share_uart is not set
# CONFIG_auto_generated_config_prefix_module-uart_update is not set
# CONFIG_auto_generated_config_prefix_module-wheel_leg is not set
# CONFIG_auto_generated_config_prefix_module-wheel_leg_eigen is not set
# CONFIG_auto_generated_config_prefix_module-wheel_leg_gimbal is not set
# CONFIG_auto_generated_config_prefix_module-canfd_imu is not set
# CONFIG_auto_generated_config_prefix_module-collar_ctrl is not set
# CONFIG_auto_generated_config_prefix_module-mod_research_imu is not set
# end of 模块
7 changes: 3 additions & 4 deletions hw/bsp/mc02/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ add_library(${PROJECT_NAME} STATIC)

target_sources(${PROJECT_NAME} PRIVATE ${${PROJECT_NAME}_SOURCES})

include(${MCU_DIR}/default/CMakeLists.txt)

target_link_libraries(
${PROJECT_NAME}
PRIVATE hal
PUBLIC flash
PUBLIC rtos
PUBLIC usb
PUBLIC armtool
)

target_include_directories(
Expand All @@ -22,13 +23,11 @@ target_include_directories(
PUBLIC $<TARGET_PROPERTY:flash,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<TARGET_PROPERTY:rtos,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<TARGET_PROPERTY:usb,INTERFACE_INCLUDE_DIRECTORIES>
PRIVATE $<TARGET_PROPERTY:armtool,INTERFACE_INCLUDE_DIRECTORIES>
)

add_dependencies(${PROJECT_NAME} hal flash rtos usb armtool)
add_dependencies(${PROJECT_NAME} hal flash rtos usb)

add_subdirectory(${BOARD_DIR}/drivers/hal)
add_subdirectory(${BOARD_DIR}/drivers/rtos)
add_subdirectory(${BOARD_DIR}/drivers/usb)
add_subdirectory(${BOARD_DIR}/drivers/flash)
add_subdirectory(${BOARD_DIR}/drivers/armtoolbox)
26 changes: 0 additions & 26 deletions hw/bsp/mc02/drivers/armtoolbox/CMakeLists.txt

This file was deleted.

3 changes: 1 addition & 2 deletions hw/bsp/mc02/drivers/bsp.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "bsp.h"

#include "bsp_dwt.h"
#include "bsp_uart.h"
#include "main.h"
#include "stm32h7xx_hal_tim.h"
#include "stm32h7xx_it.h"

extern TIM_HandleTypeDef htim23;
void bsp_init(void) {
HAL_Init();
Expand Down Expand Up @@ -34,6 +34,5 @@ void bsp_init(void) {
MX_USB_OTG_HS_PCD_Init();
MX_TIM7_Init();
MX_SPI6_Init();
DWT_Init(550); // 喵喵时钟频率550MHz
HAL_TIM_Base_Stop_IT(&htim23);
}
Loading

0 comments on commit 5305575

Please sign in to comment.