Commit Graph

33882 Commits (77f8a30749defdf3094d9731372cd6f095250566)

Author SHA1 Message Date
Martin Kojtal 77f8a30749 cmsis: fix iar asm build error with including header
mbed-cli1 does not pass -I to IAR for iarasm (comparing to other toolchains). Because old tools are frozen,
we implement this workaround for fixing the build.

We use preprocessor macros that are passed to .S files anyway, so we do not loose anything but we do diverge again from CMSIS, for now..
2021-08-20 13:22:56 +01:00
mbedmain 3377f083b3 Update Mbed version block 2021-08-18 12:44:48 +01:00
Martin Kojtal 5d82bd5b85
Merge pull request #14956 from jeromecoutant/PR_SCRIPT_UPDATE
STM32_gen_PeripheralPins script update
2021-08-17 20:29:54 +01:00
Martin Kojtal 09eee5881e
Merge pull request #14988 from npal-cy/pr/swintegration-501
CYW43XXX Cordio HCI driver: update BT power up sequences to remove redundant delay (500ms) during HCIDrive initialization
2021-08-17 12:20:17 +01:00
Jaeden Amero 47630e5268
Merge pull request #15008 from jamesbeyond/malloc_fix
TESTS: Reduce allocate memory size
2021-08-17 11:55:05 +01:00
Martin Kojtal 4e0e21f897
Merge pull request #15000 from SamuA-AP/fix-can-api-filters
Fix Extended Message Filter count in STM CAN API
2021-08-17 11:14:31 +01:00
Martin Kojtal cf37de4038
Merge pull request #15006 from mikaleppanen/irq_disable_eth_init
Disabled interrupts on smt32f7 and stm32h7 before calling disable data cache
2021-08-17 11:07:19 +01:00
Martin Kojtal 2ceb3bfd6a
Merge pull request #14935 from jeromecoutant/PR_IAR
mbed_retarget: enable IAR build
2021-08-17 10:25:03 +01:00
Martin Kojtal acbf352d13
Merge pull request #14993 from hazzlim/unit_test_support
Add boilerplate unit test code to currently untested modules
2021-08-17 10:20:51 +01:00
Martin Kojtal 4d8b8bad3f
Merge pull request #15002 from ladislas/ladislas/bugfix/interface-digitalin-missing-include
Add missing include for PinNames.h
2021-08-17 10:14:45 +01:00
Qinghao Shi 6649e95106 TESTS: Reduce allocate memory size 2021-08-17 09:59:00 +01:00
Mika Leppänen 096ce41094 Disabled interrupts on smt32f7 and stm32h7 before calling disable data cache
Interrupts are disabled before calling disable data cache on Ethernet initialization.
2021-08-16 13:29:25 +03:00
Hari Limaye c6312a3c70 Unit tests: Add boilerplate code for AnalogIn.cpp
In pursuit of increasing unit test coverage of Mbed OS, we add the
boilerplate code for unit testing of AnalogIn.cpp and an empty test
source file. This serves two purposes - it allows us to report on
currently untested sources in code coverage data, and it makes it a
little easier for developers to write unit tests for these sources.

