Commit Graph

33931 Commits (8bd27caf896a81afe7eb40c94d96211892b8fa02)

Author SHA1 Message Date
Jerome Coutant 8bd27caf89 STM32 SPI : Add SPI reset in init 2021-09-07 14:32:47 +02:00
Jerome Coutant d3b03dec0c STM32 SPI : STM32H7 IP is SPI_IP_VERSION_V2 2021-09-07 14:32:39 +02:00
Martin Kojtal d1f02f3078
Merge pull request #15007 from Patater/upgrade-toolchains
docker: Upgrade GCC to 10.3-2021.07
2021-09-07 08:41:50 +01:00
Martin Kojtal 63583b00d8
Merge pull request #15052 from saheerb/master
Fix mbed-os-env docker digest retrieval
2021-09-06 13:40:17 +01:00
Saheer fc088f0edd Tag docker images generated by master branch as latest. 2021-09-06 10:59:08 +01:00
Saheer 64cff51d4f Fix mbed-os-env docker digest retrieval
Adapt changes in skopeo command line to inspect docker image.
Use tagged skopeo docker image to avoid breakage in future.
2021-09-06 10:57:44 +01:00
Martin Kojtal c14396a5b6
Merge pull request #15045 from LDong-Arm/malloc_newlib_nano
Workaround for a bug in malloc() from newlib-nano 4.1.0 (in GCC 10.3)
2021-09-03 15:03:31 +01:00
Martin Kojtal fbdf2ffb8d
Merge pull request #14951 from ARMmbed/refactor_rtos_greentea_cmake
CMake: Refactor rtos greentea cmake
2021-09-02 15:42:02 +01:00
Martin Kojtal 887bcf7f93
Merge pull request #15030 from OpenNuvoton/nuvoton_m2354_tfm_missing_lcdcp
M2354: Fix LCDCP missing in TF-M CLK pass list
2021-09-02 12:59:57 +01:00
Martin Kojtal d87183a52b
Merge pull request #14981 from vznncv/fix-stm32-spi-3wire
Fix STM32 SPI 3-wire (synchronous API)
2021-09-02 12:59:24 +01:00
Rajkumar Kanagaraj 9a144308ec Incorporate the review comments 2021-09-02 12:49:33 +01:00
Chun-Chieh Li 6447b3d8f3 M2354: Fix LCDCP missing in TF-M CLK pass list
Besides LCD_MODULE, add LCDCP_MODULE into TF-M pass list for below CLK driver in NSPE:

-   CLK_SetModuleClock_S
-   CLK_EnableModuleClock_S
-   CLK_DisableModuleClock_S
-   CLK_GetModuleClockSource_S
2021-09-02 09:17:18 +08:00
Konstantin Kochin 7bc773badd Improve STM32 SPI asynchronous API stability
`HAL_SPI_Receive_IT` HAL function causes dummy reads in 3-wire mode,
that causes data corruption in RX FIFO/register. It isn't possible
to fix it without signification refactoring, but we may prevent data
corruption with the following fixes:

- RX buffer/register cleanup after asynchronous transfer in 3-wire mode
- Explicit RX buffer/register cleanup after SPI initialization
  (for cases if we re-create SPI object).
2021-09-01 21:12:48 +03:00
Konstantin Kochin c60f0cc11e Fix STM32 spi_abort_asynch function
- add RX cleanup after SPI re-initialization,
  as it isn't implemented in the `HAL_SPI_Init`
- cancel SPI enabling for 3-wire mode
2021-09-01 21:12:48 +03:00
Konstantin Kochin f1c4a7fe52 Fix STM32 SPI 3-wire (synchronous API)
All STM32 families except STM32H7 has the following 3-wire SPI peculiarity in master receive mode:
SPI continuously generates clock signal till it's disabled by a software. It causes that a software
must disable SPI in time. Otherwise, "dummy" reads will be generated.

Current STM32 synchronous SPI 3-wire implementation relies on HAL library functions HAL_SPI_Receive/HAL_SPI_Transmit.
It performs some SPI state checks to detect errors, but unfortunately it isn't fast enough to disable SPI in time.
Additionally, a multithreading environment or interrupt events may cause extra delays.

This commit contains the custom transmit/receive function for SPI 3-wire mode. It uses critical sections to
prevents accidental interrupt event delays, disables SPI after each frame receiving and disables SPI during
frame generation. It adds some delay between SPI frames (~700 ns), but gives reliable 3-wire SPI communications.
2021-09-01 21:12:48 +03:00
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
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