Commit Graph

28557 Commits (0c8add6e28d03ed56eecbd20cd563faf94bfb1da)

Author SHA1 Message Date
aglass0fmilk dc19460fa3 Remove use of deprecated UART driver (as opposed to UARTE). Disable unused TWIM peripheral (deprecated TWI peripheral is currently used for I2C master mode operation). 2020-01-09 16:35:06 -05:00
George Beckstein b6befee4cf Properly configure PRS API so it actually delegates the shared interrupt slot to the appropriate peripheral 2020-01-09 16:35:06 -05:00
Antti Kauppila 2fb167be26 Fixed IOTCELL-2384
Earlier we called AT+QICSGP only if the username and password was set.
It seems that we must call it also to set up APN while in AT mode.
This commit fixes the issue + updated IPv4/v6 handling to be correct in the same call
2020-01-09 17:19:24 +02:00
Janne Kiiskila e20f2d30a2 target_test - assert if sectors keyword missing
Assert it properly and thus give out the target name where the
issue is, rather than just error out with KeyError and leave the
poor sod wondering where exactly the issue is.

Before:
```

=================================== FAILURES ===================================
_____________________________ test_bl_has_sectors ______________________________
    def test_bl_has_sectors():
        """Assert a bootloader supporting pack has sector information"""
        cache = Cache(True, True)
        named_targets = (
            target for target in TARGETS if
            (hasattr(target, "device_name") and getattr(target, "bootloader_supported", False))
        )
        for target in named_targets:
            assert target.device_name in cache.index,\
                ("Target %s contains invalid device_name %s" %
                 (target.name, target.device_name))
>           assert cache.index[target.device_name]["sectors"],\
                ("Device name %s is misssing sector information" %
                 (target.device_name))
E           KeyError: 'sectors'
```

After

```
___________________________________________________ test_bl_has_sectors ___________________________________________________

    def test_bl_has_sectors():
        """Assert a bootloader supporting pack has sector information"""
        # ToDo: validity checks for the information IN the sectors!
        cache = Cache(True, True)
        named_targets = (
            target for target in TARGETS if
            (hasattr(target, "device_name") and getattr(target, "bootloader_supported", False))
        )
        for target in named_targets:
            assert target.device_name in cache.index,\
                ("Target %s contains invalid device_name %s" %
                 (target.name, target.device_name))
>           assert "sectors" in cache.index[target.device_name],\
                ("Target %s does not have sectors" %
                 (target.name))
E           AssertionError: Target NUCLEO_L073RZ does not have sectors
E           assert 'sectors' in {'algorithms': [{'default': True, 'file_name': 'CMSIS/Flash/STM32L0xx_192.FLM', 'ram_size': None, 'ram_start': None, ....on_secure_callable': False, 'peripheral': False, ...}, 'default': True, 'size': 196608, 'start': 134217728, ...}}, ...}

```

This helps you finding the offending target a bit faster.

Kudos to Jammu Kekkonen (jammu.kekkonen@arm.com) to figuring out how to actually
run this test & the assertion.

