Open ylyamin opened 1 week ago
There are 2 places where to Invalidate / clean cache.
First is done in ohci.c driver, second is done in hid_host.c (lib/tinyusb-ohci/src/class/hid/hid_host.c)
Its very tricky to do. Second possibility is to make the DMA memory non cachable, but it didnt work for me. Also i tried to make in clean to invalidate cache inside Ohci.c after receiving data but i failed. Thats why it is in hid_host.c
(BTW D1 and T113 are the same silicon, all peripherals are exactly the same, so code for T113 should run on D1 (except for the cpu related stuff))
Hi @robots ,
Thank you very much for your reply and support. Tried to add an invalidate cache in hid_host.c: nothing changed, still not work.
Didn't know if maybe is RT-Thread OS specific. Something is wrong with MMU init or compiler version, also RTT use OpenSBI. No idea.
Looks like I need to start from barebone with your code and RISC-V.
Hi,
I am very impressive of your work to manage bare-metal Allwinner T113. As is documentation very limited regarding peripherals it's amazing how you were able to write such laconic code. Sorry that I ask it in issue, just I don't know how to contact you.
Actually I want to do the same, but with Allwinner D1H, believe is chip with identical peripheral as T113 but with RISC-V core. I used RT-Thread OS and manage to run LCD MIPI DSI display with D1H.
But with USB I'm completely stuck, maybe you could give me some advice please? I would be very appreciated.
This is my repository and several articles about changes
I try to do the same as in your project:
rt-thread/bsp/allwinner/d1s_d1h/packages/TinyUSB/rt-thread/bsp/sunxi_D1/drv_tinyusb.c
Add few places to clear/invalidate caches, in rt-thread/bsp/allwinner/d1s_d1h/packages/TinyUSB/src/portable/ohci/ohci.c:
Define DMA memory section:
rt-thread/bsp/allwinner/d1s_d1h/link.lds
Init MMU with different sections in rt-thread/bsp/allwinner/d1s_d1h/board/board.c:
rt-thread/bsp/allwinner/d1s_d1h/packages/TinyUSB/src/portable/ohci/ohci.c
Run board.
Looks like USB device start to do something new, but all data transfers did not produce any results, all of it STALLED or FAULT:
Looks like communication not working.