Commit Graph

33968 Commits (84959256b700fbb75f3b416b2dfda7f7353c76aa)

Author SHA1 Message Date
Jerome Coutant 84959256b7 STM32U5 : B_U585I_IOT02A introduction 2021-09-10 11:16:17 +02:00
Jerome Coutant 8114954054 STM32U5 : NUCLEO_U575ZI_Q introduction 2021-09-10 11:16:17 +02:00
Jerome Coutant 724c378c42 STM32U5 : STM32U5xxxxx sub-families 2021-09-10 11:16:16 +02:00
Jerome Coutant f45b1890aa STM32U5 specific driver files 2021-09-10 11:16:16 +02:00
Jerome Coutant e2ca71d1bf STM32U5: generic STM32 driver files update 2021-09-10 11:16:16 +02:00
Jerome Coutant 69c7cb4d59 STM32U5 CMSIS update 2021-09-10 11:16:16 +02:00
Jerome Coutant 3a1eb190d1 STM32U5 / GPIO HAL : GPIO_AF3_TIM1 is missing 2021-09-10 11:16:16 +02:00
Jerome Coutant 16a40c3ff1 STM32U5 ST_HAL_SPI workaround
Internal ticket 112451
2021-09-10 11:16:16 +02:00
Jerome Coutant 8bdd782a30 STM32U5 / CMSIS : USB_OTG patch 2021-09-10 11:16:16 +02:00
Jerome Coutant 59affad91c STM32U5: STM32Cube_FW_U5_V1.0.0 2021-09-10 11:16:08 +02:00
Jerome Coutant 234d5ff9ba ARM PACK MANAGER: add STM32U575ZI and STM32U585 2021-09-10 11:16:07 +02:00
Martin Kojtal 5a3f3f7330
Merge pull request #15051 from hallard/STM32_LPTIM_Prescaler
Allow to use all STM32 targets prescaler for LPTIM
2021-09-10 09:52:04 +01:00
Martin Kojtal 82036c85df
Merge pull request #15031 from jeromecoutant/PR_WIFI_TEST
connectivity-netsocket-tests-tests-network-wifi test suite configuration simplification
2021-09-09 13:14:56 +01:00
Jerome Coutant bce33b01ff connectivity-netsocket-tests-tests-network-wifi update2
- add minor print to make debug easier
- remove not useful part
2021-09-09 10:23:42 +02:00
Jerome Coutant 787605cec4 connectivity-netsocket-tests-tests-network-wifi update
Use default NSAPI configuration
2021-09-09 10:23:33 +02:00
Martin Kojtal f89655f2da
Merge pull request #15040 from mat-kalinowski/sendrecv_message
New feature: send/recv message implementation added to network stack
2021-09-09 08:35:19 +01:00
Martin Kojtal 3305dc1494
Merge pull request #15010 from world-direct/feature/reduceTLSspam
Reduce spam on trace because of calling read/write while handshaking
2021-09-09 08:34:27 +01:00
Martin Kojtal 9eed4272f5
Merge pull request #15029 from OpenNuvoton/nuvoton_m2354_tfm_import_mcu_partition
M2354: Fix incorrectly resolved peripheral base with security
2021-09-09 08:00:37 +01:00
Martin Kojtal 4f576481b3
Merge pull request #15060 from saheerb/master
set locale in mbed-os-env Docker image
2021-09-09 07:16:51 +01:00
Jaeden Amero 988d165f8f
Merge pull request #15059 from LDong-Arm/bd_greentea_fixes
Fix Thread::start() and general_block_device test's thread allocation/deallocation
2021-09-08 17:09:29 +01:00
mateusz.kalinowski ad0eb0eaa6 Moving alignment information in the nsapi_msghdr_t
Macro MBED_ALIGN expands in C to _Alignas which can't be used in the
type declaration. This patch moves it to the first type definition
which makes this code compile properly in CPP and C.
2021-09-08 15:26:41 +01:00
Martin Kojtal 3031898929
Merge pull request #15027 from OpenNuvoton/nuvoton_m2354_tfm_fw_version
M2354: Generate unique MCUboot image version
2021-09-08 14:47:54 +01:00
Martin Kojtal 3eae29b01d
Merge pull request #15028 from jeromecoutant/PR_SPI_V2
STM32 SPI: Update and improvement
2021-09-08 14:37:14 +01:00
Lingkai Dong 0b868d5a1a General block device test: Fix thread stack allocation
The test case for multithreaded erase/program/read allocates a few
Thread objects from the heap and starts them. It has a few problems:

