Commit Graph

181 Commits (10beeab6c27615e0d3945c337cb4aa21f9fcb3f3)

Author SHA1 Message Date
Tymoteusz Bloch bdb0a22dec Fcntl setting Non Blocking operations improvement 2021-06-09 15:36:24 +02:00
Werner Lewis 046fa78319 Update GCC except.S to support ARMC6
ARM Compiler 6 supports GNU-style assembly with armclang. Instead of
relying on armasm with the legacy syntax, GCC except.S is updated so
that it can be used with ARM as well as GCC_ARM toolchains. CMake is
updated to use this version.
2021-05-24 13:54:57 +01:00
Martin Kojtal 3003a171b2 fixup! error: use __INITIAL_SP from cmsis instead of RTX one 2021-05-10 16:09:18 +01:00
Martin Kojtal f6176432d2 error: use __INITIAL_SP from cmsis instead of RTX one
We used to require INITIAL_SP as rtx target headers define it. This should not be required, as
cmsis already defines symbol  __INITIAL_SP for all toolchains.

Fixes #14432
2021-05-05 13:15:10 +01:00
George Psimenos d239ef98cd Rename USBTX/RX to CONSOLE_TX/RX 2021-03-18 17:01:54 +00:00
jeromecoutant a4350f72bd [STD-PIN] BUTTON and LED define
hal/tests/TESTS/mbed_hal/gpio/main.cpp is replaced by
hal/tests/TESTS/pin_names/generic/main.cpp now
2021-03-18 17:01:50 +00:00
jeromecoutant a6c213bb10 [STD-PIN] Replace STDIO_UART_TX by USBTX 2021-03-18 17:01:50 +00:00
Lingkai Dong 4450464fc8 Add integer overflow check to the malloc wrappers
Add a check that the combined size of the buffer to allocate and
alloc_info_t does not exceed the maximum integer value representable
by size_t.
2021-03-10 09:47:15 +00:00
Martin Kojtal 85c2d7a25c CMake: remove IAR references as they are not supported 2021-02-17 09:19:03 +00:00
Martin Kojtal 09dd4d2582 CMake platform: remove IAR related CMakeLists
Not supported
2021-02-17 09:15:50 +00:00
caodd 9a7b2a8647 Fix minimal-printf floating point decimal output error 2021-01-20 20:54:34 +08:00
Martin Kojtal c06fcaf5c5
Merge pull request #13548 from evva-sfw/enhance-minimal-printf
Add width modifier and prepending zeros for hexadecimal output and decimal precision for floating point
2020-12-10 09:14:59 +00:00
Oliver Wildtgrube 03cf6214c3 Add width modifier and prepending zeros for integer, hexadecimal and floating point output as well as decimal precision for floating point 2020-12-08 21:07:54 +01:00
Martin Kojtal 124afe79bb
Merge pull request #13755 from AGlass0fMilk/fix-init-os-timer
Fix MBED_ERROR call in init_os_timer
2020-11-24 13:38:46 +00:00
Martin Kojtal 57bbb4739b
Merge pull request #13085 from pea-pod/remove-deprecated-mbed-assert
Change MBED_STATIC_ASSERTs version for built-in
2020-11-24 13:38:07 +00:00
George Beckstein 7571982606 Fix MBED_ERROR call in init_os_timer 2020-11-19 12:35:34 -05:00
Martin Kojtal 3555ada459
Merge pull request #13867 from marcemmers/fix-systimer-overflow
SysTimer: Prevent unacknowledged tick overflow when halted for a while
2020-11-11 08:55:24 +00:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Rajkumar Kanagaraj e7c0d93ad4 CMake: add mbed-os and mbed-baremetal targets
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core

The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.

This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
2020-11-06 17:25:22 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Hugues Kamba 1b576c3046 CMake: Clean up platform 2020-11-06 17:25:20 +00:00
Hugues Kamba a0fbe2947a CMake: Fix build failure due to CMSIS restructure 2020-11-06 17:25:20 +00:00
Hugues Kamba 929adbe936 CMake: Add support for platform dir 2020-11-06 17:25:15 +00:00
Marc Emmers 8b7e7ee8f6 Make _unacknowledged_ticks uint32_t to prevent overflow 2020-11-05 15:26:44 +01:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
Kevin Bracey 5ab6f1cef6 Make readdir reentrant
Remove the static allocation for the dirent, and allocate it from the
heap during opendir().

