Re: problem s usb-cdc v stm32
Vojtěch Petrucha
petrucha na volny.cz
Středa Únor 21 20:29:48 CET 2018
Diky obema, pristi tyden se tu student objevi, tak na to mkneme a dam pak vedet.
V.P.
______________________________________________________________
> Od: Jan Waclawek <konfera na efton.sk>
> Komu: HW-news <hw-list na list.hw.cz>
> Datum: 21.02.2018 16:21
> Předmět: Re: problem s usb-cdc v stm32
>
No ale to by sa nevylepsilo delayom v USBD_SetClassConfig(), ktory je
volany z USBD_SetConfig(), tj. z funkcie, ktora prave spracovava
SET_CONFIGURATION.. inaksie povedane, device ten SET_CONFIGURATION
ocividne prijme, ale k PC sa odpoved dostane, len ked sa oneskori... alebo
je tam nejake komplikovanejsia suvislost.
V tom USBD_SetClassConfig() sa vola inicializacia specificka pre to CDC, ak
je to rovnake, ako example v Cube, tak USBD_CDC_Init(), v ktorom sa vola
otvaranie jednotlilvych endpointov, volanie inicializacie suvisiaceho
hardwaru (typicky USARTov) a tiez je tam ten nestastny malloc. Co z toho
moze sposobit to, ze device neodpovie, netusim.
Kazdopadne by som vsak doporucil namiesto nariekania normalne debuggovacie
postupy, t.j. zistit, co sa stane ked sa ten connect nepodari (napr. ci
nezostane cely mcu visiet v fault handleri alebo v nejakom cykle, alebo
nejakom preruseni apod.,) a samozrejme skusit prekrokovat tu kriticku
funkciu (toto mozno nebude viest k cielu, vid "delay pomaha"), pripadne
robit rozne pomocne vypisy/blikanie atd. na sledovanie cesty programu.
wek
----- Original Message ---------------
Subject: Re: problem s usb-cdc v stm32
From: Tomas Dresler <dresler na hw.cz>
Date: Wed, 21 Feb 2018 14:42:59 +0100
To: HW-news <hw-list na list.hw.cz>
>Dobry den,
>
>nesouvisi to s tim, jestli aktivujete D+ rezistor jeste pred
>inicializaci knihovny nebo hodin? To by si host myslel, ze uz jste
>pripraveny k enumeraci a zatim by STM32 jeste startovala...
>
>Tomas
>
>
>On 2018-02-21 13:50, Vojtěch Petrucha wrote:
>> Zdravim,
>> netusite prosim nekdo co by mohlo stat za problemem popsanym
>> zde: https://community.st.com/message/183355 <https://community.st.com/message/183355> (text z odkazu
>> nize...)
>> Dotaz psal pred casem na forum muj student, ja mu nedokazu poradit
>> jelikoz tu nemam ted ten HW.. pouziva Cube.. cast zapojeni
>> zde: https://ibb.co/chc8DH <https://ibb.co/chc8DH>
>> Diky
>> V.P.
>>
>>
>> --------------------------------------------
>>
>> USB - SET_CONFIGURATION fails
>>
>>
>> Hello,
>> I have encountered a problem with my STM32L452VE - when I set up USB
>> with CDC, it sometimes connects, sometimes not. When it doesn't
>> connect, Windows clasically show yellow exclamation mark.
>>
>> Increasing heap size and chaning packets size didn't solve this issue.
>>
>> I have tried sniffing USB communication and problem seems to be the
>> same every time - SET_CONFIGURATION is sent from host (PC) but no
>> response is received. Upon closer inspection, I tried to modify HAL
>> libraries by adding an extra delay, which miraculously solved the
>> issue and now it succusefully connects every time.
>>
>> As this this fix appears to be highly temporary, does anyone know the
>> root of the issue?
>>
>>
>>
>> _______________________________________________
>> HW-list mailing list - sponsored by www.HW.cz
>> Hw-list na list.hw.cz
>> http://list.hw.cz/mailman/listinfo/hw-list <http://list.hw.cz/mailman/listinfo/hw-list>
>_______________________________________________
>HW-list mailing list - sponsored by www.HW.cz
>Hw-list na list.hw.cz
>http://list.hw.cz/mailman/listinfo/hw-list <http://list.hw.cz/mailman/listinfo/hw-list>
_______________________________________________
HW-list mailing list - sponsored by www.HW.cz
Hw-list na list.hw.cz
http://list.hw.cz/mailman/listinfo/hw-list <http://list.hw.cz/mailman/listinfo/hw-list>
------------- další část ---------------
HTML příloha byla odstraněna...
URL: <http://list.hw.cz/pipermail/hw-list/attachments/20180221/08ff0539/attachment.html>
Další informace o konferenci Hw-list