Ref: Mbed OS issue #12219
2020-01-09 16:50:45 +02:00
Martin Kojtal dc6320239b
Merge pull request #12162 from JanneKiiskila/CMSIS-pack-STM32WB
CMSIS-pack update for STM32WB-family
2020-01-09 15:03:25 +01:00
Kevin Bracey 8b02c4ed1c Add missing <string.h> includes 2020-01-09 14:52:54 +02:00
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
Kevin Bracey 9577b0853b Add mstd_new for mstd::launder
Increasingly clever compilers can hit funny aliasing problems with
object stores like mbed::Callback. Add access to the C++17 launder
facility.
2020-01-09 14:52:50 +02:00
Kevin Bracey 33d9abe762 Merge callback tests 2020-01-09 14:52:50 +02:00
Martin Kojtal 8c4ed4a6cb
Merge pull request #11897 from kjbracey-arm/crc
MbedCRC: improve init value handling and tests
2020-01-09 13:31:30 +01:00
Martin Kojtal 759ce271c2
Merge pull request #12200 from MultiTechSystems/fix_PeripheralPins
Minor fixes for peripheral pins on Dragonfly Nano
2020-01-09 13:17:01 +01:00
Martin Kojtal d7b7223bcd
Merge pull request #12218 from mprse/ticker_interrupt_test_fix
tests-mbed_hal-common_tickers: adapt ticker_interrupt_test() test case for high frequency tickers - WIP
2020-01-09 13:16:16 +01:00
Martin Kojtal ec3fc672a1
Merge pull request #12215 from u-blox/ubx_get_ip_addr
Cellular: Implementation of virtual get_ip_address funtion in ublox-api
2020-01-09 12:43:12 +01:00
Martin Kojtal 1fb9dd7ddd
Merge pull request #12122 from AnttiKauppila/visibility_fixes
ATHandler refactoring
2020-01-09 12:05:08 +01:00
Martin Kojtal 974baaf199
Merge pull request #12143 from VeijoPesonen/blockdevices_testable
Blockdevice config changes to make it possible to run littlefs filesystem tests
2020-01-09 12:04:20 +01:00
Martin Kojtal 222d31c2b6
Merge pull request #12037 from kjbracey-arm/sharedptr_move
SharedPtr: add move operations
2020-01-09 12:03:45 +01:00
Chun-Chieh Li 4405ab46b6 ESP8266: Simplify flow control and enable per-socket reconnection
1.  Fix 'spurious close' by adding close() in open(). 'spurious close' gets frequent and cannot ignore when send() changes to asynchronous. User can retry open() until 'spurious close' gets true.
2.  Allow only one actively sending socket because:
    (1) ESP8266 AT packets 'SEND OK'/'SEND FAIL' are not associated with socket ID. No way to tell them.
    (2) In original implementation, ESP8266::send() is synchronous, which implies only one actively sending socket.
3.  Register 'SEND OK'/'SEND FAIL' oobs, like others in ESP8266::ESP8266 constructor. Don't get involved in oob management with send status because ESP8266 modem possibly doesn't reply these packets on error case.
4.  Now that ESP8266::send() changes to asynchronous, drop the code with _parser.recv("SEND OK")/_parser.recv("SEND FAIL"). _parser.recv("SEND OK")/_parser.recv("SEND FAIL") and 'SEND OK'/'SEND FAIL' oobs both consume 'SEND OK'/'SEND FAIL' packets and complicate flow control.
2020-01-09 12:48:22 +02:00
Martin Kojtal dbb0695311
Merge pull request #12202 from LMESTM/Increase_MSI_Freq_out_of_deep_sleep
Increase MSI clock frequency when exiting deep sleep
2020-01-09 10:49:20 +01:00
Przemyslaw Stekiel db8e77672f tests-mbed_hal-common_tickers: adapt ticker_interrupt_test() test case for high frequency tickers
On some targets with very fast counters used for us ticker (e.g. 26 MHz) tested interrupt delays provided in the ticker_timeout array may be too short (execution of the set_interrupt() function takes longer than the tested delay).
We will skip tested ticker delay if the delay is less than assumed max set_interrupt() function execution time (20 us).
Also, the test array will be extended.
2020-01-09 08:32:30 +01:00
d-kato 3a2ab1b56e GR_LYCHEE: enable bootloader support 2020-01-09 16:18:14 +09:00
mudassar-ublox 075a6fdd99 Override virtual get_ip_address funtion in ublox-api for targets UBLOX_C030_U201 and UBLOX_C027 2020-01-09 12:16:48 +05:00
d-kato aad53c2377 RZ_A1H: enable bootloader support 2020-01-09 16:15:50 +09:00
Janne Kiiskila 0a7eb62b9d Size & sectors also for STM32WB55VGYx
The size was still 16 megabytes, while in reality it is one megabyte.
Added the sectors, too (see previous commit msg for details).
2020-01-08 22:00:41 +02:00
Janne Kiiskila 7816f29a57 Sector size definitions to index.json/STM32WB5xx
Adding manually the sector sizes now. The reference manual states
these chips have a fairly nice memory map as sectors are evenly sized
and fairly small. Quote from reference manual;

