Commit Graph

25977 Commits (ce5dbda1baeec415808928b88078c0b1f33f08fe)

Author SHA1 Message Date
Filip Jagodzinski 844864066a PSOC6_FUTURE: Fix circular dependency for GPIO-IRQ
The use of `gpio_irq_event` & `gpio_irq_handler` in `gpio_irq_s` creates
a circular dependency.

hal/gpio_irq_api.h needs
targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/TARGET_CY8C63XX/device.h, that needs
targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/objects.h, that again needs
hal/gpio_irq_api.h, before the types are defined.

Remove `#include "gpio_irq_api.h"` directive from objects.h and change
the types of `gpio_irq_s` members.
2019-07-25 11:04:16 +02:00
Filip Jagodzinski 5ee22d0c24 Test: FPGA shield: Fix GPIO-IRQ test_utils.h
Include the gpio_irq_api header to fix build failures.
2019-07-25 11:04:16 +02:00
Filip Jagodzinski 5e17eddf12 Test: FPGA shield: Update the GPIO-IRQ API tests
Use the gpio_irq_pinmap() for GPIO-IRQ testing.
2019-07-25 11:04:10 +02:00
Filip Jagodzinski 0e40e89b7f Add a sanity check for the GPIO-IRQ pinmap 2019-07-25 10:56:04 +02:00
Filip Jagodzinski bd5ecaadcd Add HAL API for GPIO-IRQ pinmap 2019-07-25 10:56:04 +02:00
Ron Eldor a1c5fcd9f7 Add a deinit function
Add a deinit function that will be called and check inside
whether context is initialized. This function is called for
freeing the CC context, instead of every time check that it's
initizliaed and free it.
2019-07-24 15:23:46 +03:00
Seppo Takalo c5c745804d
Merge pull request #11038 from fkjagodzinski/fpga_test-gpio
Extend the GPIO HAL API tests
2019-07-24 15:12:32 +03:00
Ireneusz Gaicki b9c4076741 STM32F7: Do not generate redundant IN tokens
When STM32F746-DISCO board was being used in (unsupported) USBHost mode,
the communication was unreliable. Our investigation revealed that the
problem lied in redundant IN tokens that the host generated even though
it shouldn't. This could lead to endless high-frequency NAKs being
received from device, which caused watchdog reset as USBHost spent all
time in interrupt handlers.

In our application the clocks frequencies are:
  * HCLK = 48 MHz
  * APB1 = 6 MHz
  * APB2 = 12 MHz

We have captured the raw USB High-Speed traffic using OpenVizsla.
Without this change, when USB MSD device connected to the system
responded to IN with NAK, there were excessive IN tokens generated about
667 ns after the NAK. With this commit the IN tokens are generated no
sooner than 10 us after the NAK.

The high frequency of the IN/NAK pairs is not the biggest problem.
The biggest problem is that the USB Host did continue to send the IN token
after DATA and ACK packets were received from device - *without* any request
from upper layer (USB MSD).

The USB MSD devices won't have extra data available on Bulk IN endpoint
after the expected data was received by Host. In such case IN/NAK cycle
time is only houndreds of nanoseconds, the MCU has no time for anything else.

The problem manifested not only on Bulk endpoints, but also during
Control transfers. Example correct scenario (when this fix is applied):
  * SETUP stage
    * SETUP [host -> address 0 endpoint 0]
    * DATA0 [80 06 00 01 00 00 08 00] [CRC16: EB 94]
    * ACK
  * DATA stage
    * IN
    * NAK
    ... the IN/NAK repeated multiple time until device was ready
    * IN
    * DATA1 [12 01 10 02 00 00 00 40] [CRC16: 55 41]
    * ACK
  * STATUS stage
    * OUT
    * DATA1 ZLP
    * ACK

Without this commit, in DATA stage, after the ACK was received, the host
did send extra IN to which device responded with STALL. On bus it was:
  * DATA stage
    ...
    * IN
    * DATA1 [12 01 10 02 00 00 00 40] [CRC16: 55 41]
    * IN
    * STALL
    * IN
    * STALL
  * STATUS stage
    * OUT
    * DATA1 ZLP
    * STALL

In the fault case the next SETUP was sent only after 510 ms, which
indicates timeout in upper layer.