The 'empty' test file contains a main function that simply returns. This
is required to allow CMake's add_executable() to be used to pull in the
source file for the SUT, which ensures that this source file is built
and therefore instrumented to generate coverage data. The alternative
that was explored was to instead use Google Test's TEST() macro and
prefix the test name with 'DISABLED_' to skip it, but that resulted in
the test being reported as skipped, which was deemed undesireable for
these 'empty' tests.
2021-08-16 10:13:11 +01:00
Hari Limaye 9491403f43 Unit tests: Add stubs for analogin_api.c functions
Currently there are no stub implementations of the analogin_api.c
functions. As the AnalogIn class makes use of these functions, these
stub definitions are required in order to build AnalogIn.cpp and
generate .gcno files to be used to generate code coverage metrics.
2021-08-16 10:13:11 +01:00
Hari Limaye 6440546b74 Style: Remove drivers unit test directory from codeignore
Unit tests for drivers are currently not checked for style compliance.
We should be checking coding style in unit tests, so we remove them from
the .codecheckignore file.
2021-08-16 10:13:11 +01:00
Martin Kojtal ca5126e2e4
Merge pull request #15003 from dustin-crossman/pr/add_missing_bt_support
Add bluetooth support files to Cypress BSPs.
2021-08-16 09:32:30 +01:00
Jerome Coutant 79d403a0db STM32_gen_PeripheralPins script update
- add CMakeLists.txt
- patch for STM32U5 boards
2021-08-16 10:28:21 +02:00
Ladislas de Toldi e1de484471
Add missing include for PinNames.h 2021-08-13 18:07:13 +02:00
nazar.palamar b245445ecb Addressed code review comments: 1. remove bt_power member from HCIDriver class; 2. set PullUp for bt_power in CyH4TransportDriver; 3. cleanup code: replace tabs to 4 spaces 2021-08-13 17:25:14 +03:00
nazar.palamar c2f7a9539b Update of BT power up sequences to remove redundant delay (500ms) in BT_POWER operation during HCIDrive initialization.
Current BT_POWER sequence:
1. BT_POWER=0  ( from CyH4TransportDriver::initialize)
2. delay 1ms   ( from CyH4TransportDriver::initialize)
3. BT_POWER=1  ( from CyH4TransportDriver::initialize)
4. delay 500ms (from HCIDriver::do_initialize)
5. BT_POWER=1  (from HCIDriver::do_initialize)
6. delay 500ms (from HCIDriver::do_initialize)

updates:
1. remove 4) and 5)
2. keep all BT_POWER operations in one place. The best logic place is CyH4TransportDriver::initialize.

So finally the BT_POWER sequences should looks like:
1. BT_POWER=0  ( from CyH4TransportDriver::initialize)
2. delay 1ms   ( from CyH4TransportDriver::initialize)
3. BT_POWER=1  ( from CyH4TransportDriver::initialize)
4. delay 500ms ( from CyH4TransportDriver::initialize)
2021-08-13 17:25:12 +03:00
Martin Kojtal df00ed4efe
Merge pull request #14982 from npal-cy/pr/swintegration-481
CYW43XXX Cordio HCI driver: fixed MCU deep-sleep locking flow
2021-08-13 13:08:36 +01:00
Martin Kojtal 9bcc48678a
Merge pull request #14976 from world-direct/feature/target_stm32f1
Add more uarts for STM32F103xG
2021-08-13 13:08:02 +01:00
Samu Ampio cbc0ee60b0
Fix Extended Message Filter count in STM CAN API
As per STM32H7-series reference manuals:
"Up to 64 filter elements can be configured for 29-bit extended IDs."
This commit fixes a bug which prevented receiving CAN-messages
with extended IDs.
2021-08-13 12:43:36 +03:00
Dustin Crossman 1aa67dd235 Add bluetooth support files to Cypress BSPs. 2021-08-12 10:06:40 -07:00
Martin Kojtal 4dd08c40f5
Merge pull request #14990 from ikmdani/stm32l1_usb_enable_pullups
Driver: USB: STM32L1: Managing internal pullups for usb enumeration
2021-08-12 15:54:40 +01:00
Martin Kojtal 881b7ebed3
Merge pull request #14997 from Patater/update-pywin32
python: Upgrade pywin32
2021-08-12 15:42:56 +01:00
Jaeden Amero 3904e7c299 python: Upgrade pywin32
Remove pinned pywin32 version. Require an upgrade of pywin32 to a
version that includes security and bug fixes we'd like (CVE-2021-32559).
2021-08-12 10:02:15 +01:00
Martin Kojtal 68667df7ac
Merge pull request #14995 from saheerb/master
travis ci migration to github action
2021-08-12 09:50:13 +01:00
Jaeden Amero e588f80d13
Merge pull request #14902 from LDong-Arm/greentea_skip
CMake: tests: Support skipping unsupported test with reason
2021-08-11 14:44:07 +01:00
Jaeden Amero 4125fd0786
Merge pull request #14972 from OpenNuvoton/nuvoton_m2354_tfm_psa_fwu
M2354: Support PSA Firmware Update
2021-08-11 13:57:57 +01:00
Lingkai Dong 6776069a18 CMake: greentea: Port PSA Attestation test to CTest
The PSA Attestation test suite requires full RTOS. There is no need
to explicitly check PSA support, because when we build all greentea
tests from the top of Mbed OS, PSA tests only get included if PSA is
enabled.
2021-08-11 11:43:17 +01:00
Lingkai Dong d7ef8f857f CMake: greentea: Add skip reason to ticker test 2021-08-11 11:43:17 +01:00
Lingkai Dong 4917e0154c CMake: tests: Support skipping a test with a reason
Add a new argument `TEST_SKIPPED` to `mbed_greentea_add_test()` to
indicate a test is skipped and give a reason (e.g. the Mbed target
and/or configuration does not provide what the test requires).

