gertk
Posts: 52
Joined: Mon Aug 29, 2011 9:08 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sat Nov 24, 2012 12:51 pm

Not all is well yet...
Every time I change something in my source it is hit and miss if the USB lib will start correctly, I also experience memory corruptions. With LOWLEVEL and STANDALONE mode it uses its own memory management with a static heap. When the startup fails claiming: Out of Memory We should've had more heap space in platform.c I found out that 'allocated' gets the weirdest large values.

I added this in platform.c:

Code: Select all

void* MemoryAllocate(u32 size) {
	struct HeapAllocation *Current, *Next;
	if (FirstFreeAllocation == NULL) {
		LOG_DEBUGF("Platform: First memory allocation, reserving %d bytes of heap, 256 entries.\r\n",sizeof(Heap));
		MemoryReserve(sizeof(Heap), &Heap);
		MemoryReserve(sizeof(Allocations), &Allocations);
		allocated = 0;  // make sure allocated is really zero
		FirstFreeAllocation = &Allocations[0];
	}
........
To make sure that on the first memory reserve 'allocated' is really zero.
My guess is that something is overwriting something... :)
In my own program I only have fixed memory allocations and without the csud lib it ran rocksolid.

Is the csud library using timer and/or interrupts somehow ?

Another small thing:

in keyboard.c there is a type at line 337:

bool KeyboadGetKeyIsDown
there seems to be an 'r' missing.

User avatar
Shawty
Posts: 58
Joined: Fri Nov 16, 2012 1:22 am
Location: North East UK
Contact: Website

Re: CSUD - Chadderz's Simple USB Driver (Source)

Thu Dec 13, 2012 9:55 pm

@chadderz

I haven't looked at Ethernet, the documentation on the datasheet doesn't seem at all sufficient, but perhaps the Linux driver would be. I think you would need more than just control transfers to make it work though! You're right though, the device tree of the Pi on my driver is always:

Is this the BCM Data sheet your on about? (The one available to download from the raspberry Pi site) If so, which page because I've combed through it back front and centre and I can't find any mention of the Ethernet in it.

If it's a different data sheet, any chance of a link where I can grab a copy please :-)
still crazy (Even since the days of my BBC Model B) BEST and only way to be ;-)

IM: @shawty_ds on twitter
if you remember the Acorn and BBC days then I was "!Shawty! of DSPD" (Author of the BBC B Sound Tracker suite, and the Dreamscape demo)

User avatar
Chadderz
Posts: 64
Joined: Thu Aug 30, 2012 12:50 pm
Location: Cambridge, UK

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Dec 14, 2012 1:08 pm

No. the BCM data sheet doesn't mention it as it is connected to the USB.
The datasheet for the chip in question is here: http://www.smsc.com/media/Downloads_Pub ... s/9512.pdf

User avatar
Shawty
Posts: 58
Joined: Fri Nov 16, 2012 1:22 am
Location: North East UK
Contact: Website

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Dec 14, 2012 2:45 pm

Fantastic.... thanks muchly :-)
still crazy (Even since the days of my BBC Model B) BEST and only way to be ;-)

IM: @shawty_ds on twitter
if you remember the Acorn and BBC days then I was "!Shawty! of DSPD" (Author of the BBC B Sound Tracker suite, and the Dreamscape demo)

BrianW
Posts: 83
Joined: Sun Jul 29, 2012 9:03 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Dec 14, 2012 10:55 pm

On the subject of datasheets, is the one for the USB interface peripheral available anywhere?

User avatar
Shawty
Posts: 58
Joined: Fri Nov 16, 2012 1:22 am
Location: North East UK
Contact: Website

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Dec 14, 2012 11:57 pm

It is, I found it yesterday but it's on the website of some chineese company that wants to know every detail of your life before they will release it.

I tried the usual BullS**t responses to the "please give us your details" form, and EVERYTHING was checked, zip / postcode to country and country to town and town to state ... everything. I tried at least 10 different combinations and everything was double checked....

