Re: [libopenstm32-devel] stm32f103 and USB
Status: Inactive
Brought to you by:
uh1763
From: gwenhael.goavec <gwe...@fe...> - 2011-02-17 13:37:32
|
On Wed, 16 Feb 2011 09:33:54 +1300 Gareth McMullin <ga...@bl...> wrote: > On Wed, Feb 16, 2011 at 8:38 AM, Gareth McMullin > <ga...@bl...> wrote: > > Ok, there seems to be a lurking bug in the USB code. You aren't the > > first person to have this problem. I unfortunately can't reproduce the > > problem with either of the two hosts I have available. > > I've found the problem: just tried building with summon-arm-toolchain, > and I observe the same problem. The build_config_descriptor() function > uses memcpy() to contruct the configuration descriptor, on entry to memcpy > an invalid instruction is encountered and the target is found in > blocking_handler(). > No further USB requests are handled. > > It seems that summon-arm-toolchain is linking in an ARM mode memcpy > instead of thumb. This can be solved by adding -mthumb to the linker > options. > > I've attached a patch to the generic makefile, which just added the full CFLAGS > to the linker command line. It solved the problem and should be safe. > I've also removed the "-Wl,--gc-sections", and changed options to "-O0 -g3". > The options in git make the examples very hard to debug, and I think this > may create a barrier to newbies trying out the library. Especially > for an example, > we can give up some size to make things easier. > > Regards, > Gareth > Hi, I have just tested after having applied the patch. This ok! Thank you ! Regards, Gwenhaël |