Commit Graph

3227 Commits

Author SHA1 Message Date
Mengsk 46875a3912 Optimize FIFO for byte transfer.
Signed-off-by: Mengsk <admin@hifiphile.com>
2020-05-13 23:54:23 +02:00
Ha Thach 4e6aa0d81d
Merge pull request #390 from hathach/detect-nrf-softdevice
detect if SD is actually present on the flash using SD magic
2020-05-12 14:35:45 +07:00
Ha Thach 16a3f0a27a
Update bug_report.md 2020-05-09 17:56:12 +07:00
Ha Thach 71e1609ff3
Merge pull request #398 from HiFiPhile/iar
Add IAR EWARM compiler attribute and endian support.
2020-05-08 23:55:43 +07:00
Mengsk f02ad1d0dc Add IAR compiler attribute and endian support. 2020-05-08 13:29:33 +02:00
Ha Thach e6d946123c
Merge pull request #395 from hathach/define-log-printf
add CFG_TUSB_DEBUG_PRINTF() for log retargeting
2020-05-08 14:48:20 +07:00
hathach eeb076454b add CFG_TUSB_DEBUG_PRINTF() for log retargeting 2020-05-08 12:56:32 +07:00
Ha Thach f9f0873b72
Merge pull request #393 from xobs/fix-debug-warning
device: fix build warning when CFG_TUSB_DEBUG >= 2
2020-05-08 12:38:50 +07:00
Sean Cross 63bd8d2e44 device: fix build warning when CFG_TUSB_DEBUG >= 2
The function is defined inside of a function body which generates a
warning.  Circuit Python treats these warnings as errors, and so
refuses to build with debugging enabled:

    ../../lib/tinyusb/src/device/usbd_control.c: In function 'usbd_control_xfer_cb':
    ../../lib/tinyusb/src/device/usbd_control.c:195:19: error: nested extern declaration of 'usbd_driver_print_control_complete_name' [-Werror=nested-externs]
      195 |       extern void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, tusb_control_request_t const *));
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make: *** [../../py/mkrules.mk:55:
    build-simmel/lib/tinyusb/src/device/usbd_control.o] Error 1

Move the declaration to the top of the function to silence this warning.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-07 19:03:40 +08:00
Ha Thach 286ff03ffa
Merge pull request #391 from kasjer/kasjer/stm32l476disco-clock-configuration
stm32l476disco clock configuration
2020-05-07 16:19:13 +07:00
Ha Thach 04c20ff74c
Merge pull request #392 from kasjer/kasjer/change-package-type-to-sdk
Change mynewt package type to sdk
2020-05-07 16:13:00 +07:00
Jerzy Kasenberg 0f8ab86bee Change mynewt package type to sdk
For normal mynewt packages newt tool wants to have specific
folder structure. It wants to have src and include directories,
and only include (and arch related) directory is added to compiler
include search list.
Since TinyUSB has different folder structure newt tool will not
add anything to -I directives and those would need to be
specified as pkg.cflags: "-I@tinyusb/src"

Recent change to newt tool allowed to add specific include directories
for external (sdk) packages so just including package will add
necessary -I to build commands.

This commit changes package type to sdk and specifies src as include
root for TinyUSB.

For older newt tool adding sdk and include_dirs does not break build.
2020-05-07 10:11:58 +02:00
Jerzy Kasenberg 615369a6eb stm32l476disco: Fix system clock setup
Code suggested that PLL with MSI is used resulting in 80MHz clock.
When in fact PLL was not configured and system clock was left at MSI 48MHz.

This happens because PLL configuration requires that SysTick interrupt
has interrupt priority level configured correctly.
As it seems ST code intentionally setups variable uwTickPrio to invalid
value and later when it is not setup by user code configuration
of oscillator will fail before PLL is configured.

This simple changes systick priority to some valid value that
allows clock to use PLL.
2020-05-06 15:13:55 +02:00
Jerzy Kasenberg d9e534f6f2 stm32l476disco: fix uninitialized filed usage
Field PLLState was not initialized in RCC_OscInitStruct.PLL in
function SystemClock_Config().
Value is used in HAL_RCC_OscConfig() regardless of oscillator.
In lucky case value would be 0 RCC_PLL_NONE and nothing would
happen.
If value was incorrect following line would end up in assert:
assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState));

If value was valid but no RCC_PLL_NONE pll could be configured
with some other random values.