to put it another way, unless your 100% honest with everything your not getting that data sheet!!!!
still crazy (Even since the days of my BBC Model B) BEST and only way to be ;-)

IM: @shawty_ds on twitter
if you remember the Acorn and BBC days then I was "!Shawty! of DSPD" (Author of the BBC B Sound Tracker suite, and the Dreamscape demo)

User avatar
Chadderz
Posts: 64
Joined: Thu Aug 30, 2012 12:50 pm
Location: Cambridge, UK

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sat Dec 15, 2012 12:21 am

Yes, unfortunately the real Synapsys datasheet for USB is confidential and tightly controlled. I did my work just based on Linux and other drivers. I know of someone who has it, advocating for the release of that particular datasheet, but I'm not sure if it'll happen. Still, I never expected the source for all the graphics stuff to be released and yet it was. Here's hoping.

feroze
Posts: 27
Joined: Wed Mar 27, 2013 5:20 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Jul 05, 2013 12:50 pm

Hello,

I need to install this USB driver package so I can use the 'make' command successfully on a Raspberry Pi OS build.

I am not sure how I install this package onto my mac, so that when I use 'make' this driver is recognized.

Right now I get:

arm-none-eabi-ld: cannot find -lcsud
make: *** [build/output.elf] Error 1

So can someone give me brief instructions on how I can download and install this library (Chadderz's Simple USB Driver)?

Thanks!

mpod
Posts: 1
Joined: Mon Jul 15, 2013 7:41 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Mon Jul 15, 2013 7:57 pm

As I can see from earlier posts it is possible to compile the driver from Linux. But I'm getting the following error:
$ make driver CONFIG=DEBUG TYPE=LOWLEVEL TARGET=RPI GNU=arm-none-eabi-
arm-none-eabi-gcc -std=c99 -fpack-struct -Wno-packed-bitfield-compat -fshort-wchar -Wall -DDEBUG -DTYPE_LOWLEVEL -DTARGET_RPI -Wa,-march=armv6 -Wa,-mcpu=arm1176jzf-s -DLIB_HUB -DLIB_HID -DLIB_KBD -DLIB_MOUSE -c -Iinclude/ source/device/hid/hid.c -o build/hid.c.o
cc1: error: unrecognized command line option "-Wno-packed-bitfield-compat"
make: *** [build/hid.c.o] Error 1
Removing -Wno-packed-bitfield-compat flag doesn't help as well:
$ make driver CONFIG=DEBUG TYPE=LOWLEVEL TARGET=RPI GNU=arm-none-eabi-
arm-none-eabi-gcc -std=c99 -fpack-struct -fshort-wchar -Wall -DDEBUG -DTYPE_LOWLEVEL -DTARGET_RPI -Wa,-march=armv6 -Wa,-mcpu=arm1176jzf-s -DLIB_HUB -DLIB_HID -DLIB_KBD -DLIB_MOUSE -c -Iinclude/ source/device/hid/hid.c -o build/hid.c.o
In file included from source/device/hid/hid.c:17:
include/device/hid/report.h:210: warning: declaration does not declare anything
source/device/hid/hid.c: In function 'HidEnumerateActionAddField':
source/device/hid/hid.c:556: error: 'struct HidFullUsage' has no member named 'Desktop'
...
make: *** [build/hid.c.o] Error 1
Here are details of gcc.
$ arm-none-eabi-gcc -v
Using built-in specs.
Target: arm-none-eabi
Configured with: /scratch/julian/lite-respin/eabi/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-eabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-shared --with-newlib --with-pkgversion='Sourcery G++ Lite 2008q3-66' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes --with-sysroot=/opt/codesourcery/arm-none-eabi --with-build-sysroot=/scratch/julian/lite-respin/eabi/install/arm-none-eabi --with-gmp=/scratch/julian/lite-respin/eabi/obj/host-libs-2008q3-66-arm-none-eabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/eabi/obj/host-libs-2008q3-66-arm-none-eabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/eabi/install/arm-none-eabi/bin --with-build-time-tools=/scratch/julian/lite-respin/eabi/install/arm-none-eabi/bin
Thread model: single
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-66)
Any idea?