Removing the static data can reduce RAM usage on some toolchains when
directories are not being used. The static allocation sometimes is
combined with the file handle array and can't be dropped by the linker.

Original readdir() was not thread-safe at all.

This was in violation of POSIX which states the result of readdir "is
not overwritten by another call to readdir() on a different directory
stream."

POSIX also defines readdir_r() as separate totally reentrant form where
the caller allocates the dirent, but this is generally deprecated as it
opens the door for an inadequate allocation causing a stack smash. Full
reentrancy is not typically necessary - having readdir()'s buffer data
be per-DIR is generally sufficient.
2020-09-04 16:58:23 +03:00
Martin Kojtal 4a68b8af89
Merge pull request #13486 from rajkan01/fix_malloc_overhead_calculation
Fix heap stats overhead_size calculation
2020-09-03 11:38:41 +01:00
Hugues Kamba 834e530abd CMSIS: Restructure ported CMSIS_5
See docs/adr/0001_cmsis_component_source_structure_recommendations.md
For details information.
2020-09-01 15:55:13 +01:00
Rajkumar Kanagaraj f3c9132637 Incorporated the review comments 2020-09-01 14:46:36 +01:00
Rajkumar Kanagaraj d30ba6ba62 Fix malloc internal overhead size calculation for newlib and newlib-nano 2020-08-24 15:07:36 +01:00
Martin Kojtal 2c18e93979
Update platform/source/mbed_os_timer.cpp
fix the typo

Co-authored-by: Lingkai Dong <lingkai.dong@arm.com>
2020-08-21 14:55:58 +01:00
Martin Kojtal a6ce2c53a0 platform: move internal headers to internal/
They belong to internal folder to follow our guideline, not in source as they were.
2020-08-20 08:58:00 +01:00
Martin Kojtal 8078e20cb4 platform: remove platform/ prefix for source
If we take platform as a component, platform/source would be outside of this component.
I removed the prefix as these are implementation specific (they are located in source folder,
not in include as the others).
2020-08-18 15:55:39 +01:00
Matthew Macovsky b7c0e89eb9 Fix IAR assembler errors on except.S
Fixes two errors produced on except.S by the IAR assembler (as seen in
issue #13200).

The first: "'ALIGN' is illegal. Use directive ALIGNROM or ALIGNRAM (the
first parameter is raised to the power of 2, the second is a 32-bit fill
value)."
Fixed by changing ALIGN to ALIGNROM 2 to align to a 4-byte boundary
(mirroring what ALIGN does in the ARM except.S).

The second (on THUMB): "Must be placed inside a section"
Fixed by moving THUMB after the SECTION directive so that it affects
that section.
2020-07-29 08:25:41 -07:00
Martin Kojtal 3e42991289
Merge pull request #13046 from hugueskamba/hk_use_chrono
Use std::chrono based functions
2020-06-18 22:16:00 +02:00
Devaraj Ranganna 76e911c5ef psa: Replace Mbed PSA with TF-M
Add TF-M to Mbed OS, replacing the previous PSA implementation for
TF-M-capable targets. This commit adds files imported from TF-M, without
modification. The version of TF-M imported can be found in
`features/FEATURE_PSA/TARGET_TFM/VERSION.txt`.

These changes switch to TF-M as the sole PSA implementation for v8-M and
dual core targets, with TF-M running on the secure side and Mbed OS
running on the non-secure side. Single core v7-M targets will continue
to have PSA implemented via PSA emulation, implemented by Mbed OS.

Move or remove many PSA-implementing files, as PSA will be provided by
TF-M on non-single-v7-M targets. Delete any files that are not relevant
for PSA emulation mode.
 - Remove imported TF-M SPM
 - Remove Mbed SPM and tests
 - Remove Mbed-implemented PSA services and tests
 - Remove PSA_SRV_IMPL, PSA_SRV_IPC, PSA_SRV_EMUL and NSPE.
 - Replace PSA_SRV_EMUL and PSA_SRV_IMPL with MBED_PSA_SRV
 - Remove any files autogenerated by
   "tools/psa/generate_partition_code.py", which no longer exists.

Add new feature `PSA` to support PSA in Mbed OS.