* To check that there will be enough heap to start a new thread, the
test case tries to allocate a dummy buffer of the thread's heap size
and then frees it, before starting the thread. Then the thread will
allocate its own stack. Such check is not reliable, because threads
that are already running also perform additional allocation (when
running `test_thread_job()`) and may take away the memory we just
checked.
* When deleting all threads in a loop, the loop boundary misses the
last thread if the last thread object was allocated but not started
(i.e. due to failed thread stack allocation check).

To fix the issues
* Start a thread without any allocation test. Following the preceding
commit "rtos: Thread: Make stack allocation failure runtime catchable",
`Thread::start()` now returns `osErrorNoMemory` if stack allocation
fails which we can handle.
* Store pointers to all threads in a zero-initialized array, and
free all elements at the end of the test.
2021-09-08 14:18:21 +01:00
Lingkai Dong 48cf1c9c80 rtos: Thread: Make stack allocation failure runtime catchable
When a Thread object's stack memory is not provided, its `start()`
member function dynamically allocates its stack from the heap. If
allocation fails, there is no way to catch it because
* `std::nothrow` is missing after the `new` keyword. As Mbed OS
is built with `-fno-exceptions` (C++ exceptions disabled), failed
allocation results in an unrecoverable fault.
* The attempted `nullptr` check, which doesn't work anyway due to
the first point, is an assertion instead of error returning.
Assertions should be used as a development tool to ensure code
behaves correctly. But out-of-memory is a completely valid runtime
situation.

This commit adds the missing `std::nothrow`, and makes `Thread::start()`
return `osErrorNoMemory` if allocation fails so the caller can handle
it.

Note: A case when a thread should never fail due to lack of memory
is the main thread. But the main thread's stack is a pre-allocated
array in the static memory, passed to the `Thread()` constructor
during thread creation, so it's not impacted by this change.
2021-09-08 14:17:58 +01:00
Saheer 4341840f53 set locale in mbed-os-env docker image 2021-09-08 13:19:17 +01:00
mateusz.kalinowski f8db068f8c Removing FIXME comment and adding empty line in the test file 2021-09-07 14:55:50 +01:00
Jerome Coutant 066c07b234 STM32 SPI : Pull Down for output line 2021-09-07 14:32:47 +02:00
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
mateusz.kalinowski 575f489ab7 Fixing documentation errors
Minor errors in the documentation were fixed. These caused failure
of the doxygen checks in the PR.
2021-09-06 11:34:34 +01:00
mateusz.kalinowski c3d16f733f Adding documentation and minor code changes
Doxygen documentation for MsgHeaderIterator was added. Type used
for alignment of the nsapi_msghdr_t struct was changed.
2021-09-06 11:14:54 +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
Charles 81876a0f88 added disclaimers 2021-09-06 10:25:42 +02:00
Charles 1ad23b8d13 Allow more target prescaler for LPTIM 2021-09-03 22:33:40 +02: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
mateusz.kalinowski ec3f4379d9 Code improvements for the unresolved comments
This patch contains improvements mentioned in the unresolved PR
comments:
- function names were changed from socket_sendmsg/socket_recvmsg to
  socket_sendto_control/socket_recvfrom_control.
- default implementation of this functions was provided in the
  NetworkStack class.
- MsgHeaderIterator accesses elements on the aligned addresses.
2021-09-03 12:49:00 +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 dcd30e0cb0 M2354: Change MCUboot image versioning for unique version
Change MCUboot image versioning to meet requirements below:
1. Major.Minor.Revision must be non-decremental when used to derive security counter (-s 'auto').
2. Make Major.Minor.Revision+Build incremental to identify the firmware itself through psa_fwu_query().
3. Get around MCUboot failure with TF-M underestimated MAX_BOOT_RECORD_SZ
2021-09-02 09:18:25 +08: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
Chun-Chieh Li fc080f76fc M2354: Fix incorrect peripheral base with security
Import mcu partition header (renamed to partition_M2354_im.h) for resolving peripheral base with security.
Though Mbed is non-secure only and needn't secure peripheral base, some BSP driver code still rely on it.
2021-09-02 09:16:01 +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