Commit Graph

25576 Commits (279f4cd5841f747c57d5de7c310c77fbba346ad4)

Author SHA1 Message Date
Bartek Szatkowski fda4988c05 Extend MbedCRC class doxygen to add more operational details 2019-06-17 12:14:27 +01:00
jeromecoutant bfd8bfdbc9 Wrong timeout value in greentea tests 2019-06-17 13:07:20 +02:00
Bartek Szatkowski 9e2b516bca Fix doxygen for MbedCRC 2019-06-17 10:21:33 +01:00
Sebastian Stockhammer 7dc4c99b23 Allow IPV4V6 stack type 2019-06-17 10:06:27 +02:00
Sebastian Stockhammer 402c471e70 Require exact context type match 2019-06-17 10:03:06 +02:00
Martin Kojtal 9974899a6b
Merge pull request #10833 from jamesbeyond/master
fix IAR compile error on fastmodels
2019-06-15 04:46:02 +01:00
Vincent Veron 31eb49b918 TARGET_STM: Add DEVICE_SPI_COUNT to use SPIs without interference
Extend to all STM targets the work done on PR10752.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-06-14 14:15:56 +02:00
Chris Trowbridge 28f7a4e6a6 Moved DEFAULT_DELAY_BETWEEN_AT_COMMANDS constant to cpp file 2019-06-14 08:02:33 -04:00
Kevin Bracey 703af8df06 mbed_toolchain: Use C++11/C11 attributes
Newer language standards have standard forms for `MBED_NORETURN` and
`MBED_ALIGN` attributes. Use them when available.

C++14 also adds `[[deprecated]]`, but as it needs to go in the middle of
structure definitions as `class [[deprecated]] MyClass`, it's not a
total drop-in-replacemend for `MBED_DEPRECATED`, so that is not
attempted here.

Using standard forms increases the chances that code analysis tools such
Coverity will recognise them - particularly important for "no return".
2019-06-14 14:56:28 +03:00
Kevin Bracey 56a043cbd1 MBED_STRUCT_STATIC_ASSERT: Use standard C++11/C11
If available, we can use standard static_assert.
2019-06-14 14:56:12 +03:00
Kevin Bracey 700410049c MBED_STRUCT_STATIC_ASSERT - avoid alignment problem
The `int : 0` bitfield this produced could force integer alignment onto
the structure it was placed in, making a structure that should be 1 byte
be 4 bytes.

Change `int` to `bool` to minimise alignment impact - should be to
nothing.

Alignment/size problem was revealed in a `sizeof` check in an
`Atomic<uint8_t>` test.
2019-06-14 14:52:40 +03:00
Kimmo Vaisanen d7858f6184 Cellular: Refactor APN db implementation to reduce memory usage
Reduce memory usage by moving actual APN database into single object file
instead of having it defined in header as a static.
2019-06-14 13:31:54 +03:00
Chun-Chieh Li 97dd30227d M23: Fix compile error with mbed fault handler
M23 doesn't implement Main Extension. So like M0/M0+, these registers HFSR/
MMFSR/BFSR/UFSR/DFSR are not present on M23. Remove access to them in mbed
fault handler for M23 targets.
2019-06-14 18:07:57 +08:00
Filip Jagodzinski c5ad70c1e5 Tests: Watchdog: Update timing test
Skip test cases with unsupported timeout values.
2019-06-14 10:59:06 +02:00
Filip Jagodzinski d634862a09 Tests: Watchdog: Decrease default timeout to 100 ms 2019-06-14 10:59:06 +02:00
Filip Jagodzinski c29cdab079 Tests: Watchdog: Update test case teardown
Added a mechanism which will prevent an initialised watchdog from
resetting the device during final greentea communication.
This allows testing watchdog timeouts as short as 50 ms.
2019-06-14 10:59:06 +02:00
Qinghao Shi 2ddb55007c fix IAR compile error on fastmodels 2019-06-14 10:59:16 +03:00
Kevin Bracey a65b1a76ac wait_ns micro-optimisation
Use `+ 1` to set the "Thumb" indicator on the `delay_loop` routine
address, rather than `| 1`. That makes it something that can be done
by the linker, rather than needing to be done at run-time.

Saves one instruction and one cycle.
2019-06-14 10:22:08 +03:00
Kevin Bracey 8d15a2342f STM: optimize us_ticker
Provide new optimizations for us_ticker and wait_us.
2019-06-14 10:22:08 +03:00
Kevin Bracey e5e2e0ac22 Freescale MCUXpresso: optimize us_ticker
Provide new optimizations for us_ticker and wait_us.
2019-06-14 10:22:08 +03:00
Kevin Bracey 57310729d4 wait_us optimization
As the timer code became more generic, coping with initialization on
demand, and variable width and speed us_ticker_api implementations,
wait_us has gradually gotten slower and slower.

