237 Commits

Author SHA1 Message Date
Reinhard Panhuber
2fa500af18 Minor corrections for PR
- externerlize code into functions
- correct comments
2021-01-04 17:00:23 +01:00
Reinhard Panhuber
37bb14678a Remove too verbose comment 2021-01-04 12:06:16 +01:00
Reinhard Panhuber
09d8ead4b8 Start changes - not yet finished 2021-01-04 12:02:08 +01:00
Reinhard Panhuber
13b499f910 Clean up 2021-01-03 17:59:50 +01:00
Reinhard Panhuber
56c47188d8 Rework USB FIFO allocation scheme and allow RX FIFO size reduction 2021-01-03 16:11:56 +01:00
hathach
8b34f2fca8 fix ci 2020-11-27 16:07:13 +07:00
hathach
94527951a0 add bus suspend & resume support for esp32s2 2020-11-27 15:54:55 +07:00
Jacob Potter
229be75a98 Move into if statement 2020-10-24 17:16:05 -06:00
Jacob Potter
01996457c8 CR feedback: compare CFG_TUSB_RHPORT1_MODE instead of using new macro 2020-10-24 17:11:32 -06:00
Jacob Potter
c87ed8eff1 Allow use of internal FS PHY on OTG_HS interface
Some ST parts (like STM32F74xxx / STM32F75xxx) allow the USB_OTG_HS core to be used with
either an external high-speed ULPI PHY or an internal full-speed-only (12mbps) PHY. Currently
the code assumes than an ULPI PHY is used unless the chip has an internal high-speed PHY
(`#if defined(USB_HS_PHYC)`), with no provision to use the internal FS PHY.
2020-10-18 17:01:17 -06:00
Ha Thach
80c509a0f3
Merge pull request #520 from salkinium/feature/misc_enhancements
STM32F3 IRQ remap option and some minor improvements
2020-10-11 14:55:06 +07:00
Ha Thach
762b390433
Merge pull request #521 from PanRe/uac2
Uac2
2020-10-10 14:33:42 +07:00
Niklas Hauser
f914e48d25 Dynamically check STM32F3 IRQ remap option 2020-10-10 05:02:37 +02:00
Reinhard Panhuber
032e84c9be Revert dcd_alloc_mem_for_conf() but keep changes from @kasjer for ISO EP
Add tud_audio_set_itf_close_EP_cb()
2020-10-09 19:50:05 +02:00
Gavin Li
020ad47bb0 stm32: fix ISTR and CTR_RX/TX race conditions 2020-10-06 14:43:10 -07:00
Reinhard Panhuber
9c837300f1 Fix minor issue.
- Change set_EP0_max_pkt_size() to set_EP0_max_pkt_size(void).
2020-09-28 19:23:38 +02:00
Reinhard Panhuber
529622710c Cleanup for PR. 2020-09-28 18:10:57 +02:00
Jerzy Kasenberg
642a8b00c8 synopsys: Fix odd/even frame handling for ISO
Current implementation always sets odd/even bit for ISO transactions.
This is a good strategy only if interval is 1.
For ISO endpoint interval in (micro)frames is computed as
2^(interval-1), which means that odd/frame number should stay
same for interval values > 1.
With this change only when interval is 1 odd/even bit is modified.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
6b52330969 synopsys: Remove compilation warning in dcd_edpt_close
dcd_edpt_close() no longer modifies FIFO distribution.
Code that that was commented out is removed along with
variables that are no longer used.
FIFO distribution among endpoints is handled upfront
and does not need to be modified in open and close endpoint
functions.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
6f3d0af1e6 synopsys: Fix fifo allocation schema
Recommended FIFO allocation schema includes 2 maximum endpoint sizes.
Comment suggested that this is the case while it would work according
to this description only in checked endpoints were ascending sizes.
Also two same size endpoints would be counted as one.
That is fixed by way sz is filled.

Calculation used too much modulo operation while single division was enough
to account for odd FIFO sizes.

Extra space that is evenly distributed between Bulk and control endpoints
was incorrectly calculated it could prevent allocation of ISO endpoint FIFO
when bulk endpoints existed with smaller endpoint numbers.

Minimum endpoint FIFO size is 16 32bit words, FIFO space requirement is
now observed.
2020-09-28 08:41:17 +02:00
Reinhard Panhuber
4e789b240d Start of sampling works. 2020-09-06 11:37:59 +02:00
Reinhard Panhuber
12562fc966 Merge remote-tracking branch 'upstream/master' into uac2 2020-09-04 16:23:39 +02:00
Reinhard Panhuber
37be0ca732 Fix formatting, get rid of all tabs. 2020-08-20 20:09:44 +02:00
Reinhard Panhuber
c14f68e2c1 Commit before sharing.
Setup a test example - UNTESTED!
Missing: Start transmitting audio data in set_interface.
2020-08-19 21:07:43 +02:00
Reinhard Panhuber
6309364722 Merge remote-tracking branch 'upstream/master' into uac2
Conflicts:
	src/device/usbd.c
	src/device/usbd.h
	src/portable/st/synopsys/dcd_synopsys.c
