2010-04-13 06:44 AM
USB on single target, on IAR debugger EPxRegs arre reset
#stm32-usb2011-05-17 04:46 AM
I have what looks like the same problem. Both the endpoint registers and the memory map addresses always revert to zero in my driver. (The other registers seem to be okay.) Needless to say my driver is far from working. HOWEVER, using ST’s code without mods these registers work using IAR tools and the yellow jlink.
I’ve tried incorporating much of ST’s setup code in order to debug my stuff. Because nobody is yet paying me for my 32-bit code I switched over to 8-bit code to write something I can get paid for. If anyone has any clues to what I could be doing incorrectly I would be grateful. Both of my planned USB drivers are intended to be 100% interrupt driven save for setup. Background code wanting to write (IN transaction) sets a few bytes of memory and causes an interrupt. Reads from the host (OUT transactions) are setup the same way. Both forms return status info for the background code.2011-05-17 04:46 AM
The EPxRegs can be modified if Resume bit is set to 1. Else, registers are not accessible????
2011-05-17 04:46 AM
I had the USB_CNTR resume bit zero. I will try setting resume and report back - hopefully in a few days. guibert.benoit, if you have resume=0 and changing it works please report back here.
Right now my mind and debug tools are setup ready to try yet another iteration of Sweet Home Pellet Grill 16F884 firmware. It works with pellet stove fuel but has trouble with the near infinite variety of “BBQ flavor�? fuels. My latest tweak may work. Fingers crossed....2011-05-17 04:46 AM
Yes STMicroelectroncs, under what circumstances do the endpoint registers refuse to be initialized?
I have a program that works and a program that doesn't work and it is not at all clear what makes the difference.2011-05-17 04:46 AM
Hi ,
USB Registers and PMA memory is accessible only when 48MHz Clock of the Analog engine is enabled, APB Clock is enabled and not in reset mode and finally of course when the USB Peripheral is enabled by software, For more details regarding registers refer to our RM0008 Reference Manual. I would suspect that in your case to check that all clocks are enabled and USB is active. Hope this helps you. Cheers, STOne-32.2011-05-17 04:46 AM
2011-05-17 04:46 AM
''check that ... USB is active.''
Can the USB be enabled but inactive; and in the inactive state the endpoint registers cannot be set? Does setting the resume bit make an inactive USB active?2011-05-17 04:46 AM
Hi Guibert,
All our code dealing with USB Power and enable is inside this file ''usb_pwr.c'' , you can explore functions like : PowerOn, PowerOff , Suspend etc... There are also calls to functions like ''Enter_LowPowerMode();'' defined in hw_config.c file and depends on your board implementation. Cheers, STOne-32.2011-05-17 04:46 AM
If the DP and DM are in SE0 state, registers are not accessible (in continuous reset?). I use a tranceiver with integrated pull down on down stream signals. The problem is fixed with a 1.5K pull up on DP-STM32. (The pull up on DP-USB is lock to 0).
If the CAN1/2 are not reset, shared SRAM is not accessible. Problem fixed by desinit CANx. Now it is OK.