cherry-embedded / CherryUSB

CherryUSB is a tiny and portable USB Stack (device & host) for embedded system with USB IP
https://cherryusb.readthedocs.io/
Apache License 2.0
1.14k stars 245 forks source link

Please provide a Bouffalo SDK host example #165

Closed harbaum closed 5 months ago

harbaum commented 5 months ago

The cherryusb inside the bouffalo sdk is still 0.10.0. I have been able to manually update to 0.10.2 but the latest version 1.0.0 doesn't implement easily into the bouffalo SDK, anymore.

Please provide an example for USB (host) usage of the latest cherryusb 1.0.0 with the bouffalo SDK. Or even better, please update the bouffalo SDK with the latest cherryusb.

sakumisu commented 5 months ago

Sorry, not update any more

sakumisu commented 5 months ago

You can update by yourself with guide.

harbaum commented 5 months ago

I don't understand. The bouffalo SDK will not be updated, anymore? Or only the USB inside the bouffalo SDK?

What do you mean by guide? I tried updating. Main changes are:

I had to do some minor other changes in my code. But I had already done this for 0.10.2 and that was still working

This is now crashing once I plug a USB device with:

init usbh class
exception_entry
mcause=30000004
mepc:a00064d8
mtval:0000002d
Load address misaligned

-+-+-+- BFLB COREDUMP v0.0.1 +-+-+-+
...
sakumisu commented 5 months ago

Follow this guide: https://cherryusb.readthedocs.io/zh-cn/latest/quick_start/other_chip.html, I think you have wrong in porting with cherryusb master, so please use v0.10.2

sakumisu commented 5 months ago

From your code, you have many mistakes

sakumisu commented 5 months ago

For host, where is your irq??? please refer to https://github.com/CherryUSB/cherryusb_stm32/blob/5727f65f5a3da97698b2581cc3055258a57ed182/usb_host/stm32f429igt6/Core/Src/stm32f4xx_it.c#L216

sakumisu commented 5 months ago

And ehci offset you must set.

sakumisu commented 5 months ago

So, following above, please use v0.10.2 if you have no ability to porting with master.

sakumisu commented 5 months ago

Or you can use v1.0.0, its api is the same with v0.10.2, master is for multi port.

sakumisu commented 5 months ago

For device, please refer to this commit : https://github.com/cherry-embedded/CherryUSB/commit/29d45ef5c7547b75a347e992fc4198f03da31f15

sakumisu commented 5 months ago

Follow this #166

harbaum commented 5 months ago

Yes, usbd_ep_open() needs to be present for a device. I am talking about host.

It's rather strange to hear that support for the bouffalo line of MCUs has ended so early. Why is that?

harbaum commented 5 months ago

Follow this #166

Thanks! This was the info I was missing. USB host compiles now and seems to run.

sakumisu commented 5 months ago

Hello, do you have solved this?For detail, you can check with following patches.

harbaum commented 5 months ago

Yes, I have integrated cherryusb 1.0.0 into the bouffalo sdk. I have also added a host driver for the Xbox controller and compatible devices. See http://GitHub.com/Harbaum/bouffalo_sdk

This is being used in the MiSTeryNano FPGA: http://GitHub.com/Harbaum/MiSTeryNano

sakumisu commented 5 months ago

Yes, I have integrated cherryusb 1.0.0 into the bouffalo sdk. I have also added a host driver for the Xbox controller and compatible devices. See http://GitHub.com/Harbaum/bouffalo_sdk

This is being used in the MiSTeryNano FPGA: http://GitHub.com/Harbaum/MiSTeryNano

That's cool, sir, i will be continuous concerned with your project.