JJakaJonas
Posts: 2
Joined: Sun Jan 05, 2014 12:45 am
Location: Denmark

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sun Jan 05, 2014 12:47 am

Can i use thos driver for my project in Windows Embedded compact 7 for Raspberry Pi?

Mubashir Baig
Posts: 1
Joined: Sat Apr 12, 2014 10:16 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sat Apr 12, 2014 10:51 am

Sorry, but please explain in simple steps that how to compile input 01 of baking pi, i will be very thankful to you

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21460
Joined: Sat Jul 30, 2011 7:41 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sat Apr 12, 2014 2:23 pm

Mubashir Baig wrote:Sorry, but please explain in simple steps that how to compile input 01 of baking pi, i will be very thankful to you
I think you need to create a new topic and ask your question again - more detail about what you are trying to do would also help.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

fordcars
Posts: 10
Joined: Thu Jun 26, 2014 6:23 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Aug 08, 2014 3:34 am

Hi,

I have been playing around with Baking Pi for 2 days now, and it's awesome. I just finished Input 02, but when I build, the keyboard driver starts crying about .bss and .text saying some things are undefined. I have the driver and the MakeFile in the right directory. Please help :)

Edit: Sample:

Code: Select all

rm-none-eabi-ld: Warning: ./libcsud.a(platform.armv6.c.o): Unknown EABI object attribute 44
arm-none-eabi-ld: Warning: ./libcsud.a(platform.broadcom2835.c.o): Unknown EABI object attribute 44
build/main.o: In function `noError$':
(.text+0x40): undefined reference to `UsbInitialize'
build/keyboard.o: In function `KeyboardUpdate':
(.text+0x10): undefined reference to `haveKeyboard$'
`.bss' referenced in section `.text' of ./libcsud.a(device.keyboard.c.o): defined in discarded section `.bss' of ./libcsud.a(device.keyboard.c.o)
`keyboards' referenced in section `.text' of ./libcsud.a(device.keyboard.c.o): defined in discarded section `COMMON' of ./libcsud.a(device.keyboard.c.o)

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Aug 08, 2014 6:32 am

fordcars wrote:

Code: Select all

rm-none-eabi-ld: Warning: ./libcsud.a(platform.armv6.c.o): Unknown EABI object attribute 44
arm-none-eabi-ld: Warning: ./libcsud.a(platform.broadcom2835.c.o): Unknown EABI object attribute 44
That's a "your compiler/linker is too old" error. What's happening is that some parts of the CSUD object file have attributes your linker doesn't know about (in this case, attribute 44, which is IIRC something about whether the code uses the 'div' instruction), and the linker is complaining about it. It also appears to be dropping the bss and COMMON sections, hence the errors, this is probably related ("I don't know what this attribute means, ignore the entire piece of code").

My advice would be to either update your tools to gcc 4.9 or so, or build CSUD from source yourself rather than using the precompiled object files.

fordcars
Posts: 10
Joined: Thu Jun 26, 2014 6:23 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Aug 08, 2014 7:10 pm

Oh ok, I will try that

Thanks!

neerajrd2003
Posts: 1
Joined: Wed Dec 07, 2016 9:32 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Wed Dec 07, 2016 10:22 am

Hi Chadderz,
i m using Raspberry pi 2 with BCM2836. I m compiling your driver for same. I have changed USB core base address from 0x20980000 to 0x3F980000. Still some of statements in following functions are not working correctly.
(only commented statements are not functioning correctly. You can Leave all LOG/LOG_DEBUF functions etc in between)
In function HcdStart()
1.
/*
if (Core == NULL) {
// LOG("HCD: HCD uninitialised. Cannot be started.\n");

return ErrorDevice;
}


if ((databuffer = MemoryAllocate(1024)) == NULL)
return ErrorMemory;
*/
ReadBackReg(&Core->Usb);
Core->Usb.UlpiDriveExternalVbus = 0;
Core->Usb.TsDlinePulseEnable = 0;
WriteThroughReg(&Core->Usb);

