<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src/portable/nordic, branch 0.15.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src/portable/nordic?h=0.15.0</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src/portable/nordic?h=0.15.0'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2022-12-04T12:44:01Z</updated>
<entry>
<title>more typos</title>
<updated>2022-12-04T12:44:01Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2022-12-04T11:51:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=43b255f413e08b9e567a23b24701efbdaebcb824'/>
<id>urn:sha1:43b255f413e08b9e567a23b24701efbdaebcb824</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nrf5x: Fix reception of large ISO packets</title>
<updated>2022-09-13T06:11:56Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@codecoup.pl</email>
</author>
<published>2022-09-13T06:10:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=3133cacc6ab699244617039462f5c3870e16d835'/>
<id>urn:sha1:3133cacc6ab699244617039462f5c3870e16d835</id>
<content type='text'>
ISO packet size is up to 1023 for full speed device.
Upon completion of ISO reception, reported length of incoming packet
was truncated to one byte only.
This results in incorrect data stream for higher bit rates
48 samples * 4 bytes per sample * 2 channels = 384 bytes of data
and 128 was reported.

There is no change in logic extending xact_len to uint16_t fixes the issue.
</content>
</entry>
<entry>
<title>nrf5x: Fix endpoint internal state when closed</title>
<updated>2022-08-26T06:10:15Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@codecoup.pl</email>
</author>
<published>2022-08-26T06:01:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=5e3cfe7b5784ee94a4914b36232d28ce96cf18f2'/>
<id>urn:sha1:5e3cfe7b5784ee94a4914b36232d28ce96cf18f2</id>
<content type='text'>
Field started (regardind transfer) was only cleaed when transfer
was finished.
For audio devices set interface is called many times.
When there is no audio (silence) set interface requests zero
lenght bandwithd that in turn calls dcd_edpt_close().

When endpoint is closed due to set interface request transfer
should not longer be started since it will block next start transfer
with assert.

This just sets 'started' to false when endpoint is closed.
</content>
</entry>
<entry>
<title>nrf5x: Fix DMA access</title>
<updated>2022-06-02T15:23:35Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@gmail.com</email>
</author>
<published>2022-06-01T19:50:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=8b37aa157911ff2cd470d090bb2e276ca57f5af4'/>
<id>urn:sha1:8b37aa157911ff2cd470d090bb2e276ca57f5af4</id>
<content type='text'>
There were two problems:
- dma_running flag could be checked in USB interrupt (not set yet) then higher priority
  interrupt could start transfer, check dma_running (not set yet) set it to true start
  DMA; then when USB interrupt continues it starts another DMA that is not allowed
- when DMA is started some registers can't be safely accessed, read can yield invalid
  values (SIZE.EPOUT, SIZE.EPISO)
  current implementation could start DMA for one OUT endpoint then check that another
  endpoint also has data and while DMA was not started right away, SIZE.EPOUT was copied
  already to MAXCNT register. Later on when DMA was started not all data was read from
  endpoint due to incorrect DMA size previously set.

To prevent both cases dma_running is changed in atomic way.
Only code that actually set this value to true starts DMA, code that tried and
had dma_running flag already set simply defers DMA start to USB task.
This eliminates also need to have mutex that was there to limit access to dma_running flag
to one task only.
transfer also now has started flag that is set only after dcd_edpt_xfer() sets up total_len
and actua_len. Previously USB interrupt was disabled when total_len and actual_len were
setup to prevent race condition when data arrived to ednpoint before transfer was setup
was finished.
</content>
</entry>
<entry>
<title>added dcd_sof_enable() stubs for all other ports</title>
<updated>2022-03-07T16:05:05Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2022-03-07T16:05:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=606f932d92322a71960f51148ecc91eaf29bf507'/>
<id>urn:sha1:606f932d92322a71960f51148ecc91eaf29bf507</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename TUSB_OPT_DEVICE_ENABLED to CFG_TUD_ENABLED</title>
<updated>2022-02-25T11:35:21Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2022-02-23T14:46:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=d10326cb4e0f48a05bc39c6f51b7b0fb29427cc9'/>
<id>urn:sha1:d10326cb4e0f48a05bc39c6f51b7b0fb29427cc9</id>
<content type='text'>
TUSB_OPT_DEVICE_ENABLED still usable for backward compatible
</content>
</entry>
<entry>
<title>nrf5x: Fix EP OUT race conditions in OS build</title>
<updated>2022-01-19T08:48:04Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@codecoup.pl</email>
</author>
<published>2022-01-14T08:44:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=36b6ed8ff9035ad0c2e75de92e08799dc3a4b7ed'/>
<id>urn:sha1:36b6ed8ff9035ad0c2e75de92e08799dc3a4b7ed</id>
<content type='text'>
When two tasks entered dcd_edpt_xfer() it was possible that
first disabled interrupt to setup total_len and actual_len
but second task for another endpoint enabled interrupt
between total_len and actual_len resulting in race
condition with interrupt, hence mutex is added on top of interrupt being blocked.
</content>
</entry>
<entry>
<title>nrf5x: Fix DMA access race condition</title>
<updated>2022-01-19T08:06:43Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@codecoup.pl</email>
</author>
<published>2022-01-14T08:14:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=980ffe3b4e41ce5e43c3e8ae13f605f7d7b50b7f'/>
<id>urn:sha1:980ffe3b4e41ce5e43c3e8ae13f605f7d7b50b7f</id>
<content type='text'>
In multi-thread mode starting DMA in thread mode was
prone to race condition resulting in infinite loop.
It may happen on single core CPU with strict priority based
tasks scheduler where ready high prio task never yields to
ready low prio task (Mynewt).

Sequence that failed (T1 - low priority task, T2 - high priority task)
- T1 called start_dma()
- T1 set _dcd.dma_running (DMA not started yet, context switch happens)
- T2 took CPU and saw that _dcd.dma_running is set, so waits for _dcd.dma_running to be 0
- T1 never gets CPU again, DMA is not started T2 waits forever

OSAL mutex resolves problem of DMA starting from thread-context.
</content>
</entry>
<entry>
<title>Merge pull request #1279 from kasjer/kasjer/nrf5x-int-race</title>
<updated>2022-01-19T03:33:37Z</updated>
<author>
<name>Ha Thach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2022-01-19T03:33:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=983abfd6d81f780c079df284b0329d5ef780d21e'/>
<id>urn:sha1:983abfd6d81f780c079df284b0329d5ef780d21e</id>
<content type='text'>
nrf5x: Fix EP OUT race conditions</content>
</entry>
<entry>
<title>nrf5x: Request HFXO via OS</title>
<updated>2022-01-18T07:12:49Z</updated>
<author>
<name>Jerzy Kasenberg</name>
<email>jerzy.kasenberg@codecoup.pl</email>
</author>
<published>2022-01-11T09:45:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=f4725120a42edc853aa6db87c1d21b2ffc401a92'/>
<id>urn:sha1:f4725120a42edc853aa6db87c1d21b2ffc401a92</id>
<content type='text'>
Mynewt (similar to Soft Device) has its own reference counting for
HFXO oscillator.
So far TinyUSB requested HFXO when VBUS was detected and stopped when
VBUS was removed.
But with Mynewt running HFXO can be stopped when other interested parties
don't require HFXO anymore. This results in very difficult to track
USB transmission errors.

This change enables Mynewt specific HFXO management in Soft Device fashion.
</content>
</entry>
</feed>
