Просмотр исходного кода

Merge branch 'master' into port-ft90x

Ha Thach 4 лет назад
Родитель
Сommit
efc29baead
100 измененных файлов с 509 добавлено и 73 удалено
  1. 1 1
      .github/workflows/build_aarch64.yml
  2. 2 1
      .github/workflows/build_arm.yml
  3. 1 1
      .github/workflows/build_esp.yml
  4. 2 0
      .gitignore
  5. 1 1
      README.rst
  6. 15 7
      docs/reference/supported.rst
  7. 0 0
      examples/device/audio_4_channel_mic/.skip.MCU_SAMD11
  8. 0 0
      examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
  9. 0 0
      examples/device/audio_4_channel_mic/.skip.MCU_SAMG
  10. 3 0
      examples/device/audio_4_channel_mic/skip.txt
  11. 0 0
      examples/device/audio_test/.skip.MCU_SAMD11
  12. 0 0
      examples/device/audio_test/.skip.MCU_SAME5X
  13. 0 0
      examples/device/audio_test/.skip.MCU_SAMG
  14. 3 0
      examples/device/audio_test/skip.txt
  15. 0 0
      examples/device/cdc_msc/.skip.MCU_SAMD11
  16. 1 0
      examples/device/cdc_msc/skip.txt
  17. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_BCM2711
  18. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_CXD56
  19. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103
  20. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX
  21. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx
  22. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_RP2040
  23. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_SAMD11
  24. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X
  25. 0 0
      examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI
  26. 10 0
      examples/device/cdc_msc_freertos/skip.txt
  27. 0 4
      examples/device/dfu/.skip.MCU_TM4C123
  28. 2 0
      examples/device/dfu/skip.txt
  29. 0 0
      examples/device/dynamic_configuration/.skip.MCU_SAMD11
  30. 1 0
      examples/device/dynamic_configuration/skip.txt
  31. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_BCM2711
  32. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_CXD56
  33. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_GD32VF103
  34. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx
  35. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_RP2040
  36. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_SAMD11
  37. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_SAMX7X
  38. 0 0
      examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI
  39. 9 0
      examples/device/hid_composite_freertos/skip.txt
  40. 17 15
      examples/device/hid_generic_inout/hid_test.py
  41. 0 0
      examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX
  42. 0 0
      examples/device/msc_dual_lun/.skip.MCU_SAMD11
  43. 2 0
      examples/device/msc_dual_lun/skip.txt
  44. 0 1
      examples/device/net_lwip_webserver/.skip.MCU_BCM2711
  45. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX
  46. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_LPC13XX
  47. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX
  48. 0 1
      examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx
  49. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_NUC121
  50. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_SAMD11
  51. 0 0
      examples/device/net_lwip_webserver/.skip.MCU_STM32L0
  52. 10 0
      examples/device/net_lwip_webserver/skip.txt
  53. 0 0
      examples/device/uac2_headset/.skip.MCU_LPC11UXX
  54. 0 0
      examples/device/uac2_headset/.skip.MCU_LPC13XX
  55. 0 0
      examples/device/uac2_headset/.skip.MCU_NUC121
  56. 0 0
      examples/device/uac2_headset/.skip.MCU_SAMD11
  57. 0 0
      examples/device/uac2_headset/.skip.MCU_SAME5X
  58. 0 0
      examples/device/uac2_headset/.skip.MCU_SAMG
  59. 6 0
      examples/device/uac2_headset/skip.txt
  60. 1 0
      examples/device/usbtmc/skip.txt
  61. 0 1
      examples/device/video_capture/.skip.MCU_MSP430x5xx
  62. 0 0
      examples/device/video_capture/.skip.MCU_SAMD11
  63. 2 0
      examples/device/video_capture/skip.txt
  64. 0 0
      examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X
  65. 0 0
      examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X
  66. 0 0
      examples/host/cdc_msc_hid/.only.MCU_LPC18XX
  67. 0 0
      examples/host/cdc_msc_hid/.only.MCU_LPC40XX
  68. 0 0
      examples/host/cdc_msc_hid/.only.MCU_LPC43XX
  69. 0 0
      examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX
  70. 0 0
      examples/host/cdc_msc_hid/.only.MCU_MSP432E4
  71. 0 0
      examples/host/cdc_msc_hid/.only.MCU_RP2040
  72. 8 0
      examples/host/cdc_msc_hid/only.txt
  73. 0 0
      examples/host/hid_controller/.only.MCU_LPC175X_6X
  74. 0 0
      examples/host/hid_controller/.only.MCU_LPC177X_8X
  75. 0 0
      examples/host/hid_controller/.only.MCU_LPC18XX
  76. 0 0
      examples/host/hid_controller/.only.MCU_LPC40XX
  77. 0 0
      examples/host/hid_controller/.only.MCU_LPC43XX
  78. 0 0
      examples/host/hid_controller/.only.MCU_MIMXRT10XX
  79. 0 0
      examples/host/hid_controller/.only.MCU_MSP432E4
  80. 0 0
      examples/host/hid_controller/.only.MCU_RP2040
  81. 8 0
      examples/host/hid_controller/only.txt
  82. 3 1
      examples/make.mk
  83. 8 2
      examples/rules.mk
  84. 4 1
      hw/bsp/board_mcu.h
  85. 0 0
      hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.h
  86. 5 0
      hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk
  87. 22 10
      hw/bsp/broadcom_32bit/family.c
  88. 46 0
      hw/bsp/broadcom_32bit/family.mk
  89. 38 0
      hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h
  90. 3 0
      hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk
  91. 38 0
      hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h
  92. 3 0
      hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk
  93. 156 0
      hw/bsp/broadcom_64bit/family.c
  94. 7 12
      hw/bsp/broadcom_64bit/family.mk
  95. 7 2
      hw/bsp/esp32s2/boards/esp32s2.c
  96. 7 2
      hw/bsp/esp32s3/boards/esp32s3.c
  97. 0 10
      hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake
  98. 7 0
      hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.cmake
  99. 43 0
      hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.h
  100. 7 0
      hw/bsp/esp32s3/boards/espressif_s3_devkitm/board.cmake