// LOG_DEBUG("HCD: Master reset.\n");

if ((result = HcdReset()) != OK) {
goto deallocate;
}

// if (!PhyInitialised) {
// LOG_DEBUG("HCD: One time phy initialisation.\n");

// PhyInitialised = true;

Core->Usb.ModeSelect = UTMI;
// LOG_DEBUG("HCD: Interface: UTMI+.\n");

Core->Usb.PhyInterface = false;

WriteThroughReg(&Core->Usb);
HcdReset();
// }
2. switch (Core->Hardware.OperatingMode) is reporting case HNP_SRP_CAPABLE . If this is correct?. If not then how to correct?

3. if (Core->Hardware.HighSpeedPhysical == Ulpi
&& Core->Hardware.FullSpeedPhysical == Dedicated
&& Core->Usb.UlpiFsls) is reporting HCD: Host clock: 30-60Mhz. If this is correct?. If not then how to correct?

4. if (Host->Config.EnableDmaDescriptor ==
Core->Hardware.DmaDescription &&
(Core->VendorId & 0xfff) >= 0x90a) is reporting HCD: DMA descriptor: disabled If this is correct?. If not then how to correct?

In Function UsbAttachRootHub()
1. if (Devices[0] != NULL)
{
UsbDeallocateDevice(Devices[0]);
} is not working correctly.

Function UsbAllocateDevice() returns ErrorMemory

Control is not able to move beyond this.

I m not able to understand correctly, how u initializing USB. If possible i need ur help to understand the sequence of initializing USB. Please! tell me correct sequence of all registers in USB core to initialized.

LdB
Posts: 1004
Joined: Wed Dec 07, 2016 2:29 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Fri Dec 09, 2016 5:32 pm

You need to not only change the base address but there is also a microsecond time function in broadcom2835.c

See that address that is hard coded it's the Pi 1 Address not the Pi 2/3

void MicroDelay(u32 delay) {
volatile u64* timeStamp = (u64*)0x20003004;
u64 stop = *timeStamp + delay;

while (*timeStamp < stop)
__asm__("nop");
}

It's called from all over the place in the code providing all the timing delays.

LdB
Posts: 1004
Joined: Wed Dec 07, 2016 2:29 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Mon Dec 19, 2016 6:39 pm

Now I have my own strange problem with CSUD with some USB mice.

Most mice work perfectly well but I have a few that behave strangely in that the movement data offset (X,Y) doesn't drop back to zero after you stop moving the mouse. It just keeps outputting the same data.

At a guess the mouse is defaulting to absolute mode and so it left me scratching my head how I change the mouse mode using CSUD. I don't see any interface calls to change the settings of the mouse.

phil95
Posts: 141
Joined: Wed Sep 12, 2012 8:10 am
Location: Paris

Re: CSUD - Chadderz's Simple USB Driver (Source)

Mon Jan 02, 2017 2:41 pm

Hello LdB
I'm interested by your use of CSUD:
- wich RPI are you using ? RPI 2/3 ?
- wich version of compiler are you using ?
- Do you have a sample program with your mouse driver ?
Thank's for your answer
Philippe

LdB
Posts: 1004
Joined: Wed Dec 07, 2016 2:29 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Sun Jan 08, 2017 3:21 pm

I have it running on all all the Pi's except the PI3 B+ because I can't get the dam PI3 B+ started as per another post that version is doing my head in at the moment.

I heavily modified Chadderz code because I am doing only baremetal and so threw all the the driver mode etc out so it is only standalone. I have done the first two articles on code project and you can see the screen dump of the 3rd one I am trying to finish with mouse and keyboard running at the bottom
https://www.codeproject.com/Articles/11 ... -Pi-Part-I

I basically have everything ready to publish except 2 problems, this one with some mice starting in absolute mode and I can't get the raspberry pi 3 B+ up at all. Having just got back from holidays I will be back on this stuff this week.

