mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-14 18:40:37 +00:00
commit
dd30f2c648
@ -50,7 +50,7 @@ The stack supports the following MCUs:
|
|||||||
- **Renesas:** RX63N, RX65N, RX72N
|
- **Renesas:** RX63N, RX65N, RX72N
|
||||||
- **Silabs:** EFM32GG
|
- **Silabs:** EFM32GG
|
||||||
- **Sony:** CXD56
|
- **Sony:** CXD56
|
||||||
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, L0, L1, L4, L4+
|
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, G4, L0, L1, L4, L4+
|
||||||
- **TI:** MSP430, MSP432E4, TM4C123
|
- **TI:** MSP430, MSP432E4, TM4C123
|
||||||
- **ValentyUSB:** eptri
|
- **ValentyUSB:** eptri
|
||||||
|
|
||||||
|
@ -82,6 +82,8 @@ Supported MCUs
|
|||||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||||
| | H7 | ✔ | | ✔ | dwc2 | |
|
| | H7 | ✔ | | ✔ | dwc2 | |
|
||||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||||
|
| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||||
|
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||||
| | L0, L1 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
| | L0, L1 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||||
| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||||
@ -352,6 +354,17 @@ F7
|
|||||||
- `STM32 F767zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f767zi.html>`__
|
- `STM32 F767zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f767zi.html>`__
|
||||||
- `STM32 F769i Discovery <https://www.st.com/en/evaluation-tools/32f769idiscovery.html>`__
|
- `STM32 F769i Discovery <https://www.st.com/en/evaluation-tools/32f769idiscovery.html>`__
|
||||||
|
|
||||||
|
H7
|
||||||
|
^^
|
||||||
|
- `STM32 H743zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-h743zi.html>`__
|
||||||
|
- `STM32 H743i Evaluation <https://www.st.com/en/evaluation-tools/stm32h743i-eval.html>`__
|
||||||
|
- `STM32 H745i Discovery <https://www.st.com/en/evaluation-tools/stm32h745i-disco.html>`__
|
||||||
|
- `Waveshare OpenH743I-C <https://www.waveshare.com/openh743i-c-standard.htm>`__
|
||||||
|
|
||||||
|
G4
|
||||||
|
^^
|
||||||
|
- `STM32 G474RE Nucleo <https://www.st.com/en/evaluation-tools/nucleo-g474re.html>`__
|
||||||
|
|
||||||
L0
|
L0
|
||||||
^^
|
^^
|
||||||
- `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
|
- `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
|
||||||
@ -362,13 +375,6 @@ L4
|
|||||||
- `STM32 L4P5zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4p5zg.html>`__
|
- `STM32 L4P5zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4p5zg.html>`__
|
||||||
- `STM32 L4R5zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html>`__
|
- `STM32 L4R5zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html>`__
|
||||||
|
|
||||||
H7
|
|
||||||
^^
|
|
||||||
- `STM32 H743zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-h743zi.html>`__
|
|
||||||
- `STM32 H743i Evaluation <https://www.st.com/en/evaluation-tools/stm32h743i-eval.html>`__
|
|
||||||
- `STM32 H745i Discovery <https://www.st.com/en/evaluation-tools/stm32h745i-disco.html>`__
|
|
||||||
- `Waveshare OpenH743I-C <https://www.waveshare.com/openh743i-c-standard.htm>`__
|
|
||||||
|
|
||||||
TI
|
TI
|
||||||
--
|
--
|
||||||
|
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
# Install python3 HID package https://pypi.org/project/hid/
|
# Install python3 HID package https://pypi.org/project/hid/
|
||||||
import hid
|
import hid
|
||||||
|
|
||||||
USB_VID = 0xcafe
|
# default is TinyUSB (0xcafe), Adafruit (0x239a), RaspberryPi (0x2e8a), Espressif (0x303a) VID
|
||||||
|
USB_VID = (0xcafe, 0x239a, 0x2e8a, 0x303a)
|
||||||
|
|
||||||
print("Openning HID device with VID = 0x%X" % USB_VID)
|
print("VID list: " + ", ".join('%02x' % v for v in USB_VID))
|
||||||
|
|
||||||
for dict in hid.enumerate(USB_VID):
|
for vid in USB_VID:
|
||||||
print(dict)
|
for dict in hid.enumerate(vid):
|
||||||
dev = hid.Device(dict['vendor_id'], dict['product_id'])
|
print(dict)
|
||||||
if dev:
|
dev = hid.Device(dict['vendor_id'], dict['product_id'])
|
||||||
while True:
|
if dev:
|
||||||
# Get input from console and encode to UTF8 for array of chars.
|
while True:
|
||||||
# hid generic inout is single report therefore by HIDAPI requirement
|
# Get input from console and encode to UTF8 for array of chars.
|
||||||
# it must be preceeded with 0x00 as dummy reportID
|
# hid generic inout is single report therefore by HIDAPI requirement
|
||||||
str_out = b'\x00'
|
# it must be preceeded with 0x00 as dummy reportID
|
||||||
str_out += input("Send text to HID Device : ").encode('utf-8')
|
str_out = b'\x00'
|
||||||
dev.write(str_out)
|
str_out += input("Send text to HID Device : ").encode('utf-8')
|
||||||
str_in = dev.read(64)
|
dev.write(str_out)
|
||||||
print("Received from HID Device:", str_in, '\n')
|
str_in = dev.read(64)
|
||||||
|
print("Received from HID Device:", str_in, '\n')
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// G474RE Nucleo does not has usb connection. We need to manually connect
|
// G474RE Nucleo does not has usb connection. We need to manually connect
|
||||||
// - PA11 for D+, CN10.14
|
// - PA12 for D+, CN10.12
|
||||||
// - PA12 for D-, CN10.12
|
// - PA11 for D-, CN10.14
|
||||||
|
|
||||||
// LED
|
// LED
|
||||||
#define LED_PORT GPIOA
|
#define LED_PORT GPIOA
|
||||||
@ -61,32 +61,36 @@ static inline void board_clock_init(void)
|
|||||||
{
|
{
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||||
|
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||||
|
|
||||||
// Configure the main internal regulator output voltage
|
// Configure the main internal regulator output voltage
|
||||||
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
|
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
|
||||||
|
|
||||||
// Initializes the CPU, AHB and APB busses clocks
|
// Initializes the CPU, AHB and APB busses clocks
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||||
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4;
|
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4;
|
||||||
RCC_OscInitStruct.PLL.PLLN = 85;
|
RCC_OscInitStruct.PLL.PLLN = 50;
|
||||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||||
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
|
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
|
||||||
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
||||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||||
|
|
||||||
// Initializes the CPU, AHB and APB busses clocks
|
// Initializes the CPU, AHB and APB busses clocks
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||||
|
|
||||||
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_8);
|
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_8);
|
||||||
|
|
||||||
|
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
|
||||||
|
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
|
||||||
|
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) ;
|
||||||
|
|
||||||
#if 0 // TODO need to check if USB clock is enabled
|
#if 0 // TODO need to check if USB clock is enabled
|
||||||
/* Enable HSI48 */
|
/* Enable HSI48 */
|
||||||
memset(&RCC_OscInitStruct, 0, sizeof(RCC_OscInitStruct));
|
memset(&RCC_OscInitStruct, 0, sizeof(RCC_OscInitStruct));
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
CFLAGS += -DSTM32G474xx
|
CFLAGS += \
|
||||||
|
-DSTM32G474xx \
|
||||||
|
-DHSE_VALUE=24000000
|
||||||
|
|
||||||
LD_FILE = $(BOARD_PATH)/STM32G474RETx_FLASH.ld
|
LD_FILE = $(BOARD_PATH)/STM32G474RETx_FLASH.ld
|
||||||
|
|
||||||
|
@ -118,13 +118,13 @@ void board_init(void)
|
|||||||
|
|
||||||
// USB Pins TODO double check USB clock and pin setup
|
// USB Pins TODO double check USB clock and pin setup
|
||||||
// Configure USB DM and DP pins. This is optional, and maintained only for user guidance.
|
// Configure USB DM and DP pins. This is optional, and maintained only for user guidance.
|
||||||
// GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
|
GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
|
||||||
// GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||||
// GPIO_InitStruct.Pull = GPIO_NOPULL;
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
// GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
// HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
//
|
|
||||||
// __HAL_RCC_USB_CLK_ENABLE();
|
__HAL_RCC_USB_CLK_ENABLE();
|
||||||
|
|
||||||
board_vbus_sense_init();
|
board_vbus_sense_init();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user