Replies: 3 comments 14 replies
-
your suggestion make sense, section attribute should go with global variable. Though I have no issue using this with other MCUs. Would you mind telling your gcc version ( |
Beta Was this translation helpful? Give feedback.
-
Hi @hathach , I hope you are well! I have been looking into another issue with my Zynq Host port, where my USB driver is hanging when I unplug my touch screen. The code is getting stuck in a for loop in the function static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr)
{
for(ehci_link_t* prev = list_head;
!prev->terminate && (tu_align32(prev->address) != (uint32_t) list_head) && prev != NULL;
prev = list_next(prev) )
{
// TODO check type for ISO iTD and siTD
// TODO Suppress cast-align warning
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
ehci_qhd_t* qhd = (ehci_qhd_t*) list_next(prev);
#pragma GCC diagnostic pop
if ( qhd->dev_addr == dev_addr )
{
// TODO deactivate all TD, wait for QHD to inactive before removal
prev->address = qhd->next.address;
// EHCI 4.8.2 link the removed qhd to async head (which always reachable by Host Controller)
qhd->next.address = ((uint32_t) list_head) | (EHCI_QTYPE_QHD << 1);
if ( qhd->int_smask )
{
// period list queue element is guarantee to be free in the next frame (1 ms)
qhd->used = 0;
}else
{
// async list use async advance handshake
// mark as removing, will completely re-usable when async advance isr occurs
qhd->removing = 1;
}
}
}
} For reference here is a capture of the debug output from tinyUSB when the device is plugged in and removed: Insert Device here...
Remove device here...
If you need any further information please don't hesitate to ask. Kind Regards, Pete |
Beta Was this translation helpful? Give feedback.
-
Hi @hathach , Hope you are well! Just a quick update and a change of approach. Having spent a considerable amount of time attempting to implement cache control and USB mass storage driver on my Zynq platform. I have not been successful in implementing cache control and I am finding it difficult to integrate the platform cache with tinyUSB, so I am going to stick with allocating un-cached data buffers for now as I don't have time to look into what's going on. I will continue to contribute to the tinyUSB library if I discover any other bugs or see an opportunity for adding something useful, I will be sure to send a PR. Once I have a working solution for the USB storage I will share it with my Zynq Template Project for LVGL & FreeRTOS and link the tinyUSB library as a submodule to support it. I will report back here if I have any useful news. Kind Regards, Pete |
Beta Was this translation helpful? Give feedback.
-
Hi @hathach ,
Firstly, thank you very much for creating and sharing this library it has been very helpful indeed!
I have a rudimentary host only port of this library working with the Zedboard (Xilinx Zynq7000).
I am currently looking at the changes I have made to the stock library in order to make it work with my Xilinx Vitis (Eclipse/GCC based IDE) environment and I was hoping I can make some changes so the tinyUSB library can be used with the Xilinx environment without modifications.
In the file
ehci.c (line 88)
I have found an issue where my definedCFG_TUSB_MEM_SECTION
is being ignored. Having explored the situation further I believe it is not valid to associate the static declaration with a variable which is declared in a specific memory block.So I wanted to create a quick discussion as to how to move forward and clear up the issue in line with your preferred resolution.
My immediate suggestion would be to simply remove the
static
keyword from the declaration. This will probably be fine for most situations unless I am missing something:If you would prefer some other method of resolution please can you let me know, I would be interested to hear your thoughts on the issue... (I am happy to submit a pull request should you require me to make any changes...)
Kind Regards,
Pete
Beta Was this translation helpful? Give feedback.
All reactions