This is my notes on changes to chadderz original keyboard code as an indication, the mouse unit had similar changes. If you want the code pre-publication let me know and i will put it up on a public download site for you.
1.) Replaced all references to crazy "types.h" unit with C standard <stdint.h>

2.) Fixed up several struct issues with enum bit field packs

3.) Dispensed with other modes on driver other than stand alone as we are
baremetal the other modes are useless to us.

4.) Corrected addresses to move with different models of Pi. Now supports
Pi1, Pi2 and Pi3.

5.) Changed the "KeyBoard Address" concept to KBD_HANDLE. When we change the
processor into protected mode you can't treat that as an address because
it will be untouchable in the application layer. Also on the Pi3 it will
be 64 bit so easier to get familiar with treating it as a handle.

6.) Replaced all the internal time clocks back up to RPi-Hardware unit. We
can't have peripheral code accessing central hardware like the timer
without us being in charge if we have multitasking running.

7.) Replaced all mailbox exchanges to redirect to RPI-Hardware unit which
has memory barrier code.

8.) Fixed some crazy typecasting with union structures where we have what is
obvious unionized entries. You cant just assume pointers to pointers to
pointers will remain valid as the devices can be unplugged. So you need
pointer tests before pointer use anyhow. The whole concept was stupid as
it was setup.

9.) Dispensed with the LED SUPPORT bit field struct. It is a simple byte with
bitmasks in it. It doesn't need the portability issue of bit field packing
for such a stupidly simple thing.

ten
Posts: 2
Joined: Tue Mar 14, 2017 4:10 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Tue Mar 14, 2017 4:17 am

-> LdB

I interested in your modified CSUD for RPi2/3.
Can I use the source code that you modified?

LdB
Posts: 1004
Joined: Wed Dec 07, 2016 2:29 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Tue Mar 14, 2017 6:02 am

Article and code will be up this week doing cleanup on loose ends at the moment.

ten
Posts: 2
Joined: Tue Mar 14, 2017 4:10 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Tue Mar 14, 2017 10:01 am

Thank you very much. I am looking forward to it.

riverajl
Posts: 10
Joined: Thu Dec 06, 2018 10:03 am

Re: CSUD - Chadderz's Simple USB Driver (Source)

Mon Dec 10, 2018 10:56 pm

Hi guys.

I am trying to use the libcsud with raspberry pi 3 B . I have changed the base address of the USB block from 0x20980000 to 0x3f980000 as well others 0x20....... addresses (time counter etc).