2020-08-16 14:08:24 +02:00
Reinhard Panhuber
444e4d2821 Add EP close. Fix bug in set_interface within audio. 2020-08-16 13:48:25 +02:00
Jerzy Kasenberg
e8d50a3c57 Add dcd_edpt_close() to synopsys
Endpoint close was implemented only in one driver so far.
This function is needed for interfaces with several alternate settings.

The way FIFO is allocated in dcd_edpt_open() allows to correctly close
only one IN endpoint (the one that was opened last).
2020-08-14 14:29:35 +02:00
Jerzy Kasenberg
88c5e2a37f Fix synopsys fifo flush during stall
Wrong FIFO was flushed in dcd_edpt_stall().
(epnum - 1) should only be used when accessing DIEPTXF registers.

For DIEPCTL and GRSTCTL epnum is correct index.
2020-08-12 10:26:36 +02:00
Ha Thach
6f3378f71d
Merge pull request #476 from kasjer/kasjer/fix-synopsys-fix-iso-frame-bit
Fix synopsys odd/even frame bit for IN ISO endpoints
2020-08-05 22:36:05 +07:00
Jerzy Kasenberg
e9aa36a6e8 Fix synopsys odd/even frame bit for IN ISO endpoints
For ISO endpoint driver has to specify when data
is to be transmitted (odd or even frame).
Currently code was not updating this bit resulting in
data being sent every other frame.
If interval was 1ms full data packed was sent every 2ms, and
ZLP was sent in between.
2020-08-04 09:32:41 +02:00
Reinhard Panhuber
c557bf7b2e Implement dynamic FIFO RAM allocation according to configuration desc. 2020-08-03 19:48:05 +02:00
hathach
acde49ccc9
enable pull-up in dcd_init() instead of usbd 2020-08-01 20:14:58 +07:00
Jerzy Kasenberg
c3b0389f10 Fix synopsys size check for ISO endpoint
Constraint was incorrect for ISO endpoint as stated in TODO.
2020-07-31 15:52:21 +02:00
hathach
10a8ef7614
fix nested extern declaration of 'SystemCoreClock' [-Werror=nested-externs] 2020-07-29 17:04:47 +07:00
Reinhard Panhuber
01903a4a6d Implement dynamic reallocation of RX and TX fifos for EP0.
Tested with EP0 size 8/16/32/64.
2020-07-27 21:03:20 +02:00
Reinhard Panhuber
5e3f90cd6e add 'set_EP0_max_pkt_size(...)' and fix EP0 size to 64 bytes after reset 2020-07-26 19:21:30 +02:00
hathach
0fd074afd8
change REDUCE_SPEED=0/1 to explicitly SPEED=high/full
update readme, boards.md to add link to new stm boards
2020-07-08 16:29:48 +07:00
Ha Thach
a192d99bf0
Merge pull request #457 from UweBonnes/add-stm-hs
Add stm hs
2020-07-05 14:07:08 +07:00
Uwe Bonnes
fd38178189 STM32/OTG_HS: Allow OTG_HS port to run at FS speed.
Add "REDUCE_SPEED=1" to the compile options.
2020-07-03 10:52:57 +02:00
hathach
ad5ae8c31d
update per review 2020-07-03 14:50:39 +07:00
hathach
a09a86d299
fix NVIC disable typo 2020-07-03 01:19:02 +07:00
hathach
4cec866994
correct HSE_VALUE in hal_conf
- although it is define in CFLAGS, it is worth to correct to be
consistent with other build
- extract set_speed()
2020-07-02 14:57:00 +07:00
hathach
9a290febcd
change default port some stm bsp
- f769disco default port is highspeed port1
- remove PORT0 on stlink since the board only populated HS connector
2020-07-02 11:58:40 +07:00
hathach
4966fb2e13 clean up 2020-07-02 01:25:21 +07:00
hathach
c2289777f7 Merge branch 'add-stm-hs' of github.com:hathach/tinyusb into add-stm-hs 2020-07-01 23:53:33 +07:00
Uwe Bonnes
196bdbc702 st/synopsys/dcd_synopsys.c: Remove USBC PHY PLL stabilization delay for now
While the ST code has a 2 ms stabilization delay for the USBC PHY PLL,
running without this delay showed no problem for at leat 10 USB un/replug
cycles. Observe for problems!
2020-07-01 14:45:07 +02:00
hathach
d2450abaaf only set turnaround in reset complete 2020-07-01 18:51:04 +07:00
hathach
e3974d6869 correctly set turn around according to cpu clock
help to run with low speed mcu
2020-07-01 18:44:52 +07:00
hathach
a512a31c9d Merge branch 'master' into add-stm-hs 2020-07-01 17:58:02 +07:00
hathach
ed1b670c55 clean up code 2020-07-01 17:57:37 +07:00