Some platforms have reportedly seen overhead of wait_us() increase from
10µs to 30µs. These changes should fully reverse that drop, and even
make it better than ever.

Add fast paths for platforms that provide compile-time information about
us_ticker. Speed and code size is improved further if:

* Timer has >= 2^32 microsecond range, or better still is 32-bit 1MHz.
* Platform implements us_ticker_read() as a macro
* Timer is initialised at boot, rather than first use

The latter initialisation option is the default for STM, as this has
always been the case.
2019-06-14 10:22:08 +03:00
Martin Kojtal 5a8f795976
Merge pull request #10804 from VVESTM/vve_fix_10589
TARGET_STM: SPI: update pull up config depending on clk polarity
2019-06-14 07:45:25 +01:00
Martin Kojtal 180356130f
Merge pull request #10779 from martinichka/feature-spif-bigger-16m
Add support for SPIF of size bigger than 16Mbyte
2019-06-14 07:38:34 +01:00
Martin Kojtal 410e96b828
Merge pull request #10823 from OpenNuvoton/nuvoton_fix_dac
Nuvoton: Fix channel release in analogout_free()
2019-06-14 07:37:47 +01:00
Laurent Meunier 83e274a82c Remove unused variable
and avoid associated warning ...
2019-06-13 16:47:02 +02:00
Alexandre Bourdiol 022abea09b Add STM32H743ZI to IAR export definition 2019-06-13 15:18:37 +02:00
Martin Kojtal e3bcf0cebf
Merge pull request #10645 from fkjagodzinski/rajkan01-new_watchdog_api
Watchdog API update
2019-06-13 13:55:11 +01:00
Kimmo Vaisanen b26314a799 Cellular: Fix PLMN debug trace for IAR
IAR does not allow printing from null pointer as parameter for %s. PLMN string
can be null depending on user configuration.
2019-06-13 15:35:37 +03:00
Antti Kauppila 1ed338ef28 Valgrind & unittest fixes 2019-06-13 15:15:53 +03:00
mudassar-ublox 3ad1ee1fe4 Style issue fixed 2019-06-13 16:58:50 +05:00
Przemyslaw Stekiel cd0ad518cc Bring FPGA-Test-Shield tests into Mbed-os master. 2019-06-13 13:43:25 +02:00
Chun-Chieh Li 016ab2a417 [Nuvoton] Fix channel release in analogout_free() 2019-06-13 18:11:50 +08:00
Anna Bridge 3e6f5eba6c
Merge pull request #10764 from mirelachirica/bg96_sockid_fix_ipv6_support
BG96 ipv6 support and socket id fix for BG96 and M26
2019-06-12 17:04:46 +01:00
Anna Bridge 4ad71c4d65
Merge pull request #10802 from Patater/update-to-mbedtls-2.18.0rc4
Update to mbedtls 2.18.0rc3
2019-06-12 16:09:02 +01:00
Anna Bridge 378e997e25
Merge pull request #10753 from desmond-blue/feature-fix-nrf52-uart-count
Fix nrf52 enabled uart count and enable uart0/1
2019-06-12 14:50:12 +01:00
Anna Bridge cda2031d1b
Merge pull request #10809 from kjbracey-arm/ns_list_stdint
ns_list: avoid UINT_FAST8_MAX (fix ARM C 5 builds)
2019-06-12 14:49:47 +01:00
Chris Trowbridge ea5d8cf26d Remove unnecessary init AT commands 2019-06-12 09:36:22 -04:00
Jaeden Amero 39ea40fed3 psa: Avoid re-definition of MBEDTLS_PSA_CRYPTO_C
Mbed TLS now enables PSA APIs by default on all targets. It's not
necessary to explicitly enable MBEDTLS_PSA_CRYPTO_C, as that can be
gotten from the Mbed TLS config.h.

However, many PSA targets depend on `-DMBEDTLS_PSA_CRYPTO_C` being
defined by the Mbed OS json configuration system and are not yet
properly including the Mbed TLS configuration; for these PSA targets,
warnings may remain until this issue is fixed.