Move the Mbed OS implementation of PSA services for v7-M targets (which
employ PSA emulation, and don't yet use TF-M) to
features/FEATURE_PSA/TARGET_MBED_PSA_SRV. Update the `requires`
attribute in TESTS/configs/baremetal.json to avoid breaking baremetal
testing builds.

Update .astyleignore to match new directory structure

Update Mbed TLS importer to place files into FEATURE_PSA

Create the following generic PSA targets:

* `PSA_Target` (Root level PSA generic target)
* `PSA_V7_M` (Single v7-M PSA generic target)
* `PSA_DUAL_CORE` (Dual-core PSA generic target)
* `PSA_V8_M` (v8-M PSA generic target)

Flatten MUSCA_NS and private MUSCA targets into public MUSCA targets.

Move mcuboot.bin to flat location (removing prebuilt folder)

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-06-18 12:16:20 +01:00
Martin Kojtal 62c2431344
Merge pull request #12824 from kjbracey-arm/faultasm
Optimise fault handler assembly
2020-06-18 09:43:00 +02:00
Hugues Kamba a3f4cf212d Use std::chrono based functions
The chrono based functions improve readability. Using them also removes
warnings related to usage of deprecated warnings.
2020-06-17 14:52:50 +01:00
jeromecoutant a7c9601d08 OS timer uses LPTICKER by default, then USTICKER
This PR makes the bare-metal mode work automatically
regardless of the tickless-from-us-ticker setting
- in non RTOS mode
- and in RTOS tickless mode
2020-05-19 12:34:11 +02:00
Marcelo Salazar ccd95f1e14 Remove nRF51 targets
The following public nRF51 targets are being removed:

- NRF51822
- NRF51_DK
- NRF51_MICROBIT
2020-05-13 10:36:50 +01:00
Kevin Bracey 3f67eed31c Correct core RTOS sleep routine timing
Chrono conversions inadvertantly changed the core timed sleep routine
used by the RTOS idle to use `OsTimer::update_and_get_tick()` instead of
`OsTimer::get_tick()`.

Correct this, and expand/clarify documentation and naming to try to
prevent recurrence.

Another minor fix observed while inspecting code - `OsClock` can't just
use `milliseconds`, it should match the period of `OsTimer`, which
theoretically can be different.
2020-05-07 11:43:01 +03:00
Martin Kojtal d1ae0d570c
Merge pull request #12425 from kjbracey-arm/chrono
C++ Chrono support
2020-04-30 11:41:43 +02:00
Jaeden Amero fcf427ac11 psa: Remove S-mode only code
Remove all PSA S-mode only code, as it is unused. Only PSA S targets
would use the code, and we've removed those targets in a previous
commit.

Ensure all tests for S-mode code we are deleting is also removed, even
if that code would run in NS-mode. Keep any tests that also test our PSA
emulation support (for single v7-M targets).

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-27 09:51:13 +01:00
Kevin Bracey 8e3e19837a More Chrono test fixes
* Timer test - handle removal of Timer(ticker_data_t *)
* Timer test - use Chrono, don't test deprecated methods
* Kernel tick count test - TEST_ASSERT_WITHIN -> TEST_ASSERT_INT_WITHIN
* Mutex test - fix up Chrono changes
* SysTimer test - adapt to SysTimer Chrono changes
* Thread test - use Chrono
* SysTimer - devirtualize destructor
2020-04-27 10:19:08 +03:00
Kevin Bracey f4e0ea2c75 Add Chrono support to Kernel and SysTimer 2020-04-27 10:19:08 +03:00
Kevin Bracey b6a7a0896e Streamline crash data access
Use correctly-typed external definition for the crash data region, and
eliminate unnecessary pointer indirection.

Results in a small ROM saving even with crash capture disabled, as there
was a pointer for the fault context store in either case. The pointer
isn't needed, as the context store location is fixed according to the
configuration flag.
2020-04-24 10:59:13 +03:00
Kevin Bracey 03ce9190f9 Optimise fault handler assembly
Fault handler assembly was very simplistic. Optimise for a 112 byte saving.
2020-04-23 11:28:35 +03:00
Kevin Bracey c1641e79c5 Reformat except.S
Tidy up formatting, and make all 3 toolchain versions more consistent,
for ease of diffing and transferring changes between them.
2020-04-23 11:28:35 +03:00
Martin Kojtal d4da29840f
Merge pull request #12758 from hugueskamba/hk_fix_microlib_minimal_console
Fix: Return the correct std I/O device handle for Microlib in retarget code
2020-04-15 09:24:17 +02:00