The driver initializes well but does not find the keyboard (as well as the mouse). Complied with DEBUG gave me this messages:
CSUD: USB driver version 0.1
.CSUD: HID driver version 0.1
.CSUD: Hub driver version 0.1
.CSUD: Keyboard driver version 0.1
.CSUD: Mouse driver version 0.1
.HCD: Reserving memory.
.Platform: First memory allocation, reserving 16KiB of heap, 256 entries.
.Platform: malloc(0x400) = 0x211e0. (1024/16384)
.Platform: malloc(0x400) = 0x215e0. (2048/16384)
.Platform: malloc(0x8) = 0x219e0. (2056/16384)
.HCD: Hardware: OT2.80a (BCM2708a).
.HCD: Internal DMA mode.
.HCD: Hardware configuration: 00000000 228ddd50 0ff000e8 1ff00020
.HCD: Host configuration: 00000000
.HCD: Disabling interrupts.
.HCD: Powering USB on.
.HCD: Load completed.
.HCD: Start core.
.Platform: malloc(0x400) = 0x219e8. (3080/16384)
.HCD: Master reset.
.HCD: One time phy initialisation.
.HCD: Interface: UTMI+.
.HCD: ULPI FSLS configuration: disabled.
.HCD: DMA configuration: enabled.
.HCD: HNP/SRP configuration: HNP, SRP.
.HCD: Core started.
.HCD: Starting host.
.HCD: Host clock: 30-60Mhz.
.HCD: DMA descriptor: disabled.
.HCD: FIFO configuration: Total=0xf000 Rx=0x5000 NPTx=0x5000 PTx=0x5000.
.HCD: Set HNP: enabled.
.HCD: TXFlush(All)
.HCD: RXFlush(All)
.HCD: Powering up port.
.HCD: Reset port.
.HCD: Successfully started.
.USBD: Scanning for devices.
.Platform: malloc(0x420) = 0x21de8. (4136/16384)
.USBD: Allocating new device, address 0x1.
.USBD: Scanning 1. 480 Mb/s.
.USBD: Attach Device USB Root Hub. Address:1 Class:9 Subclass:0 USB:2.0. 1 configurations, 0 interfaces.
.USBD: Device Attached: USB Root Hub.
.Platform: malloc(0x100) = 0x22208. (4392/16384)
.USBD: -Product: USB 2.0 Root Hub.
.Platform: free(0x22208) (4136/16384)
.USBD: -VID:PID: 0:0 v1.0
.Platform: malloc(0x20) = 0x22208. (4168/16384)
.USBD: Descriptor 4 length 9, interface 0.
.USBD: Descriptor 5 length 7, interface 0.
.USBD: USB Root Hub configuration 1. Class 9, subclass 0.
.Platform: malloc(0x68) = 0x22228. (4272/16384)
.Platform: malloc(0x10) = 0x22290. (4288/16384)
.HUB: Hub power: Global.
.HUB: Hub nature: Standalone.
.HUB: Hub over current protection: Global.
.HUB: Hub power to good: 0ms.
.HUB: Hub current required: 0mA.
.HUB: Hub ports: 1.
.HUB: Hub port 1 is removable.
.USB Hub power: Good.
.USB Hub over current condition: No.
.HUB: Hub powering on.
.HUB: Powering on hub USB Root Hub.
.USB Hub power: Good.
.USB Hub over current condition: No.
.HUB: USB Root Hub status 0:0.
.HUB: USB Root Hub.Port1 Status 101:11.
.HUB: Hub reset USB Root Hub.Port1.
.HUB: USB Root Hub.Port1 Status 503:12.
.Platform: malloc(0x420) = 0x222a0. (5344/16384)
.USBD: Allocating new device, address 0x2.
.HUB: USB Root Hub.Port1 Status 503:12.
.USBD: Scanning 2. 480 Mb/s.
.HUB: Hub reset USB Root Hub.Port1.
.HUB: USB Root Hub.Port1 Status 503:12.
.USBD: Attach Device USB 2.0 Hub. Address:2 Class:9 Subclass:0 USB:2.0. 1 configurations, 0 interfaces.
.USBD: Device Attached: USB 2.0 Hub.
.USBD: -VID:PID: 424:9514 v2.0
.Platform: malloc(0x30) = 0x226c0. (5392/16384)
.USBD: Unexpectedly short descriptor (9/41) 0x2:0x0 for device USB 2.0 Hub. Result 0x0.
.USBD: Failed to retrieve full configuration descriptor 0x0 for device USB 2.0 Hub.
.Platform: free(0x226c0) (5344/16384)
.USBD: Failed to configure device 0x2.
Are there any other customization to be done to use it woth RPI 3 ?

Thanks

José Luiz

LdB
Posts: 1004
Joined: Wed Dec 07, 2016 2:29 pm

Re: CSUD - Chadderz's Simple USB Driver (Source)

Mon Dec 10, 2018 11:48 pm

The DMA transfer section needs to be fixed up to a non cache address the raw address CSUD uses in DMA will only work on a Pi1.

Basically OR 0xC0000000 to any address passed to the DMA ... if you do not yet understand why you will need to read up on it.
https://www.raspberrypi.org/documentati ... dresses.md

It is along the same lines of having to change 0x20xx xxxx to 0x3Fxx xxxx addresses and depending how advanced you have so far coded you may or may not have run across it. I think most refer to is as the bus alias.

So this is wrong (0xC0000000 needs to be OR'ed to the address)

Code: Select all

Host->Channel[channel].DmaAddress = buffer;

Return to “Bare metal, Assembly language”