枚举失败

This commit is contained in:
2025-09-21 19:13:30 +08:00
parent 5e47755b58
commit 7c6cf37073
5 changed files with 70 additions and 14 deletions

View File

@@ -28,7 +28,16 @@
"Project/Src/MyWinApp",
"Project/Src/rt-thread",
"Project/Src/rt-thread/include",
"Project/Src/zlib"
"Project/Src/zlib",
"Project/Src/NES",
"Project/Src/TinyUSB/examples/device/cdc_dual_ports/src",
"Project/Src/TinyUSB/src/class/cdc",
"Project/Src/TinyUSB/src/common",
"Project/Src/TinyUSB/src/device",
"Project/Src/TinyUSB/src/portable/synopsys/dwc2",
"Project/Src/TinyUSB/src",
"Project/Src/TinyUSB/src/osal",
"Project/Src/TinyUSB/hw"
],
"defines": [
"USE_STDPERIPH_DRIVER",
@@ -36,7 +45,10 @@
"ARM_MATH_CM4",
"__FPU_PRESENT=1",
"__packed=__attribute__((__packed__))",
"__weak=__attribute__((weak))"
"__weak=__attribute__((weak))",
"__RTTHREAD__",
"SOC_SERIES_STM32F4",
"PKG_TINYUSB_DEVICE_ENABLE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "D:/Program Files/arm-gnu-toolchain/bin/arm-none-eabi-gcc",

View File

@@ -12,6 +12,8 @@
#include "stm32f4xx_it.h"
#include "sdio_sd.h"
#include "stdbool.h"
#include "tusb.h"
/** @addtogroup Template_Project
* @{
@@ -192,6 +194,18 @@ void OTG_HS_EP1_OUT_IRQHandler(void)
}
#endif
#if PKG_TINYUSB_DEVICE_ENABLE
void OTG_FS_IRQHandler(void) {
tusb_int_handler(0, true);
}
void OTG_HS_IRQHandler(void) {
tusb_int_handler(1, true);
}
#endif
#else

View File

@@ -99,6 +99,13 @@ void mpu_init(void)
const libc_device_file *g_usart;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ӣ<EFBFBD>25m<35><6D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>֤usbΪ48m<38><6D><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ168m
void reconfig_clock(void) {
RCC_PLLConfig(RCC_PLLSource_HSE, 25, 336, 2, 7);
SystemCoreClock = 168000000;
}
/**
* This function will initial your board.
*/
@@ -106,6 +113,7 @@ void rt_hw_board_init()
{
// NVIC_SetVectorTable(NVIC_VectTab_FLASH,(u32)128*1024);
NVIC_SetVectorTable(NVIC_VectTab_FLASH,(u32)0);
reconfig_clock();
_SysTick_Config (SystemCoreClock/1000);
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1);
LED_Init();

View File

@@ -254,7 +254,7 @@ static void rt_thread_idle_entry(void *parameter)
#endif
rt_thread_idle_excute();
__WFI();
// __WFI();
}
}

View File

@@ -39,7 +39,10 @@ DEF=[
'-D__FPU_PRESENT=1',
# '-D__GNUC__',
'-D__packed=__attribute__((__packed__))',
'-D__weak=__attribute__((weak))'
'-D__weak=__attribute__((weak))',
'-D__RTTHREAD__',
'-DSOC_SERIES_STM32F4',
'-DPKG_TINYUSB_DEVICE_ENABLE',
]
INC=[
@@ -71,7 +74,16 @@ INC=[
'-ISrc/rt-thread/include',
# '-ISrc/sqlite3',
'-ISrc/zlib',
'-ISrc/NES'
'-ISrc/NES',
# '-ISrc/TinyUSB/lib/rt-thread',
'-ISrc/TinyUSB/examples/device/cdc_dual_ports/src',
'-ISrc/TinyUSB/src/class/cdc',
'-ISrc/TinyUSB/src/common',
'-ISrc/TinyUSB/src/device',
'-ISrc/TinyUSB/src/portable/synopsys/dwc2',
'-ISrc/TinyUSB/src',
'-ISrc/TinyUSB/src/osal',
'-ISrc/TinyUSB/hw',
]
SRC_DIR=[
@@ -88,6 +100,11 @@ SRC_DIR=[
'Src/MyWinApp',
'Src/rt-thread/src',
# 'Src/sqlite3',
'Src/TinyUSB/src/class/cdc',
'Src/TinyUSB/src/common',
'Src/TinyUSB/src/device',
'Src/TinyUSB/src/portable/synopsys/dwc2',
# 'Src/TinyUSB/src',
]
SRC=[
@@ -136,6 +153,11 @@ SRC=[
'Src/NES/nes_main.c',
'Src/NES/nes_ppu.c',
'Src/NES/nes_mapper.c',
'Src/TinyUSB/src/tusb.c',
'Src/TinyUSB/lib/rt-thread/tusb_rt_thread_port.c',
'Src/TinyUSB/examples/device/cdc_dual_ports/src/usb_descriptors.c',
'Src/TinyUSB/hw/bsp/board.c'
]
LD_FILE="stm32f429ighx_flash.ld"