Commit Graph

33968 Commits (84959256b700fbb75f3b416b2dfda7f7353c76aa)

Author SHA1 Message Date
Konstantin Kochin 179bba9189 Move common STM32 SPI operations to separate functions
- move a code that waits readable SPI state from `spi_master_write`
  function to inline functions `msp_writable` and `msp_wait_writable`
- move a code that waits writeable SPI state from `spi_master_write`
  function to inline functions `msp_readable` and `msp_wait_readable`
- move a code that writes data to SPI from `spi_master_write`
  function to inline function `msp_write_data`
- move a code that reads data from SPI from `spi_master_write`
  function to inline function `msp_read_data`
2021-09-01 21:12:48 +03:00
Lingkai Dong 8e412987b1 Revert "TESTS: Reduce allocate memory size"
This reverts commit 6649e95106.

In the malloc test, `ALLOC_ARRAY_SIZE` defines the *capacity* of array
that stores pointers to `malloc`'d buffers. It is *not* the number
of allocations.

In an ideal scenario, the test makes as many allocations as possible
until the heap runs out and malloc() returns NULL. So revert the
capacity of the array of pointers from 50 back to 100 so this array
is less likely to run out before the heap does.
2021-09-01 17:21:32 +01:00
Lingkai Dong 8d32b668ec Workaround for a bug in malloc() from newlib-nano 4.1.0
The commit 84d0689 "Nano-malloc: Fix for unwanted external heap
fragmentation" from newlib 4.1.0 introduced several optimizations,
one of which is as follows:

When the last chunk in the free list is smaller than requested,
nano_malloc() calls sbrk(0) to see if the heap's current head is
adjacent to this chunk, and if so it asks sbrk() to allocate the
difference in bytes only and expands the current chunk.

This doesn't work if the heap consists of non-contiguous regions.
sbrk(0) returns the the current region's head if the region has any
remaining capacity. But if this capacity is not enough for the second
(non-trivial) call to sbrk() described above, allocation will happen
from the next region if available. Expanding the current chunk won't
work and will result in a segmentation fault.

So this optimization needs to be reverted in order to bring back
compatibility with non-contiguous heaps. Before the next version
of newlib becomes available and gets updated in the GCC Arm Embedded
Toolchain, we work around this issue by including the fix in Mbed OS.
The linker prioritizes malloc() from the project to the one from the
toolchain.
2021-09-01 17:21:32 +01:00
Martin Kojtal 50c135292c
Merge pull request #15019 from ARMmbed/refactor_platform_greentea_cmake
Refactor platform greentea cmake
2021-09-01 15:24:49 +01:00
Martin Kojtal ff0e682d80
Merge pull request #15034 from world-direct/feature/stm32f1_rtcHSE
add RTC using HSE to target STM32F1
2021-09-01 15:24:38 +01:00
Martin Kojtal ae16be8faf
Merge pull request #15041 from LDong-Arm/target_name
CMake: Set TARGET_NAME macro
2021-09-01 15:24:26 +01:00
Martin Kojtal 79bc5ac43d
Merge pull request #15032 from LDong-Arm/response_file_escape
CMake: Fix escaping of quotes in response file
2021-09-01 15:23:09 +01:00
Lingkai Dong d4ee3bd845 CMake: Fix escaping of quotes in response file
We put macros in a response file compile_time_defs.txt and pass it
to the compiler. Adding a pair of single quotes around each -D flag
ensures macro values are quoted correctly.

For example,
* String
  * target_compile_definitions(): either FOO="BAR" or FOO=\"BAR\"
  * response file: '-DFOO="BAR"'
  * actual definition: #define FOO "BAR"
* Array of integers
  * target_compile_definitions(): FOO={1, 2, 3}
  * response file: '-DFOO={1, 2, 3}'
  * actual definition: #define FOO {1, 2, 3}
2021-09-01 13:49:22 +01:00
Lingkai Dong aca2d630ce CMake: Set TARGET_NAME macro
The C/C++ macro `TARGET_NAME` allows code to print the current
target's name, e.g. in error reporting when a fault happens. This
macro is exported by Mbed CLI 1 and used by mbed_error.c, so for
compatibility we let CMake set the same name of macro.