+ 1 - 1
.github/workflows/build_aarch64.yml

@@ -18,7 +18,7 @@ jobs:
       matrix:
         family:
         # Alphabetical order
-        - 'raspberrypi4'
+        - 'broadcom_64bit'
     steps:
     - name: Setup Python
       uses: actions/setup-python@v2

+ 2 - 1
.github/workflows/build_arm.yml

@@ -39,6 +39,7 @@ jobs:
       matrix:
         family:
         # Alphabetical order
+        - 'broadcom_32bit'
         - 'imxrt'
         - 'lpc15'
         - 'lpc18'
@@ -114,7 +115,7 @@ jobs:
         done
 
   # ---------------------------------------
-  # Build all no-family (opharned) boards
+  # Build all no-family (orphaned) boards
   # ---------------------------------------
   build-board:
     runs-on: ubuntu-latest

+ 1 - 1
.github/workflows/build_esp.yml

@@ -18,7 +18,7 @@ jobs:
         # ESP32-S2
         - 'espressif_saola_1'
         # ESP32-S3
-        #- 'espressif_addax_1'
+        #- 'espressif_s3_devkitm'
         # S3 compile error with "dangerous relocation: call8: call target out of range: memcpy"
 
     steps:

+ 2 - 0
.gitignore

@@ -26,3 +26,5 @@ cov-int
 # cppcheck build directories
 *-build-dir
 /_bin/
+__pycache__
+

+ 1 - 1
README.rst

@@ -50,7 +50,7 @@ The stack supports the following MCUs:
 - **Renesas:** RX63N, RX65N, RX72N
 - **Silabs:** EFM32GG
 - **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
 - **ValentyUSB:** eptri
 

+ 15 - 7
docs/reference/supported.rst

@@ -82,6 +82,8 @@ Supported MCUs
 |              +-----------------------+--------+------+-----------+-------------------+--------------+
 |              | H7                    | ✔      |      | ✔         | dwc2              |              |
 |              +-----------------------+--------+------+-----------+-------------------+--------------+
+|              | G4                    | ✔      | ✖    | ✖         | stm32_fsdev       |              |
+|              +-----------------------+--------+------+-----------+-------------------+--------------+
 |              | L0, L1                | ✔      | ✖    | ✖         | stm32_fsdev       |              |
 |              +----+------------------+--------+------+-----------+-------------------+--------------+
 |              | L4 | 4x2, 4x3         | ✔      | ✖    | ✖         | stm32_fsdev       |              |
@@ -243,6 +245,7 @@ Kinetis
 
 -  `Freedom FRDM-KL25Z <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z>`__
 -  `Freedom FRDM-K32L2B3 <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/nxp-freedom-development-platform-for-k32-l2b-mcus:FRDM-K32L2B3>`__