With this commit the next SETUP is sent 120 us after the STATUS stage ACK.
2019-07-24 11:40:49 +02:00
Seppo Takalo 8881da964c
Merge pull request #11090 from AriParkkila/cell-delete-context
Cellular: Fix to delete context just once
2019-07-24 11:15:50 +03:00
Kyle Kearney b65be5fa29 Bug fixes to I2C and SPI drivers
- Fix assert when spi_master_block_write called with 0 size
- Fix assert when spi_format called before spi_frequency
- Simplify implementation of spi_master_write
- Simplify pointer arithmetic expressions in cyhal_spi_transfer and
  cyhal_spi_transfer_async
- Fix I2C driver not honoring the frequency specified during init.
2019-07-23 15:40:45 -07:00
Neil Tuttle 2bf79c1588 PSOC6: Remove USBDEVICE from FUTURE_SEQUANA targets 2019-07-23 15:30:06 -07:00
Lin Gao 2a06ae20cc Added missing pinmap definitions. Fixed target JSON config to avoid treating cc3220sf a target 2019-07-23 14:52:50 -05:00
Ron Eldor 4e29c8f939 Make the cmac context a typedef
Make the cmac context a typedef, to be compatible with c code.
2019-07-23 16:05:33 +03:00
Ron Eldor f492ce8405 Handle CC context correct
Initiate the CC context in the starts function and in the reset.
In the reset function, free aes context before.
Free the context in the finish function and reset function.
2019-07-23 16:05:27 +03:00
Seppo Takalo 0b8ae1b098
Merge pull request #11084 from mtomczykmobica/IOTSTOR-832
NVStore.cpp (and KVStore) - run-time failure handling missing
2019-07-23 15:28:26 +03:00
Ron Eldor 4cf3e1c1bc Style fixes
Remove redundant extra lines.
2019-07-23 13:54:09 +03:00
Ari Parkkila ac78b5ab16 Cellular: Fix to delete context just once 2019-07-23 03:04:24 -07:00
Seppo Takalo 3a96f436ea
Merge pull request #10847 from davidsaada/david_ps_add_sec_flags
PSA storage: Conform to "PSA 1.0.0" spec release
2019-07-23 12:05:22 +03:00
Seppo Takalo 6dfbe54389
Merge pull request #11069 from qVlad/add-sectors-for-stm32F446ZE
add defines sectors for STM32F446ZE
2019-07-23 12:02:18 +03:00
Seppo Takalo 25198ba056
Merge pull request #11070 from kjbracey-arm/iar_exception_warning
IAR: Suppress "exceptions are disabled" warning
2019-07-23 11:42:15 +03:00
Seppo Takalo 7dacafa076
Merge pull request #11076 from kjbracey-arm/mstd
ARMC5 <array> extensions
2019-07-23 11:38:34 +03:00
Seppo Takalo c505d25186
Merge pull request #11077 from bentcooke/52840_align
NRF52840: remove align instructions from gcc linker for ARM.extab exi…
2019-07-23 11:37:47 +03:00
int_szyk 4c13c469d9 Can compile without serial 2019-07-22 16:17:52 +02:00
Marcin Tomczyk 6cdb8f0f49 NVStore.cpp (and KVStore) - run-time failure handling missing 2019-07-22 15:04:20 +02:00
Seppo Takalo a0e88ad330
Merge pull request #11059 from desowin/dwarf
GCC ARM: Increase develop and release debug level
2019-07-22 15:31:24 +03:00
Seppo Takalo 13873f388c
Merge pull request #11062 from AGlass0fMilk/fix-nrf52-saadc-res-again
Fix SAADC resolution for nRF52-based targets... again
2019-07-22 15:30:11 +03:00
Seppo Takalo bec388ffb1
Merge pull request #11078 from bentcooke/52840_patch2
NRF52840: fix include path issues for ble pal cordio ll and gcc
2019-07-22 14:11:50 +03:00
Seppo Takalo 0e33dd7e62
Merge pull request #11080 from kyle-cypress/pr/cy8ckit-062s2-43012
Add target for CY8CKIT_062S2_43012
2019-07-22 14:09:33 +03:00
Seppo Takalo 0d6a3be91d
Merge pull request #11079 from bentcooke/52840_patch3
NRF52840: enable TRNG in Nordic SDK config
2019-07-22 14:07:41 +03:00
Seppo Takalo 5aff943a84
Merge pull request #11064 from NXPmicro/Update_LPC_GPIO_IRQ
MCUXpresso: Fix the LPC GPIO IRQ driver
2019-07-22 11:42:46 +03:00
Seppo Takalo 94f434227d
Merge pull request #11060 from NXPmicro/LPC_Update_SPI_Driver
MCUXpresso: Update LPC spi driver
2019-07-22 11:37:20 +03:00
Kyle Kearney 40557cefeb Add target for CY8CKIT_062S2_43012 2019-07-19 15:44:27 -07:00
Ben Cooke 36bd06c00a NRF52840: enable TRNG in Nordic SDK config 2019-07-19 13:24:12 -05:00
Ben Cooke 4273221919 NRF52840: fix include path issues for cordio ll and gcc 2019-07-19 12:09:31 -05:00
Ben Cooke 892adc6e91 nrf52840: remove align instructions from gcc linker for ARM.extab exidx sections 2019-07-19 10:22:05 -05:00
Kevin Bracey 940ed6c2b1 ARMC5 <array>: Add tuple interface 2019-07-19 17:24:14 +03:00
Kevin Bracey 0449e6f1a3 ARMC5 <array>: add comparison operators 2019-07-19 17:18:10 +03:00
Kevin Bracey 9f258c4798 ARMC5 <array>: remove not-working constexpr 2019-07-19 17:17:37 +03:00
Kevin Bracey fbf89272cc ARMC5 <array>: permit zero size 2019-07-19 17:17:07 +03:00
jeromecoutant 96a773a0e6 STM32L4: update drivers version to CUBE V1.14.0 2019-07-19 13:15:07 +02:00
Seppo Takalo 77786926bc
Merge pull request #11039 from kjbracey-arm/mstd
Add <mstd_xxx> C++ headers
2019-07-19 13:00:41 +03:00
Seppo Takalo 8006d5f3c3
Merge pull request #11035 from Patater/update-to-mbedtls-2.18.1rc1
mbedtls: Update to Mbed TLS 2.18.1
2019-07-19 11:22:13 +03:00
Ari Parkkila 7a5e4ca5da Cellular: Fix BG96 power up 2019-07-18 23:13:36 -07:00
Neil Tuttle a372992aee PSOC6: USB device implementation 2019-07-18 11:16:16 -07:00
Kevin Bracey 852a626399 Add mstd_xxx headers to unit tests
Stripped down headers that route through to `std` forms more - eg
no local implementation of `atomic` or `mutex`.
2019-07-18 20:02:07 +03:00
Kevin Bracey 85cd3cd9cc Add C++17 uninitialized storage ops 2019-07-18 20:02:07 +03:00
Kevin Bracey f27c7ecb64 Add ARMC5 unique_ptr
Standard library implementation should be fine for other toolchains.
2019-07-18 20:02:07 +03:00
Kevin Bracey b1c35b7a86 Move Atomic.h to <mstd_atomic>
`mbed::Atomic<T>` becomes `mstd::atomic<T>`, alongside the other
standard C++ library lookalikes.
2019-07-18 20:02:07 +03:00
Kevin Bracey da3cd6f053 Add <mstd_mutex>
Add add-standard-as-possible version of C++11 <mutex>.

A lot of the stuff in there is generic, but the actual mutex classes and
call_once need to interface with the OS.

For those, they're not available in ARMC5 or IAR; retargetting would be
necessary for ARMC6 and GCC, and I've yet to investigate how whether
that's possible. So for now I'm using local implementations.

Although `Mutex` in principle could support `timed_mutex` and
`recursive_timed_mutex`, we don't have `chrono` for the time parameters,
so hold off for now.

For the generic stuff like mstd::unique_lock, they are aliased to
std::unique_lock where possible.
2019-07-18 20:02:07 +03:00
Kevin Bracey 0bb4c050b7 SingletonPtr: API extensions, make constexpr
* Adjust definition to make the default constructor `constexpr`.
  This permits use in classes that want lazy initialization and their
  own `constexpr` constructor, such as `mstd::mutex`.

* Add `get_no_init()` method to allow an explicit optimisation for
  paths that know they won be the first call (such as
  `mstd::mutex::unlock`).

* Add `destroy()` method to permit destruction of the contained object.
  (`SingletonPtr`'s destructor does not call its destructor - a cheat
  to omit destructors of static objects). Needed if using in a class
  that needs proper destruction.
2019-07-18 20:02:04 +03:00