2014-04-29 03:20 AM
Hello,
I am trying to make send ADC data over the USB of STM32.For the USB part I am using STM32 USB-FS-Device firmware library from ST.In the samples given I see that in order to make USB work, USB pins are not configured in AF mode. Any clarifications on this.Further when integrating my ADC functions with USB I am having some issues. Has anybody experience this kind of scenario earlier?May be those who have work put ADC data on USB can provide me some guidance.Thanks.Anuradha. #gpio_af_usb2014-04-29 03:56 AM
//USB does not work without USB Alternate Function enabled. This part is missing in STM demo.
//Interestingly DP and DM GPIOs must NOT be configured in AF mode but in IN mode (reset default).
GPIO_PinAFConfig( GPIOA, GPIO_PinSource11,GPIO_AF_USB);
GPIO_PinAFConfig( GPIOA, GPIO_PinSource12,GPIO_AF_USB);
EDIT: ''
USB Alternate Function
'' instead of ''
Alternate Function
''.
2014-04-29 04:21 AM
Dear Brutte,
Thanks for replying. But I am confused. ''//USB does not work without Alternate function enabled.''
This implies that I need to use,GPIO_PinAFConfig( GPIOA, GPIO_PinSource11,GPIO_AF_USB);
GPIO_PinAFConfig( GPIOA, GPIO_PinSource12,GPIO_AF_USB);
Again it is said,
''DP and DM GPIOs must NOT be configured in AF mode but in IN mode (reset default).''
That meansPA11 and PA12 should be in IN mode.
Conflict.
Please clarify.
Thanks.
Anuradha
2014-04-29 04:55 AM
First comment line says that you HAVE TO set GPIOA_AFRH to respective
GPIO_AF_USB
mode.
Second comment line says that you MUST NOT set GPIOA_MODER to alternate function. Leave it as input.
Does not look contradictory to me.
Of course the above does not say some other combination can not work. Only that this one does work.
The ''USB AF Weirdness'' is not very intuitive, is it?
EDIT: I have updated the comment in the above post.
2014-05-02 02:52 AM
Dear Brutte,
Thanks for the clarification.Yes I got the point. The settings are for two distinct GPIO registers so there is no contradiction.But unfortunately this configuration does not solve my problem... :(Thank you.. !!Anuradha.2014-05-02 03:23 AM
I am using STM32F407VG board to test the firmware project ''Audio_playback_and_record''found in STM32F4-Discovery_FW_V1.1.0_STfrom internal flash.
The problem I had is the following:
1. When I choose I2S as current_interface, the wave file (inAudio_sample.c) is played but with a delay.
2. When I select DAC as current_interface, I hear anothersound, which is different from the wave file.
Is there any moreadjustments to do, other than choosing current_interface and internal flash?