You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "acassis (via GitHub)" <gi...@apache.org> on 2025/08/05 10:43:43 UTC
[PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
acassis opened a new pull request, #16812:
URL: https://github.com/apache/nuttx/pull/16812
## Summary
These patches fix small issues on previous PR and add USB Host support to arcx-socket-grid board.
## Impact
Improvements
## Testing
arcx-socket-grid
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #16812:
URL: https://github.com/apache/nuttx/pull/16812
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #16812:
URL: https://github.com/apache/nuttx/pull/16812#issuecomment-3170723766
Not related errors in CI:
```
CMake Error at /usr/local/share/cmake-3.26/Modules/FetchContent.cmake:1622 (message):
Build step for libmetal failed: 1
Call Stack (most recent call first):
/usr/local/share/cmake-3.26/Modules/FetchContent.cmake:1762:EVAL:2 (__FetchContent_directPopulate)
/usr/local/share/cmake-3.26/Modules/FetchContent.cmake:1762 (cmake_language)
openamp/libmetal.cmake:57 (FetchContent_Populate)
openamp/CMakeLists.txt:27 (include)
CMake Error at openamp/libmetal.cmake:81 (add_subdirectory):
The source directory
/github/workspace/sources/nuttx/openamp/libmetal
does not contain a CMakeLists.txt file.
Call Stack (most recent call first):
openamp/CMakeLists.txt:27 (include)
CMake Error at cmake/nuttx_add_library.cmake:29 (add_dependencies):
Cannot add target-level dependencies to non-existent target "metal-static".
The add_dependencies works for top-level logical targets created by the
add_executable, add_library, or add_custom_target commands. If you want to
add file-level dependencies see the DEPENDS option of the add_custom_target
and add_custom_command commands.
Call Stack (most recent call first):
cmake/nuttx_add_library.cmake:261 (nuttx_add_library_internal)
openamp/libmetal.cmake:87 (nuttx_add_external_library)
openamp/CMakeLists.txt:27 (include)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #16812:
URL: https://github.com/apache/nuttx/pull/16812#discussion_r2255732862
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -459,8 +459,8 @@ static int imxrt_qh_dump(struct imxrt_qh_s *qh, uint32_t **bp, void *arg);
#else
# define imxrt_qtd_print(qtd)
# define imxrt_qh_print(qh)
-# define imxrt_qtd_dump(qtd, bp, arg) OK
-# define imxrt_qh_dump(qh, bp, arg) OK
+# define imxrt_qtd_dump(qtd, bp, arg) ((void) OK)
Review Comment:
remove space before OK
##########
boards/arm/imxrt/arcx-socket-grid/src/arcx-socket-grid.h:
##########
@@ -71,10 +71,14 @@
#define GPIO_GOUT4 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PIN9 | GPIO_PORT1)
-/* Backlight */
+/* USB OTG1 ID Pin: GPIO_AD_B0_01 */
-#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT2 | \
- GPIO_PIN31 | IOMUX_LCD_BL_DEFAULT)
+#define GPIO_USBOTG1_ID (GPIO_USB_OTG1_ID_2 | IOMUX_USBOTG_ID_DEFAULT) /* AD_B0_01 */
Review Comment:
remove extra space to align with line 71
##########
boards/arm/imxrt/arcx-socket-grid/src/arcx-socket-grid.h:
##########
@@ -71,10 +71,14 @@
#define GPIO_GOUT4 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PIN9 | GPIO_PORT1)
-/* Backlight */
+/* USB OTG1 ID Pin: GPIO_AD_B0_01 */
-#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT2 | \
- GPIO_PIN31 | IOMUX_LCD_BL_DEFAULT)
+#define GPIO_USBOTG1_ID (GPIO_USB_OTG1_ID_2 | IOMUX_USBOTG_ID_DEFAULT) /* AD_B0_01 */
+
+/* USB HOST Power - GPIO_B1_15 */
+
+#define USB_HOST_PWR (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT2 | \
Review Comment:
remove extra spaces to align with line 71
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on code in PR #16812:
URL: https://github.com/apache/nuttx/pull/16812#discussion_r2253972389
##########
boards/arm/imxrt/arcx-socket-grid/src/imxrt_usbhost.c:
##########
@@ -0,0 +1,304 @@
+/****************************************************************************
+ * boards/arm/imxrt/arcx-socket-grid/src/imxrt_usbhost.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sched.h>
+#include <errno.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/kthread.h>
+#include <nuttx/usb/usbdev.h>
+#include <nuttx/usb/usbhost.h>
+#include <nuttx/usb/usbdev_trace.h>
+#include <nuttx/usb/ehci.h>
+
+#include <imxrt_ehci.h>
+
+#include "hardware/imxrt_pinmux.h"
+#include "hardware/imxrt_usbotg.h"
+#include "imxrt_periphclks.h"
+#include "arcx-socket-grid.h"
+
+#include <arch/board/board.h> /* Must always be included last */
+
+#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef CONFIG_USBHOST_DEFPRIO
+# define CONFIG_USBHOST_DEFPRIO 50
+#endif
+
+#ifndef CONFIG_USBHOST_STACKSIZE
+# ifdef CONFIG_USBHOST_HUB
+# define CONFIG_USBHOST_STACKSIZE 1536
+# else
+# define CONFIG_USBHOST_STACKSIZE 1024
+# endif
+#endif
Review Comment:
I strongly recommend using the common USB host waiter logic, like for example in this PR: https://github.com/apache/nuttx/pull/16414
`CONFIG_USBHOST_STACKSIZE` is not even defined in Kconfig and these stack values are too small when more NuttX features are enabled. This later leads to hard-to-detect bugs like in https://github.com/apache/nuttx/issues/16256 :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] boards/imxrt: Fix issues and add USBHOST support to arcx-socket-grid [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #16812:
URL: https://github.com/apache/nuttx/pull/16812#discussion_r2254037273
##########
boards/arm/imxrt/arcx-socket-grid/src/imxrt_usbhost.c:
##########
@@ -0,0 +1,304 @@
+/****************************************************************************
+ * boards/arm/imxrt/arcx-socket-grid/src/imxrt_usbhost.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sched.h>
+#include <errno.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/kthread.h>
+#include <nuttx/usb/usbdev.h>
+#include <nuttx/usb/usbhost.h>
+#include <nuttx/usb/usbdev_trace.h>
+#include <nuttx/usb/ehci.h>
+
+#include <imxrt_ehci.h>
+
+#include "hardware/imxrt_pinmux.h"
+#include "hardware/imxrt_usbotg.h"
+#include "imxrt_periphclks.h"
+#include "arcx-socket-grid.h"
+
+#include <arch/board/board.h> /* Must always be included last */
+
+#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef CONFIG_USBHOST_DEFPRIO
+# define CONFIG_USBHOST_DEFPRIO 50
+#endif
+
+#ifndef CONFIG_USBHOST_STACKSIZE
+# ifdef CONFIG_USBHOST_HUB
+# define CONFIG_USBHOST_STACKSIZE 1536
+# else
+# define CONFIG_USBHOST_STACKSIZE 1024
+# endif
+#endif
Review Comment:
Good suggestion! Thank you!!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org