The skip reason of a test is printed when running tests with `ctest`,
and the test is marked as "Skipped" in the test report.
2021-08-11 11:43:14 +01:00
Lingkai Dong 86c00f6b4b cmake: Improve indentation of mbed_greentea_add_test doc 2021-08-11 11:42:24 +01:00
Lingkai Dong e60ffed6f4 CMake: turn mbed_greentea_add_test() into a function
Unlike a macro, a function is more self-contained and can return
early if necessary.
2021-08-11 11:40:10 +01:00
Jaeden Amero 159f8325c5
Merge pull request #14892 from rwalton-arm/greentea_ctest
Add CTest support for `mbed-drivers-ticker` greentea test
2021-08-11 11:38:29 +01:00
Saheer 91fa6801f8 travis ci migration to github action 2021-08-11 11:02:06 +01:00
Robert Walton 1a7a89a8ed ci: Use new mbed-os-env docker image in "multiple executables" test
The github workflow to test building multiple executables was using the
soon to be deprecated docker image "mbedos/mbed-os-env:latest". This
commit points it at the new docker image on ghcr.io.
2021-08-11 10:15:42 +01:00
Robert Walton a437ed4047 targets: Add "bare-metal" to supported_application_profiles
We weren't setting the "supported_application_profiles" correctly for
some baremetal supported targets. This didn't cause build failures with
mbed-cli 1 as it just seems to ignore this config parameter. In our CMake
build system we have added a hard dependency on the
supported_application_profiles; we fail the build if the profile we're
trying to build isn't in the list.
2021-08-11 10:15:42 +01:00
Robert Walton cfc68a0918 CMake: Use CMAKE_MODULE_PATH to locate nuvoton post build hook
We were previously relying on the global MBED_PATH variable to provide
the root for the include path to the post build hooks. We can't
guarantee that MBED_PATH will be set by any application building us, so
use CMAKE_MODULE_PATH (which we always set) like we do for the other
post-build hooks.
2021-08-11 10:15:42 +01:00
Robert Walton 1dda219d3c ci: Add github action to build greentea tests with cmake
Build for two targets, one with baremetal profile and one full profile.
2021-08-11 10:15:42 +01:00
Robert Walton 00dbf4c71d CMake: greentea: Use more specific name for baremetal option
Make it obvious the option is used for greentea tests.
2021-08-10 16:54:27 +01:00
Robert Walton 40154ee2b1 CMake: greentea: Port mbed-drivers-ticker to CTest
Call add_test in mbed_greentea_add_test and specify mbedhtrun as the
command to run.

An MBED_HTRUN_ARGUMENTS variable has been added, which is a semicolon
separated list of arguments to forward to htrun. The user is required to
pass in any arguments mbedhtrun needs to communicate with the device
under test at CMake configuration time.

We automate passing some of the htrun arguments in CMake using data
provided by mbed_config.cmake or gathered from the CMake environment.
The following arguments are passed to htrun from CMake:

* -f/--image-path
* -e/--enum-host-tests
* -m/--micro
* -R/--reset-timeout

--baud-rate is also passed if the MBED_CONF_PLATFORM_STDIO_BAUD_RATE
config parameter is defined.