"The Flash memory is organized as follows:
• A main memory block containing 256 pages of 4 KB, each page with eight rows of
512 bytes."

https://www.st.com/content/ccc/resource/technical/document/reference_manual/group0/83/cf/94/7a/35/a9/43/58/DM00318631/files/DM00318631.pdf/jcr:content/translations/en.DM00318631.pdf
- chapter 3.3.1 Flash memory organization
- internal flash starts at address 0x0800 0000
2020-01-08 21:54:03 +02:00
Martin Kojtal 40b7901cfb
Merge pull request #12217 from OpenNuvoton/nuvoton_usbd
Nuvoton: Add DEVICE_USBDEVICE detection in usbd implementation
2020-01-08 17:00:23 +01:00
Martin Kojtal 8d94d4ce92
Merge pull request #12214 from kivaisan/move_string_to_pdp_type_to_cellularcontext
Cellular: Move string_to_pdp_type method to CellularContext
2020-01-08 16:59:58 +01:00
Hugues Kamba efd3763467 NRF5x targets: Replace UARTSerial references with BufferedSerial
`BufferedSerial` is `UARTSerial` renamed to convey the original purpose
of the class. It is the recommended buffered I/O serial class.
2020-01-08 15:42:07 +00:00
Hugues Kamba e0c628cbb7 NRF51822: Fix baremetal linker error
Ensure the NRF51822 `us_ticker.c` module content is compiled in only if
the target supports USTICKER.
2020-01-08 15:33:01 +00:00
Martin Kojtal af03f839e2
Merge pull request #10959 from OpenNuvoton/nuvoton_m2351_psa
M2351: Support TFM level 1
2020-01-08 16:09:35 +01:00
Kevin Bracey a0197dba49 Thread: remove methods deprecated in 5.10 2020-01-08 16:47:18 +02:00
Kevin Bracey d23db1a1e4 Change signals test to test new methods 2020-01-08 16:47:18 +02:00
Martin Kojtal c42125f890
Merge pull request #12151 from hugueskamba/hk-nrf-fix-baremetal-build
NRF5x: Fix baremetal linker error
2020-01-08 14:41:26 +01:00
Janne Kiiskila 51f22e2f59 Fix ROM size for STM32WB55RGVx (16 MB -> 1 MB)
Per feedback from STM the correct ROM size is 1 MB, instead of
16 MB. The KEIL source information is (in the pack itself) wrong, since
the KEIL webpage lists it as a 16 MB part, too - but if you look into
other sources - it is indeed 1 MB.
2020-01-08 15:39:02 +02:00
Janne Kiiskila dfb62a22bf CMSIS-pack update for STM32WB-family
Update of the tools/arm_pack_manager/index.json -file for the
STM32WB-chipset family.
2020-01-08 15:38:11 +02:00
Martin Kojtal 4b0c4a073c
Merge pull request #12216 from rvolosatovs/fix/unit-tests
Fix dl_channel tests
2020-01-08 14:04:25 +01:00
Martin Kojtal 1a6934adc4
Merge pull request #12081 from micgur01/master
Expose target_offset and header_offset parameters in targets.json
2020-01-08 14:01:57 +01:00
cyliangtw b924a922a8 Add DEVICE_USBDEVICE detection in usbd implementation to avoid compiler error on target without usb-device 2020-01-08 19:36:51 +08:00
Kevin Bracey ccd2a32ad1 MbedCRC: improve default constructors
Original default constructor implementation wasn't quite working
properly; it didn't cope with the new "mode_limit" parameter.

Change mechanism so that this now works:

    MbedCRC<POLY32_BIT_ANSI_CRC, 32, CrcMode::TABLE> crc;
2020-01-08 13:36:17 +02:00
Kevin Bracey 83a9606140 CRC tests: increase parameter reflection coverage
CRC tests failed to exercise handling of the initial and final-xor
values with respect to reflection parameters. Add tests covering this.

