Replies: 6 comments 1 reply
-
It may be completely wrong but I started from the hello world freertos example and reached to this[1] state with tinyusb, the led is working, the serial is working, usb is initialized but does not work in any other method I can see.
[1] https://github.com/alonbl/freertos_hello_tinyusb_cm7/tree/tinyusb |
Beta Was this translation helpful? Give feedback.
-
rt1170 board is not yet supported. usb driver is supported but the board, mcu clock/hw setup may be different than other in the family. |
Beta Was this translation helpful? Give feedback.
-
I just added rt1170 evk to the supported boards #2320. Led + button works but usb isn't show up. Maybe there is some missing piece with pin, clock, power setting on rt1170. Will troubleshoot later, hopefully this will help you making the port easier. |
Beta Was this translation helpful? Give feedback.
-
WOW! thanks, I will check this out. |
Beta Was this translation helpful? Give feedback.
-
Working with the following change, I am unsure how you want to cope with the frequency change between CPUs. diff --git a/hw/bsp/imxrt/family.c b/hw/bsp/imxrt/family.c
index a9ba00305..18ca85727 100644
--- a/hw/bsp/imxrt/family.c
+++ b/hw/bsp/imxrt/family.c
@@ -124,8 +124,10 @@ void board_init(void)
// Note: RT105x RT106x and later have dual USB controllers.
// Clock
- CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_Usbphy480M, 480000000U);
- CLOCK_EnableUsbhs0Clock(kCLOCK_Usb480M, 480000000U);
+ //uint32_t usbClockFreq = 480000000U;
+ uint32_t usbClockFreq = 24000000U;
+ CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_Usbphy480M, usbClockFreq);
+ CLOCK_EnableUsbhs0Clock(kCLOCK_Usb480M, usbClockFreq);
#ifdef USBPHY1
init_usb_phy(USBPHY1);
@@ -135,8 +137,8 @@ void board_init(void)
#ifdef USBPHY2
// USB1
- CLOCK_EnableUsbhs1PhyPllClock(kCLOCK_Usbphy480M, 480000000U);
- CLOCK_EnableUsbhs1Clock(kCLOCK_Usb480M, 480000000U);
+ CLOCK_EnableUsbhs1PhyPllClock(kCLOCK_Usbphy480M, usbClockFreq);
+ CLOCK_EnableUsbhs1Clock(kCLOCK_Usb480M, usbClockFreq);
init_usb_phy(USBPHY2);
#endif
} |
Beta Was this translation helpful? Give feedback.
-
Hi again, I need CDC performance... so this is what I am checking... In the mean while I had to learn the NXP drivers... With tinyusb I am getting 19.53 MB/s provided the following changes, in both Linux and Windows, not sure I need the fifo in this kind of busy loop. With all the complexity of the NXP API, using the NXP ehci driver I get 27MB/s in Windows and 38.5MB/s in Linux (on the same machine!!) with less than 60 wake ups per second everything is DMA based. I guess I need to wait for the #920 and #1064, I like the API and the environment but need the performance. Regards, diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 1dadc4513..ef5b32fd1 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -182,30 +182,20 @@ void tud_resume_cb(void) {
//--------------------------------------------------------------------+
// USB CDC
//--------------------------------------------------------------------+
+static uint8_t buffer[CFG_TUD_CDC_TX_BUFSIZE];
void cdc_task(void *params) {
(void) params;
+ memset(buffer, '1', sizeof(buffer));
+
// RTOS forever loop
while (1) {
// connected() check for DTR bit
// Most but not all terminal client set this when making connection
- // if ( tud_cdc_connected() )
+ if ( tud_cdc_connected() )
{
- // There are data available
- while (tud_cdc_available()) {
- uint8_t buf[64];
-
- // read and echo back
- uint32_t count = tud_cdc_read(buf, sizeof(buf));
- (void) count;
-
- // Echo back
- // Note: Skip echo by commenting out write() and write_flush()
- // for throughput test e.g
- // $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
- tud_cdc_write(buf, count);
- }
-
+ uint32_t n = tud_cdc_write_available();
+ tud_cdc_write(buffer, n);
tud_cdc_write_flush();
}
diff --git a/examples/device/cdc_msc_freertos/src/tusb_config.h b/examples/device/cdc_msc_freertos/src/tusb_config.h
index 91efe7d40..a70947782 100644
--- a/examples/device/cdc_msc_freertos/src/tusb_config.h
+++ b/examples/device/cdc_msc_freertos/src/tusb_config.h
@@ -105,11 +105,11 @@
#define CFG_TUD_VENDOR 0
// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
+#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 2048 : 64)
+#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 2048 * 10 : 64)
// CDC Endpoint transfer buffer size, more is faster
-#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
+#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 2048 : 64)
// MSC Buffer size of Device Mass storage
#define CFG_TUD_MSC_EP_BUFSIZE 512 |
Beta Was this translation helpful? Give feedback.
-
Hello,
Does anyone have a success with MIMXRT117X? I see that MIMXRT11XX is supported, however, I cannot make it work.
I tried to patch the source tree to support MIMXRT1170-EVKB but it but the build system is very complex, although I succeeded making it compile it does not run.
The bare metal examples (host while I need device) in which it is specified mimxrt11XX, I am unsure how to build them to my MIMXRT1170-EVKB as I am missing the initialization that should be under
hw/bsp
.I will appreciate any help to make it work.
I tried to use the library in esp32, it was a great experience as they adopted it as part of their esp-idf sdk, the NXP integration is far from being smooth.
I saw the respond in #1571, I hope there is some kind of example or hints.
Regards,
Alon
Beta Was this translation helpful? Give feedback.
All reactions