Temporary checks have been added to mbed_greentea_add_test to keep the
old flow working until we port all of the greentea tests to CTest. These
checks should be removed after we make all greentea tests runnable by
CTest.
2021-08-10 16:54:03 +01:00
Robert Walton 2a12566c70 CMake: greentea: Set variables usually defined by external apps
We rely on external applications to set MBED_CONFIG_PATH and include
app.cmake. Mbed OS can't build for a target without those parameters
set. When building greentea tests there is no external application. So,
we define the appropriate settings in our root CMakeLists.txt for
greentea tests.
2021-08-10 16:37:48 +01:00
Robert Walton 7842320ab7 CMake: Add option to enable greentea tests
Add an option to enable the greentea tests independently from the unit
tests.

We can't just use the typical BUILD_TESTING option to enable greentea
tests. BUILD_TESTING enables unit tests and fetches googletest, which
are compiled for the host. Greentea tests are cross compiled and require
a toolchain file. For this reason we add a new option just to enable
greentea tests, preventing build failures triggered by the unit tests
and googletest.
2021-08-10 16:35:11 +01:00
Krishna Mohan Dani 3e83108f1c Driver: USB: STM32L1: Managing internal pullups for usb enumeration
This commit adds internal pullup on DP line for usb enumeration
in nucleo_l152re platform. This platform as such does not have
usb connector (device).

This has been tested with example in https://github.com/ARMmbed/
mbed-os/blob/master/drivers/usb/include/usb/USBMouse.h#L58-L76

and mbed_app.json file

"target_overrides": {
        "*": {
            "platform.stdio-baud-rate": 115200,
            "platform.all-stats-enabled": true,
            "mbed-trace.enable": "0"
        },
        "NUCLEO_L152RE": {
            "target.device_has_add": ["USBDEVICE"]
        }
    }
}

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-08-10 17:49:36 +05:30
Jaeden Amero d4b15348a9
Merge pull request #14983 from LDong-Arm/sfdp_sector_map
SFDP: Add unit tests for Sector Map Parameter Table parsing
2021-08-06 16:54:04 +01:00
Lingkai Dong a16c2bf173 SFDP: Add unit tests for Sector Map Parameter Table parsing
Add tests for `sfdp_parse_sector_map_table()` which currently (at the
time of this commit) supports flash devices with
* no Sector Map Parameter Table (i.e. the whole flash is uniform and
non-configurable)
* a single descriptor in the Sector Map Parameter Table (i.e. the
flash layout is non-configurable and has multiple regions)

Support and unit tests for flashes with multiple configurable layouts
will be added in the future.

Note: The implementation of `sfdp_parse_sector_map_table()` assumes
the table to be valid if read succeeds, so the SFDP reader callback
needs to ensure it reads data correctly or return an error.
2021-08-06 15:27:28 +01:00
nazar.palamar 1d6843e538 Fixed MCU deep-sleep locking flow in CYW43XXX Cordio HCI driver. The CYW43XXX Cordio HCI driver incorrect handles lock/unlock deep-sleep entry, as results it allows to put PSoC6 in to deep-sleep when CYW43xx does not expect this (the host_wake_up pin in ACTIVE_LOW state, which means hat host must be in ACTIVE mode ).
Now, CYW43XXX Cordio HCI driver has the following MCU deep-sleep locking scenarios/flows:
a) A BT device or MCU does not support Low Power mode (MBED configuration does not include MBED_TICKLESS, DEVICE_SLEEP, DEVICE_LPTICKER or CYCFG_BT_LP_ENABLED features). In this case, CyH4TransportDriver locks deep-sleep in the initialize() function and unlocks the terminate() function.

b) A BT device and MCU support Low Power mode. In this case, the control of the unlock/lock of the deep-sleep functionality will be done in bt_host_wake_rise_irq_handler and bt_host_wake_fall_irq_handler handlers. Finally, CyH4TransportDriver unlocks the deep-sleep in terminate() function (if it was locked before) by checking the bt_host_wake_active flag.

Fixes #13076, #13700, #13295.
2021-08-06 16:41:24 +03:00
Lingkai Dong f08c3cdfb5 SFDP: TestEraseTypeAlgorithm: Move setup into test case
The test data `struct mbed::sfdp_smptbl_info smptbl` is only relevant
to `TestEraseTypeAlgorithm` and not shared with other test cases.
2021-08-06 14:30:16 +01:00