+-  `KUIIC <https://github.com/nxf58843/kuiic>`__
 
 LPC 11-13-15
 ^^^^^^^^^^^^
@@ -341,6 +344,7 @@ F4
 -  `STM32 F411ve Discovery <https://www.st.com/en/evaluation-tools/32f411ediscovery.html>`__
 -  `STM32 F412zg Discovery <https://www.st.com/en/evaluation-tools/32f412gdiscovery.html>`__
 -  `STM32 F412zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f412zg.html>`__
+-  `STM32 F439zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f439zi.html>`__
 
 F7
 ^^
@@ -352,6 +356,17 @@ F7
 -  `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>`__
 
+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
 ^^
 -  `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
@@ -362,13 +377,6 @@ L4
 -  `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>`__
 
-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
 --
 

+ 0 - 0
examples/device/audio_4_channel_mic/.skip.MCU_SAMD11


+ 0 - 0
examples/device/audio_4_channel_mic/.skip.MCU_SAME5X


+ 0 - 0
examples/device/audio_4_channel_mic/.skip.MCU_SAMG


+ 3 - 0
examples/device/audio_4_channel_mic/skip.txt

@@ -0,0 +1,3 @@
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG

+ 0 - 0
examples/device/audio_test/.skip.MCU_SAMD11


+ 0 - 0
examples/device/audio_test/.skip.MCU_SAME5X


+ 0 - 0
examples/device/audio_test/.skip.MCU_SAMG


+ 3 - 0
examples/device/audio_test/skip.txt

@@ -0,0 +1,3 @@
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG

+ 0 - 0
examples/device/cdc_msc/.skip.MCU_SAMD11


+ 1 - 0
examples/device/cdc_msc/skip.txt

@@ -0,0 +1 @@
+mcu:SAMD11

+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_BCM2711


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_CXD56


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_RP2040


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_SAMD11


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X


+ 0 - 0
examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI


+ 10 - 0
examples/device/cdc_msc_freertos/skip.txt

@@ -0,0 +1,10 @@
+mcu:CXD56
+mcu:MSP430x5xx
+mcu:SAMD11
+mcu:VALENTYUSB_EPTRI
+mcu:MKL25ZXX
+mcu:RP2040
+mcu:SAMX7X
+mcu:GD32VF103
+family:broadcom_64bit
+family:broadcom_32bit

+ 0 - 4
examples/device/dfu/.skip.MCU_TM4C123

@@ -1,4 +0,0 @@
-LINK _build/ek-tm4c123gxl/dfu.elf
-/home/runner/cache/toolchain/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx.text._close LMA [0000000000002980,0000000000002987] overlaps section .data LMA [0000000000002980,0000000000002a03]
-collect2: error: ld returned 1 exit status
-make: *** [../../rules.mk:94: _build/ek-tm4c123gxl/dfu.elf] Error 1

+ 2 - 0
examples/device/dfu/skip.txt

@@ -0,0 +1,2 @@
+mcu:TM4C123
+mcu:BCM2835

+ 0 - 0
examples/device/dynamic_configuration/.skip.MCU_SAMD11


+ 1 - 0
examples/device/dynamic_configuration/skip.txt

@@ -0,0 +1 @@
+mcu:SAMD11

+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_BCM2711


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_CXD56


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_GD32VF103


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_RP2040


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_SAMD11


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_SAMX7X


+ 0 - 0
examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI


+ 9 - 0
examples/device/hid_composite_freertos/skip.txt

@@ -0,0 +1,9 @@
+mcu:CXD56
+mcu:MSP430x5xx
+mcu:SAMD11
+mcu:VALENTYUSB_EPTRI
+mcu:RP2040
+mcu:SAMX7X
+mcu:GD32VF103
+family:broadcom_64bit
+family:broadcom_32bit

+ 17 - 15
examples/device/hid_generic_inout/hid_test.py

@@ -1,20 +1,22 @@
 # Install python3 HID package https://pypi.org/project/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):
-    print(dict)
-    dev = hid.Device(dict['vendor_id'], dict['product_id'])
-    if dev:
-        while True:
-            # Get input from console and encode to UTF8 for array of chars.
-            # hid generic inout is single report therefore by HIDAPI requirement
-            # it must be preceeded with 0x00 as dummy reportID
-            str_out = b'\x00'
-            str_out += input("Send text to HID Device : ").encode('utf-8')
-            dev.write(str_out)
-            str_in = dev.read(64)
-            print("Received from HID Device:", str_in, '\n')
+for vid in  USB_VID:
+    for dict in hid.enumerate(vid):
+        print(dict)
+        dev = hid.Device(dict['vendor_id'], dict['product_id'])
+        if dev:
+            while True:
+                # Get input from console and encode to UTF8 for array of chars.
+                # hid generic inout is single report therefore by HIDAPI requirement
+                # it must be preceeded with 0x00 as dummy reportID
+                str_out = b'\x00'
+                str_out += input("Send text to HID Device : ").encode('utf-8')
+                dev.write(str_out)
+                str_in = dev.read(64)
+                print("Received from HID Device:", str_in, '\n')

+ 0 - 0
examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX


+ 0 - 0
examples/device/msc_dual_lun/.skip.MCU_SAMD11


+ 2 - 0
examples/device/msc_dual_lun/skip.txt

@@ -0,0 +1,2 @@
+mcu:SAMD11
+mcu:MKL25ZXX

+ 0 - 1
examples/device/net_lwip_webserver/.skip.MCU_BCM2711

@@ -1 +0,0 @@
-tinyusb/lib/lwip/src/include/lwip/arch.h:202:13: error: conflicting types for 'ssize_t'

+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX


+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_LPC13XX


+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX


+ 0 - 1
examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx

@@ -1 +0,0 @@
-too many warnings for 16-bit integer overflow

+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_NUC121


+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_SAMD11


+ 0 - 0
examples/device/net_lwip_webserver/.skip.MCU_STM32L0


+ 10 - 0
examples/device/net_lwip_webserver/skip.txt

@@ -0,0 +1,10 @@
+mcu:LPC11UXX
+mcu:LPC13XX
+mcu:MSP430x5xx
+mcu:NUC121
+mcu:SAMD11
+mcu:STM32L0
+mcu:MKL25ZXX
+family:broadcom_64bit
+family:broadcom_32bit
+board:curiosity_nano

+ 0 - 0
examples/device/uac2_headset/.skip.MCU_LPC11UXX


+ 0 - 0
examples/device/uac2_headset/.skip.MCU_LPC13XX


+ 0 - 0
examples/device/uac2_headset/.skip.MCU_NUC121


+ 0 - 0
examples/device/uac2_headset/.skip.MCU_SAMD11


+ 0 - 0
examples/device/uac2_headset/.skip.MCU_SAME5X


+ 0 - 0
examples/device/uac2_headset/.skip.MCU_SAMG


+ 6 - 0
examples/device/uac2_headset/skip.txt

@@ -0,0 +1,6 @@
+mcu:LPC11UXX
+mcu:LPC13XX
+mcu:NUC121
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG

+ 1 - 0
examples/device/usbtmc/skip.txt

@@ -0,0 +1 @@
+mcu:BCM2835

+ 0 - 1
examples/device/video_capture/.skip.MCU_MSP430x5xx

@@ -1 +0,0 @@
-too many warnings for 16-bit integer overflow

+ 0 - 0
examples/device/video_capture/.skip.MCU_SAMD11


+ 2 - 0
examples/device/video_capture/skip.txt

@@ -0,0 +1,2 @@
+mcu:MSP430x5xx
+mcu:SAMD11

+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_LPC18XX


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_LPC40XX


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_LPC43XX


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_MSP432E4


+ 0 - 0
examples/host/cdc_msc_hid/.only.MCU_RP2040


+ 8 - 0
examples/host/cdc_msc_hid/only.txt

@@ -0,0 +1,8 @@
+mcu:LPC175X_6X
+mcu:LPC177X_8X
+mcu:LPC18XX
+mcu:LPC40XX
+mcu:LPC43XX
+mcu:MIMXRT10XX
+mcu:RP2040
+mcu:MSP432E4

+ 0 - 0
examples/host/hid_controller/.only.MCU_LPC175X_6X


+ 0 - 0
examples/host/hid_controller/.only.MCU_LPC177X_8X


+ 0 - 0
examples/host/hid_controller/.only.MCU_LPC18XX


+ 0 - 0
examples/host/hid_controller/.only.MCU_LPC40XX


+ 0 - 0
examples/host/hid_controller/.only.MCU_LPC43XX


+ 0 - 0
examples/host/hid_controller/.only.MCU_MIMXRT10XX


+ 0 - 0
examples/host/hid_controller/.only.MCU_MSP432E4


+ 0 - 0
examples/host/hid_controller/.only.MCU_RP2040


+ 8 - 0
examples/host/hid_controller/only.txt

@@ -0,0 +1,8 @@
+mcu:LPC175X_6X
+mcu:LPC177X_8X
+mcu:LPC18XX
+mcu:LPC40XX
+mcu:LPC43XX
+mcu:MIMXRT10XX
+mcu:RP2040
+mcu:MSP432E4

+ 3 - 1
examples/make.mk

@@ -54,6 +54,8 @@ endif
 #-------------- Cross Compiler  ------------
 # Can be set by board, default to ARM GCC
 CROSS_COMPILE ?= arm-none-eabi-
+# Allow for -Os to be changed by board makefiles in case -Os is not allowed
+CFLAGS_OPTIMIZED ?= -Os
 
 CC = $(CROSS_COMPILE)gcc
 CXX = $(CROSS_COMPILE)g++
@@ -112,7 +114,7 @@ CFLAGS += \
 ifeq ($(DEBUG), 1)
   CFLAGS += -Og
 else
-  CFLAGS += -Os
+  CFLAGS += $(CFLAGS_OPTIMIZED)
 endif
 
 # Log level is mapped to TUSB DEBUG option

+ 8 - 2
examples/rules.mk

@@ -12,8 +12,10 @@ ifeq (,$(findstring $(FAMILY),esp32s2 esp32s3 rp2040))
 # Compiler Flags
 # ---------------------------------------
 
+LIBS_GCC ?= -lgcc -lm -lnosys
+
 # libc
-LIBS += -lgcc -lm -lnosys
+LIBS += $(LIBS_GCC)
 
 ifneq ($(BOARD), spresense)
 LIBS += -lc
@@ -49,7 +51,11 @@ ifeq ($(NO_LTO),1)
 CFLAGS := $(filter-out -flto,$(CFLAGS))
 endif
 
-LDFLAGS += $(CFLAGS) -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
+ifneq ($(LD_FILE),)
+LDFLAGS_LD_FILE ?= -Wl,-T,$(TOP)/$(LD_FILE)
+endif
+
+LDFLAGS += $(CFLAGS) $(LDFLAGS_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
 ifneq ($(SKIP_NANOLIB), 1)
 LDFLAGS += -specs=nosys.specs -specs=nano.specs
 endif

+ 4 - 1
hw/bsp/board_mcu.h

@@ -32,7 +32,7 @@
 
 //--------------------------------------------------------------------+
 // Low Level MCU header include. TinyUSB stack and example should be
-// platform independent and mostly doens't need to include this file.
+// platform independent and mostly doesn't need to include this file.
 // However there are still certain situation where this file is needed:
 // - FreeRTOSConfig.h to set up correct clock and NVIC interrupts for ARM Cortex
 // - SWO logging for Cortex M with ITM_SendChar() / ITM_ReceiveChar()
@@ -146,6 +146,9 @@
 #elif CFG_TUSB_MCU == OPT_MCU_TM4C123
   #include "TM4C123.h"
 
+#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
+  // no header needed
+
 #else
   #error "Missing MCU header"
 #endif

+ 0 - 0
hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.h → hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.h


+ 5 - 0
hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk

@@ -0,0 +1,5 @@
+CFLAGS += -mcpu=arm1176jzf-s \
+          -DBCM_VERSION=2835 \
+          -DCFG_TUSB_MCU=OPT_MCU_BCM2835
+
+SUFFIX = 

+ 22 - 10
hw/bsp/raspberrypi4/family.c → hw/bsp/broadcom_32bit/family.c

@@ -27,8 +27,9 @@
 #include "bsp/board.h"
 #include "board.h"
 
+#include "broadcom/cpu.h"
+#include "broadcom/gpio.h"
 #include "broadcom/interrupts.h"
-#include "broadcom/io.h"
 #include "broadcom/mmu.h"
 #include "broadcom/caches.h"
 #include "broadcom/vcmailbox.h"
@@ -37,9 +38,8 @@
 #define LED_PIN               18
 #define LED_STATE_ON          1
 
-// Button
-#define BUTTON_PIN            16
-#define BUTTON_STATE_ACTIVE   0
+// UART TX
+#define UART_TX_PIN           14
 
 //--------------------------------------------------------------------+
 // Forward USB interrupt events to TinyUSB IRQ Handler
@@ -62,14 +62,26 @@ void board_init(void)
   init_caches();
 
   // LED
-  gpio_initOutputPinWithPullNone(LED_PIN);
+  gpio_set_function(LED_PIN, GPIO_FUNCTION_OUTPUT);
+  gpio_set_pull(LED_PIN, BP_PULL_NONE);
   board_led_write(true);
 
-  // Button
-  // TODO
-
   // Uart
-  uart_init();
+  COMPLETE_MEMORY_READS;
+  AUX->ENABLES_b.UART_1 = true;
+
+  UART1->IER = 0;
+  UART1->CNTL = 0;
+  UART1->LCR_b.DATA_SIZE = UART1_LCR_DATA_SIZE_MODE_8BIT;
+  UART1->MCR = 0;
+  UART1->IER = 0;
+
+  uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE);
+  UART1->BAUD = ((source_clock / (115200 * 8)) - 1);
+  UART1->CNTL |= UART1_CNTL_TX_ENABLE_Msk;
+  COMPLETE_MEMORY_READS;
+
+  gpio_set_function(UART_TX_PIN, GPIO_FUNCTION_ALT5);
 
   // Turn on USB peripheral.
   vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
@@ -87,7 +99,7 @@ void board_init(void)
 
 void board_led_write(bool state)
 {
-  gpio_setPinOutputBool(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
+  gpio_set_value(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
 }
 
 uint32_t board_button_read(void)

+ 46 - 0
hw/bsp/broadcom_32bit/family.mk

@@ -0,0 +1,46 @@
+MCU_DIR = hw/mcu/broadcom
+DEPS_SUBMODULES += $(MCU_DIR)
+
+include $(TOP)/$(BOARD_PATH)/board.mk
+
+CFLAGS += \
+	-Wall \
+	-O0 \
+	-ffreestanding \
+	-nostdlib \
+	-nostartfiles \
+	-mgeneral-regs-only \
+	-fno-exceptions \
+	-std=c17
+
+CROSS_COMPILE = arm-none-eabi-
+
+# mcu driver cause following warnings
+CFLAGS += -Wno-error=cast-qual
+
+SRC_C += \
+	src/portable/synopsys/dwc2/dcd_dwc2.c \
+	$(MCU_DIR)/broadcom/gen/interrupt_handlers.c \
+	$(MCU_DIR)/broadcom/gpio.c \
+	$(MCU_DIR)/broadcom/interrupts.c \
+	$(MCU_DIR)/broadcom/mmu.c \
+	$(MCU_DIR)/broadcom/caches.c \
+	$(MCU_DIR)/broadcom/vcmailbox.c
+
+SKIP_NANOLIB = 1
+
+LD_FILE = $(MCU_DIR)/broadcom/link$(SUFFIX).ld
+
+INC += \
+	$(TOP)/$(BOARD_PATH) \
+	$(TOP)/$(MCU_DIR)
+
+SRC_S += $(MCU_DIR)/broadcom/boot$(SUFFIX).S
+
+$(BUILD)/kernel$(SUFFIX).img: $(BUILD)/$(PROJECT).elf
+	$(OBJCOPY) -O binary $^ $@
+
+# Copy to kernel to netboot drive or SD card
+# Change destinaation to fit your need
+flash: $(BUILD)/kernel$(SUFFIX).img
+	@$(CP) $< /home/$(USER)/Documents/code/pi_tinyusb/boot_cpy

+ 38 - 0
hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h

@@ -0,0 +1,38 @@
+/* 
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef BOARD_H_
+#define BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* BOARD_H_ */

+ 3 - 0
hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk

@@ -0,0 +1,3 @@
+CFLAGS += -mcpu=cortex-a72 \
+          -DBCM_VERSION=2711 \
+          -DCFG_TUSB_MCU=OPT_MCU_BCM2711

+ 38 - 0
hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h

@@ -0,0 +1,38 @@
+/* 
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef BOARD_H_
+#define BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* BOARD_H_ */

+ 3 - 0
hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk

@@ -0,0 +1,3 @@
+CFLAGS += -mcpu=cortex-a53 \
+          -DBCM_VERSION=2837 \
+          -DCFG_TUSB_MCU=OPT_MCU_BCM2837

+ 156 - 0
hw/bsp/broadcom_64bit/family.c

@@ -0,0 +1,156 @@
+/* 
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#include "bsp/board.h"
+#include "board.h"
+
+#include "broadcom/cpu.h"
+#include "broadcom/gpio.h"
+#include "broadcom/interrupts.h"
+#include "broadcom/mmu.h"
+#include "broadcom/caches.h"
+#include "broadcom/vcmailbox.h"
+
+// LED
+#define LED_PIN               18
+#define LED_STATE_ON          1
+
+// UART TX
+#define UART_TX_PIN           14
+
+//--------------------------------------------------------------------+
+// Forward USB interrupt events to TinyUSB IRQ Handler
+//--------------------------------------------------------------------+
+void USB_IRQHandler(void)
+{
+  tud_int_handler(0);
+}
+
+//--------------------------------------------------------------------+
+// MACRO TYPEDEF CONSTANT ENUM
+//--------------------------------------------------------------------+
+
+//--------------------------------------------------------------------+
+// Board porting API
+//--------------------------------------------------------------------+
+void board_init(void)
+{
+  setup_mmu_flat_map();
+  init_caches();
+
+  // LED
+  gpio_set_function(LED_PIN, GPIO_FUNCTION_OUTPUT);
+  gpio_set_pull(LED_PIN, BP_PULL_NONE);
+  board_led_write(true);
+
+  // Uart
+  COMPLETE_MEMORY_READS;
+  AUX->ENABLES_b.UART_1 = true;
+
+  UART1->IER = 0;
+  UART1->CNTL = 0;
+  UART1->LCR_b.DATA_SIZE = UART1_LCR_DATA_SIZE_MODE_8BIT;
+  UART1->MCR = 0;
+  UART1->IER = 0;
+
+  uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE);
+  UART1->BAUD = ((source_clock / (115200 * 8)) - 1);
+  UART1->CNTL |= UART1_CNTL_TX_ENABLE_Msk;
+  COMPLETE_MEMORY_READS;
+
+  gpio_set_function(UART_TX_PIN, GPIO_FUNCTION_ALT5);
+
+  // Turn on USB peripheral.
+  vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
+
+  // Timer 1/1024 second tick
+  SYSTMR->CS_b.M1 = 1;
+  SYSTMR->C1 = SYSTMR->CLO + 977;
+  BP_EnableIRQ(TIMER_1_IRQn);
+
+  BP_SetPriority(USB_IRQn, 0x00);
+  BP_ClearPendingIRQ(USB_IRQn);
+  BP_EnableIRQ(USB_IRQn);
+  BP_EnableIRQs();
+}
+
+void board_led_write(bool state)
+{
+  gpio_set_value(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
+}
+
+uint32_t board_button_read(void)
+{
+  return 0;
+}
+
+int board_uart_read(uint8_t* buf, int len)
+{
+  (void) buf; (void) len;
+  return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+  for (int i = 0; i < len; i++) {
+    const char* cbuf = buf;
+    while (!UART1->STAT_b.TX_READY) {}
+    if (cbuf[i] == '\n') {
+      UART1->IO = '\r';
+      while (!UART1->STAT_b.TX_READY) {}
+    }
+    UART1->IO = cbuf[i];
+  }
+  return len;
+}
+
+#if CFG_TUSB_OS  == OPT_OS_NONE
+volatile uint32_t system_ticks = 0;
+
+void TIMER_1_IRQHandler(void)
+{
+  system_ticks++;
+  SYSTMR->C1 += 977;
+  SYSTMR->CS_b.M1 = 1;
+}
+
+uint32_t board_millis(void)
+{
+  return system_ticks;
+}
+#endif
+
+void HardFault_Handler (void)
+{
+  // asm("bkpt");
+}
+
+// Required by __libc_init_array in startup code if we are compiling using
+// -nostdlib/-nostartfiles.
+void _init(void)
+{
+
+}

+ 7 - 12
hw/bsp/raspberrypi4/family.mk → hw/bsp/broadcom_64bit/family.mk

@@ -3,18 +3,16 @@ DEPS_SUBMODULES += $(MCU_DIR)
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
-CC = clang
-
 CFLAGS += \
-	-mcpu=cortex-a72 \
 	-Wall \
 	-O0 \
 	-ffreestanding \
 	-nostdlib \
 	-nostartfiles \
-	-std=c17 \
 	-mgeneral-regs-only \
-	-DCFG_TUSB_MCU=OPT_MCU_BCM2711
+	-std=c17
+
+CROSS_COMPILE = aarch64-none-elf-
 
 # mcu driver cause following warnings
 CFLAGS += -Wno-error=cast-qual
@@ -22,25 +20,22 @@ CFLAGS += -Wno-error=cast-qual
 SRC_C += \
 	src/portable/synopsys/dwc2/dcd_dwc2.c \
 	$(MCU_DIR)/broadcom/gen/interrupt_handlers.c \
+	$(MCU_DIR)/broadcom/gpio.c \
 	$(MCU_DIR)/broadcom/interrupts.c \
-	$(MCU_DIR)/broadcom/io.c \
 	$(MCU_DIR)/broadcom/mmu.c \
 	$(MCU_DIR)/broadcom/caches.c \
 	$(MCU_DIR)/broadcom/vcmailbox.c
 
-
-CROSS_COMPILE = aarch64-none-elf-
-
 SKIP_NANOLIB = 1
 
-LD_FILE = $(MCU_DIR)/broadcom/link.ld
+LD_FILE = $(MCU_DIR)/broadcom/link8.ld
 
 INC += \
 	$(TOP)/$(BOARD_PATH) \
 	$(TOP)/$(MCU_DIR) \
 	$(TOP)/lib/CMSIS_5/CMSIS/Core_A/Include
 
-SRC_S += $(MCU_DIR)/broadcom/boot.S
+SRC_S += $(MCU_DIR)/broadcom/boot8.S
 
 $(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
 	$(OBJCOPY) -O binary $^ $@
@@ -48,4 +43,4 @@ $(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
 # Copy to kernel to netboot drive or SD card
 # Change destinaation to fit your need
 flash: $(BUILD)/kernel8.img
-	$(CP) $< /home/$(USER)/Documents/code/pi4_tinyusb/boot_cpy
+	@$(CP) $< /home/$(USER)/Documents/code/pi_tinyusb/boot_cpy

+ 7 - 2
hw/bsp/esp32s2/boards/esp32s2.c

@@ -70,7 +70,7 @@ void board_init(void)
 #endif
 
   // Button
-  gpio_pad_select_gpio(BUTTON_PIN);
+  esp_rom_gpio_pad_select_gpio(BUTTON_PIN);
   gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
   gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
 
@@ -98,7 +98,12 @@ static void configure_pins(usb_hal_context_t *usb)
         esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
       } else {
         esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
-        if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
+#if ESP_IDF_VERSION_MAJOR > 4
+        if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT))
+#else
+        if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH))
+#endif
+        {
           gpio_ll_input_enable(&GPIO, iopin->pin);
         }
       }

+ 7 - 2
hw/bsp/esp32s3/boards/esp32s3.c

@@ -70,7 +70,7 @@ void board_init(void)
 #endif
 
   // Button
-  gpio_pad_select_gpio(BUTTON_PIN);
+  esp_rom_gpio_pad_select_gpio(BUTTON_PIN);
   gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
   gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
 
@@ -98,7 +98,12 @@ static void configure_pins(usb_hal_context_t *usb)
         esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
       } else {
         esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
-        if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
+#if ESP_IDF_VERSION_MAJOR > 4
+        if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT))
+#else
+        if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH))
+#endif
+        {
           gpio_ll_input_enable(&GPIO, iopin->pin);
         }
       }

+ 0 - 10
hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake

@@ -1,16 +1,6 @@
 # Apply board specific content here
 target_include_directories(${COMPONENT_LIB} PRIVATE .)
 
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s3")
-    message(FATAL_ERROR "Incorrect target for board ${BOARD}: (${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s3" FORCE)
-
 target_compile_options(${COMPONENT_TARGET} PUBLIC
   "-DCFG_TUSB_MCU=OPT_MCU_ESP32S3"
   "-DCFG_TUSB_OS=OPT_OS_FREERTOS"

+ 7 - 0
hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.cmake

@@ -0,0 +1,7 @@
+# Apply board specific content here
+target_include_directories(${COMPONENT_LIB} PRIVATE .)
+
+target_compile_options(${COMPONENT_TARGET} PUBLIC
+  "-DCFG_TUSB_MCU=OPT_MCU_ESP32S3"
+  "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
+)

+ 43 - 0
hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.h

@@ -0,0 +1,43 @@
+/* 
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef BOARD_H_
+#define BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define NEOPIXEL_PIN          48
+
+#define BUTTON_PIN            0
+#define BUTTON_STATE_ACTIVE   0
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* BOARD_H_ */

+ 7 - 0
hw/bsp/esp32s3/boards/espressif_s3_devkitm/board.cmake

@@ -0,0 +1,7 @@
+# Apply board specific content here
+target_include_directories(${COMPONENT_LIB} PRIVATE .)
+
+target_compile_options(${COMPONENT_TARGET} PUBLIC
+  "-DCFG_TUSB_MCU=OPT_MCU_ESP32S3"
+  "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
+)

Некоторые файлы не были показаны из-за большого количества измененных файлов