Fixes ARMmbed/mbed-tools#313
2021-09-01 13:47:57 +01:00
Lukas Karel e4f0281dd8 add RTC from HSE to target STM32F1 2021-09-01 14:42:04 +02:00
Martin Kojtal be31d50cc4
Merge pull request #15043 from jamesbeyond/click_fix
FIX: update click version to fix scancode
2021-09-01 13:13:23 +01:00
Qinghao Shi 1f20f1c179 FIX: update click version to fix scancode 2021-09-01 11:33:33 +01:00
Tymoteusz Bloch bdfd98e764 New feature: send/recv message implementation added to network stack 2021-09-01 09:13:57 +01:00
Martin Kojtal 539d1c784f
Merge pull request #15017 from hallard/STM32WL_HP_optimal
STM32WL fixed current consumption for mode RBI_CONF_RFO_HP
2021-08-30 14:17:01 +01:00
Martin Kojtal d2a88f4400
Merge pull request #15024 from OpenNuvoton/nuvoton_m2354_tfm_sdh
M2354: Enhance TF-M SDH stability
2021-08-26 10:22:48 +01:00
Martin Kojtal 43a060fe7c
Merge pull request #14926 from katherrafi/hal_callback_override
Eth: STM32: Overriding HAL callbacks in stm32xx
2021-08-26 09:51:48 +01:00
Martin Kojtal 1ac928e9d9
Merge pull request #15020 from OpenNuvoton/nvt_can_mask
Nuvoton: M480/M451 CAN API support mask feature
2021-08-26 09:43:50 +01:00
Chun-Chieh Li 259ee6b17a M2354: Enhance TF-M SDH stability
1.  Lower TF-M SDH clock to avoid premature timeout
2.  Re-initialize TF-M SDH on (timeout) failure
2021-08-26 11:02:13 +08:00
Kather Rafi Ibrahim a9f51e31fd Eth: STM32: Overriding HAL callbacks in stm32xx
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.

Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
2021-08-25 14:30:47 +05:30
Charles 6d0747727e added optimal settings for RFO_HP only
fixed wrong help values name

added detailled comments

fix style-check

fix style-check
2021-08-25 10:23:06 +02:00
cyliangtw f28181c32a M451 CAN API support mask feature 2021-08-24 19:14:27 +08:00
cyliangtw a33dc4e371 M480 CAN API support mask feature 2021-08-24 18:26:49 +08:00
Martin Kojtal f6e165febe
Merge pull request #15016 from 0xc0170/fix-iar-cmsis-update
Fix IAR cmsis update breakage
2021-08-24 10:14:37 +01:00
Martin Kojtal faf87374f9
Merge pull request #15018 from jeromecoutant/PR_FLASHTEST
hal-tests-tests-mbed_hal-flash compilation warning
2021-08-24 09:52:14 +01:00
Martin Kojtal 513f581bce
Merge pull request #15012 from felser/MTS_DRAGONFLY_L496VG
Add platform MTS_DRAGONFLY_L496VG
2021-08-24 09:50:58 +01:00
Rajkumar Kanagaraj b9439920c0 Update rtos CMake to include greentea test dir 2021-08-23 21:44:36 +01:00
Rajkumar Kanagaraj 5d31b71f81 CMake: greentea: Add skip reason to rtos test 2021-08-23 21:44:16 +01:00
Rajkumar Kanagaraj 174e01667f CMake: Refactor rtos greentea test CMake
Initially, every library greentea test has its project() creation in
their CMake. As running greentea using CTest move all greentea test
suite under one global project mbed-os and MBED_CONFIG_PATH set at
the root mbed os CMake under the condition BUILD_GREENTEA_TESTS
check so refactored rtos greentea CMake accordingly.
2021-08-23 21:43:39 +01:00
Rajkumar Kanagaraj 6cc3d6dd17 Update platform CMake to include greentea test dir 2021-08-23 21:41:17 +01:00
Rajkumar Kanagaraj 16c9058fd1 CMake: greentea: Add skip reason to platform test 2021-08-23 21:40:50 +01:00
Rajkumar Kanagaraj 40253b2a54 CMake: Refactor platform greentea test CMake
Initially, every library greentea test has its project() creation in
their CMake. As running greentea using CTest move all greentea test
suite under one global project mbed-os and MBED_CONFIG_PATH set at
the root mbed os CMake under the condition BUILD_GREENTEA_TESTS
check so refactored platform greentea CMake accordingly.
2021-08-23 21:39:19 +01:00
Jerome Coutant 8d16ab32fe hal-tests-tests-mbed_hal-flash compilation warning 2021-08-20 17:05:59 +02:00
Martin Kojtal 19f2138ef3 cmsis importer: add IAR fix for .S files 2021-08-20 13:23:06 +01:00
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
Leon 4b27aef0ae Add platform MTS_DRAGONFLY_L496VG 2021-08-18 12:03:48 -05: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
Lukas Karel 886b2e5000 prevent spam of console 2021-08-17 16:16:58 +02: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
Jaeden Amero 432cf2869c docker: Upgrade GCC to 10.3-2021.07
Upgrade to the current latest version of GNU Arm Embedded,
gcc-arm-none-eabi-10.3-2021.07. This brings along fixes to v8-M targets
and better Cortex-M55 support.
2021-08-16 16:47:27 +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