Avoiding re-definition will eliminate warnings like the following, when
building mbed-os-example-blinky:

    Compile [ 14.5%]: pal_client_api_empty_intf.c
    [Warning] pal_client_api_intf.h@35,0: "PSA_SUCCESS" redefined
    Compile [ 14.6%]: pal_client_api_intf.c
    Compile [ 14.7%]: DeviceKey.cpp
    Compile [ 14.9%]: pal_internal_trusted_storage_intf.c
    [Warning] pal_internal_trusted_storage_intf.c@45,9: 'psa_its_set' is deprecated: PS specific types should not be used [-Wdeprecated-declarations]
    Compile [ 15.3%]: val_attestation.c
    [Warning] client.h@40,0: "PSA_VERSION_NONE" redefined
    <..>
    Compile [ 33.3%]: asn1parse.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 33.5%]: aes.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 33.6%]: asn1write.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 33.7%]: psa_crypto.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 33.8%]: blowfish.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 33.9%]: camellia.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.0%]: base64.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.2%]: ccm.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.3%]: chacha20.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.4%]: chachapoly.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.5%]: cipher_wrap.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.6%]: cmac.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.7%]: cipher.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 34.9%]: bignum.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 35.0%]: des.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 35.1%]: dhm.c
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 35.2%]: ctr_drbg.c
    <..>
    Compile [ 70.9%]: EthernetInterface.cpp
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 71.0%]: InternetSocket.cpp
    Compile [ 71.1%]: L3IPInterface.cpp
    [Warning] config.h@2838,0: "MBEDTLS_PSA_CRYPTO_C" redefined
    Compile [ 71.2%]: NetworkInterface.cpp
2019-06-12 12:47:20 +01:00
Janne Kiiskila 7bfe0be43f Align also IAR - develop profile to be size optimized
IAR is also performance optimizing instead of size optimizing in
develop profile. Align also that (review feedback).
2019-06-12 13:54:34 +03:00
Janne Kiiskila 261e071013 Make ARMC5 develop profile also size optimized
Due to some historical reasons ARMC 5 compiler behaves very
differently compared to others (GCC, IAR, ARM C 6) as it optimizes
performance rather than size (like the others).

All compilers should behave the same way with the same profile,
thus ARM C 5 should also drive towards size (space).
2019-06-12 12:04:23 +03:00
Teppo Järvelin 6b11ca1371 Cellular: fix athandler to use correct timeout in case of multiple urc's
Start time was not updated when multiple urc's were found and so timeout
was set to zero. Now that start time is updated, timeout is correct.
2019-06-12 11:21:00 +03:00
desmond.chen d5624b6ec6 Fix nrf52 enabled uart count and enable uart0/1 2019-06-12 15:36:09 +08:00
mudassar-ublox 488d47b723 socket close callback 2019-06-12 12:15:10 +05:00
George Beckstein 9334b9e270 Removed mbed.h global include 2019-06-11 17:00:30 -04:00
Kevin Bracey 5c3b15cf81 ns_list: avoid UINT_FAST8_MAX
Prevent compilation issues when someone has included <stdint.h> before
a header file that needs to include <ns_list.h>.

Some toolchains like ARM C 5 will not provide UINT_FAST8_MAX in C++
unless __STDC_LIMIT_MACROS is defined, and if this was not defined the
first time <stdint.h> was included, it's too late.

We can get the maximum value for our unsigned list offset by casting -1
to it, thanks to modulo arithmetic.
2019-06-11 17:13:27 +03:00
Anna Bridge fc645bc3ed
Merge pull request #10805 from kjbracey-arm/armc5_blinky
Fix ARMC5 compilation
2019-06-11 15:07:43 +01:00
Martin Kojtal ed69fc12ad
Merge pull request #10794 from tymoteuszblochmobica/dns
LWIP DNS servers setting/getting fixed.
2019-06-11 14:14:38 +01:00
Mirela Chirica 0339ffd1b9 Cellular: Added handling for BG96 network PDP context deactivation 2019-06-11 16:05:27 +03:00
Kevin Bracey 3b178a08ef NSAPI/lwIP: Use netconn_recv_tcp_pbuf
Slight RAM+speed efficiency improvement - read the TCP implementation's
native pbufs, rather than forcing netconn_recv to generate netbuf
wrappers for us. Saves one small lwIP heap allocation per TCP packet
received.
2019-06-11 16:00:11 +03:00
Jaeden Amero 1470d06811 mbedtls: PSA entropy is compatible with other entropy
When using Mbed Crypto's PSA Entropy Injection feature on Mbed OS, it is
not required to opt out of having entropy sources added to your entropy
contexts by default (via MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES).

As integrated in Mbed OS, MBEDTLS_PSA_INJECT_ENTROPY is compatible with
actual entropy sources. PSA entropy injection is implemented using the
standard Mbed TLS NV Seed feature, and is as compatible with other
entropy sources as the standard Mbed TLS NV Seed feature which does
support entropy mixing.
2019-06-11 12:43:17 +01:00