Setting PLLState to RCC_PLL_NONE eliminates potential problem.
2020-05-06 14:25:46 +02:00
hathach 58b99e59d4 detect if SD is actually present on the flash using SD magic
even with SOFTDEVICE_PRESENT defined, SD may not be present on actual
flash.
2020-05-05 23:07:56 +07:00
Ha Thach 101f234a16
Merge pull request #387 from duempel/redesign_transmit_synopsys
Redesign of Synopsys device transmission
2020-05-04 14:41:20 +07:00
Jan Dümpelmann fd69cc3dcc clean up
renaming function and variables
changing indent size
2020-05-04 07:59:13 +02:00
Ha Thach d1141c2d9d
Merge pull request #389 from hathach/fix-samg
Fix SAMG
2020-05-02 18:47:27 +07:00
hathach e61bf415fe minor update net example
samg failed to run net example
2020-05-02 18:35:46 +07:00
hathach 0e30afa691 abstract all UDP_CSR 2020-05-02 18:24:23 +07:00
hathach 3ad0cd041b clean up 2020-05-02 16:29:22 +07:00
hathach ac3c645dc1 fix EP0 data toggle issue 2020-05-02 16:09:28 +07:00
hathach 2a479175ae remove toggle walkaround, fix control stall race condition 2020-05-02 14:51:21 +07:00
Ha Thach 520df6bb53
Merge pull request #388 from hathach/fix-samd-setup-race
fix dcd samd race condition with setup packet
2020-04-30 00:50:21 +07:00
hathach a74a823b0a fix dcd samd race condition with setup packet
setup packet can complete together with previous status (in & out).
Always make sure to prepare valid buffer for holding setup packet when
queuing control status.
2020-04-30 00:29:47 +07:00
Jan Dümpelmann 59ff208c65 Changed switch into if statements 2020-04-29 12:37:29 +02:00
Jan Dümpelmann 3e6feb7f6d Redesign of Synopsys device transmission
Changes:
  - checking if tx buffer empty interrupt is masked
  - process more than one packet in isr
  - mask tx buffer empty just after all bytes were written
  - use of transmit_fifo_packet instead of transmit_packet
2020-04-29 11:32:22 +02:00
Ha Thach e9c71055ac
Merge pull request #386 from hathach/follow-383
Follow 383
2020-04-29 15:27:25 +07:00
hathach 449b337467 fix ci board test with esp32 2020-04-29 13:03:39 +07:00
hathach 6f4b6a1d03 remove the use of TU_VERIFY_HDLR 2020-04-29 11:31:27 +07:00
hathach 94fed7db0e fix esp32 ci adding FREERTOS STATIC to sdkconfig default 2020-04-29 11:31:04 +07:00
Ha Thach d4511186a2
Merge pull request #383 from kasjer/kasjer/fox-busy-flag-race-condition
Fix endpoint busy flag race condition
2020-04-29 10:12:31 +07:00
Ha Thach b52bc894f8
Merge pull request #380 from hathach/fix-usbnet-synopsys
synopsys turn off TX FIFO Empty for EPIN if all bytes are written
2020-04-28 11:12:58 +07:00
hathach fcdb22b2f9 fix typo 2020-04-28 10:53:43 +07:00
Jerzy Kasenberg 63cefb7615 Fix endpoint busy flag race condition
Busy flag was set to true after call to dcd_edpt_xfer().
In some cased it was possible that transfer finished before function
ended.
In this case busy flag could be set to false before it was set to
true.
Then setting it to true after dcd_edpt_xfer() made edpoint busy forever.

This change marks endpoint as busy before transfer is started to
avoid race condition.
2020-04-27 16:42:35 +02:00
hathach 958b5510cb added comment for hw clearing TXFE 2020-04-27 13:17:47 +07:00
hathach e785b09118 TXFE is read only bit 2020-04-27 12:06:14 +07:00
hathach d0487088ac revert a change to net driver 2020-04-26 23:04:17 +07:00
hathach 00fcf829a1 sync synopsis fix for esp32s2 2020-04-26 22:41:04 +07:00
hathach 8d18d6077b turn off TX FIFO Empty for EPIN if all bytes are written
fix dcd synopsys issue with usbnet #289
2020-04-26 22:14:59 +07:00
hathach 83353dd93f add TODO for usbnet clean up 2020-04-26 22:03:05 +07:00
hathach a1c599f4b6 clean up log message 2020-04-26 22:02:49 +07:00
Ha Thach d54343e4a6
Merge pull request #379 from hathach/add-usbd-edpt-open
add usbd edpt open
2020-04-26 15:23:11 +07:00
hathach 9c8517a8d2 fix missing debug log macros 2020-04-26 14:58:23 +07:00
hathach 017c95037f add usbd edpt open
- RTT mode is blocking to prevent log lost
- Improve logging message
2020-04-26 14:51:44 +07:00
Ha Thach f1ecda392f
Merge pull request #378 from kasjer/kasjer/synopsys-txfe-interrup-loop
synopsys: Reduce interrupt time for IN ZLP
2020-04-25 17:52:46 +07:00
Jerzy Kasenberg b949ae596f synopsys: Reduce interrupt time for IN ZLP
For IN endpoints output FIFO is filled in interrupt, therefor before
endpoint is enabled, DIEPTSIZ is set with correct size of packet.
Then endpoint is enabled and FIFO empty interrupt is enabled.

This works fine except for the ZLP. Enabling FIFO empty interrupt
results in interrupt handler being called all the time because
there is nothing to put in the FIFO.
Eventually it ends when IN token is received and empty
packed is transmitted out.

This change does not enable FIFO empty interrupt for ZLP reducing
CPU load.
2020-04-24 17:38:30 +02:00
hathach c59fa77427 Revert "Merge pull request #359 from versioduo/midi-flow-control"
This reverts commit 1d33aa9b6f, reversing
changes made to 718db7e536.
2020-04-23 23:25:20 +07:00
Ha Thach f8bb4c86ef
Merge pull request #376 from hathach/add-more-example
Add dynamic configuration example
2020-04-23 14:50:27 +07:00
hathach a029c63b30 complete the midi output for dynamic configuration 2020-04-23 14:37:22 +07:00