Expected behaviour is that the initial value is always non-reflected and
the final-xor happens after the optional output reflection.
2020-01-08 13:36:17 +02:00
Kevin Bracey c46a2ad6ba MbedCRC HAL test: remove duplicates 2020-01-08 13:36:17 +02:00
Kevin Bracey 094f22901f MbedCRC: handle init values better
Init values often need reflection, and use of `__RBIT` prevents constant
init being done at compile time (unless `__RBIT` uses a compiler
intrinsic, which it doesn't for GCC).

Rather than try to handle constants 0U and -1U with a special case to
avoid the RBIT, which can in turn lead to runtime bloat for nonconstant
inits, use a C++20 style is_constant_evaluated() check to switch between
C and assembly forms.

This reduces code-size for non-constant init, by eliminating a runtime
condition, and allows the bit-reversal of any constant init to happen at
compile time.
2020-01-08 13:36:17 +02:00
Kevin Bracey 07d43b72d2 Add mstd::is_constant_evaluated
GCC 9 and sufficiently-new Clang (including ARM Compiler 6.13) give us
access to the C++20 (draft) `is_constant_evaluated` test. Allows us to
restrict code to compile-time only.

This is particularly useful when using assembler intrinsics, which the
compiler cannot optimise or compile-time evaluate. It allows us to write
something like

    constexpr uint32_t reverse_bits(uint32_t x)
    {
        if (is_constant_evaluated(x)) {
            // C code to do calculation here
            return x;
        } else {
            // an assembler intrinsic that cannot be optimised
            return __RBIT(x);
        }
    }

This can then be totally compile-time given a constant input.

(In this example, ultimately it would be a good idea to include this
functionality in CMSIS's GCC `__RBIT`, which needs it because GCC
requires use of assembler. Clang implements `__RBIT` as a built-in,
meaning it can already compute it at compile-time, so does not benefit.).
2020-01-08 13:36:17 +02:00
Kevin Bracey 04f929e85f MbedCRC.h: declare table specialisations
Clang emits warnings if it can see a declaration when it needs a
templated variable. Add declarations for the specialisations in
MbedCRC.cpp to MbedCRC.h keep it quiet.

Tighten up a little by making all `_crc_table` references conditional
on tables being configured on.
2020-01-08 13:36:17 +02:00
Martin Kojtal b77f6b457e
Merge pull request #12055 from 0xc0170/fix_12054
cmsis: remove arm math
2020-01-08 12:00:54 +01:00
Roman Volosatovs 21b0463653
Fix dl_channel tests 2020-01-08 11:54:05 +01:00
Kimmo Vaisanen 0d7cc428b1 Cellular: Move string_to_pdp_type method to CellularContext
string_to_pdp_type is only used in CellularContext classes and by having
the conversion method in CellularContext it can be used to check also
the non-standard Non-IP PDP type string.
2020-01-08 12:15:51 +02:00
Hugues Kamba 7819909148 NXP target: Replace UARTSerial references with BufferedSerial
`BufferedSerial` is `UARTSerial` renamed to convey the original purpose
of the class. It is the recommended buffered I/O serial class.
2020-01-08 09:01:19 +00:00
Hugues Kamba 03cff0a02c ST targets: Replace UARTSerial references with BufferedSerial
BufferedSerial is UARTSerial renamed to convey the original purpose of
the class. It is the recommended buffered I/O serial class.
2020-01-08 08:34:20 +00:00
Laurent Meunier 022c0eb7dc Increase MSI clock frequency when exiting deep sleep
This will optimize down the time it takes to restore the clock
settings when getting out of deep sleep.

If 48MHz is available let's use it, otherwise at least 4MHz should be
available for any MCU with MSI.
2020-01-07 17:59:33 +01:00
Rajkumar Kanagaraj de3c737581 uARM: Fix deprecate warning printing wrongly for other toolchains. 2020-01-07 08:02:31 -08:00