Commit Graph

1077 Commits (dbbdb3f5bd2aec2aa03c0feace46e3c0d9400b61)

Author SHA1 Message Date
Martin Kojtal cb131c39b3
Merge pull request #12629 from evedon/ed-rtos-api
Add "rtos-api" to bare metal
2020-03-26 18:21:05 +01:00
phst 75f8c70935 Fix Astyle error 3 2020-03-25 16:20:43 +01:00
phst 406e7a2f4f Fix Astyle error 2 2020-03-25 16:05:55 +01:00
phst 413b6d62f4 Fix Astyle error 2020-03-25 15:37:13 +01:00
phst ac20dfc745 Fix Astyle error 2020-03-25 14:20:21 +01:00
Martin Kojtal ddd3b013e8
Merge pull request #12632 from evedon/ed-minimal-snprintf
Fix snprintf in minimal-printf library
2020-03-25 11:34:23 +01:00
Evelyne Donnaes a3c3656557 Removed mbed_minimal_formatted_string_character
mbed_minimal_formatted_string_character is no longer
required since fputc does the new line conversion.
This results in a small Flash saving.
2020-03-23 13:51:47 +00:00
Evelyne Donnaes 94acb5da50 Fix snprintf in minimal-printf library.
mbed_minimal_putchar assumed that buffer being NULL meant that it
should print to a file. This caused a system crash when calling
snprintf with both buffer and stream set to NULL.
It is valid to call snprintf with a NULL buffer; nothing should
be outputted, but the string length should be measured.
2020-03-23 13:46:12 +00:00
Rajkumar Kanagaraj eb40dbcc20 Remove ARMC5 reference from Mbed OS platform 2020-03-19 10:48:14 -07:00
Martin Kojtal 4f45b95ca3
Merge pull request #12607 from facchinm/sys_stat_h_inclusion
Use toolchain's struct stat if available
2020-03-17 09:30:03 +01:00
Evelyne Donnaes ebf5d27788 Add "rtos-api" to bare metal 2020-03-16 11:40:49 +00:00
Anna Bridge 0699ac4e7e
Merge pull request #12571 from kjbracey-arm/noncopy
C++11-ify NonCopyable
2020-03-12 11:07:05 +00:00
Kevin Bracey bb733f1ee8 Callback updates
* Optimise clearing by adding `nullptr` overload. This overload means
  `Callback(NULL)` or `Callback(0)` will no longer work; users must
  use `Callback(nullptr)` or `Callback()`.
* Optimise clearing by not clearing storage - increases code size of
  comparison, but that is extremely rare.
* Reduce ROM used by trivial functors - share copy/destroy code.
* Config option to force trivial functors - major ROM saving by
  eliminating the "operations" table.
* Config option to eliminate comparison altogether - minor ROM saving by
  eliminating zero padding.
* Conform more to `std::function` API.
2020-03-11 15:46:03 +02:00
Anna Bridge 33f3049286
Merge pull request #12233 from bulislaw/minimal_printf_default
Enable minimal-printf by default for all builds
2020-03-10 12:13:11 +00:00
Martino Facchin b865d90bff Use toolchain's struct stat if available
Fixes https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/49

The patch should be as safe as possible, since __has_include is guarded itself.
2020-03-10 10:17:41 +01:00
Kevin Bracey 489525c191 C++11-ify NonCopyable
Define copy operators public and deleted rather declaring them private
and undefined. Will give immediate compilation errors rather than
delayed linking errors.
2020-03-05 15:45:39 +02:00
Philipp Steiner 3dcd279fa1 correct comment 2020-03-05 09:13:55 +01:00
Philipp Steiner e3917e495a set mbed_set_error_hook() to deprecated 2020-03-05 08:49:17 +01:00
Philipp Steiner 17e8b9c756 Remove mbed_set_error_hook and replace with weak mbed_error_hook implementation 2020-03-04 12:21:22 +01:00
Martin Kojtal ba9496451a
Merge pull request #12554 from rajkan01/fliesys_remove_deprecated
Remove FileSystemLike deprecated APIs
2020-03-04 08:23:02 +00:00
Martin Kojtal b4034dc547
Merge pull request #12551 from rajkan01/mpm_remove_deprecated
Remove mbed power management deprecated API
2020-03-04 08:22:52 +00:00
Martin Kojtal b611de8b6b
Merge pull request #12550 from rajkan01/mbedint_remove_deprecated
Remove mbed interface deprecated API
2020-03-04 08:22:27 +00:00
Martin Kojtal 40fb45e4da
Merge pull request #12549 from rajkan01/fh_remove_deprecated
Remove FileHandle deprecated APIs
2020-03-04 08:21:52 +00:00
Martin Kojtal 6e6603f97d
Merge pull request #12534 from rajkan01/callchain_remove_deprecated
Remove the deprecated CallChain class and its APIs
2020-03-03 14:57:59 +00:00
Martin Kojtal 2dc5520c2b
Merge pull request #12553 from rajkan01/dh_remove_deprecated
Remove DirHandle deprecated APIs
2020-03-03 14:57:16 +00:00
Martin Kojtal d94965f38d
Merge pull request #12508 from evedon/ed-mprintf-stack-overflow
Fix minimal-printf stack overflow
2020-03-03 14:39:11 +00:00
Rajkumar Kanagaraj 2a1c641ad3 Remove FileSystemLike deprecated APIs 2020-03-02 16:20:02 -08:00
Rajkumar Kanagaraj dd9afdf77c Remove DirHandle deprecated APIs 2020-03-02 15:42:31 -08:00
Rajkumar Kanagaraj 35f1b4ab53 Remove mbed power management deprecated API 2020-03-02 15:06:26 -08:00
Evelyne Donnaes 5016fa1a10
Merge branch 'master' into minimal_printf_default 2020-03-02 17:31:37 +00:00
Evelyne Donnaes 0f2b0d1be5 Fixed greentea tests 2020-03-02 17:27:17 +00:00
Rajkumar Kanagaraj 5d0aab847e Remove mbed interface deprecated API 2020-03-02 09:00:01 -08:00
Rajkumar Kanagaraj 13a1130697 Remove the deprecated FileHandle APIs 2020-03-02 06:45:01 -08:00
Rajkumar Kanagaraj 6e969ec5ab Remove the deprecated CallChain class and its APIs. 2020-02-28 07:41:44 -08:00
Rajkumar Kanagaraj b3ba0905ac Remove the deprecated CriticalSectionLock APIs 2020-02-28 07:19:19 -08:00
Martin Kojtal 272c42d0fe
Merge pull request #12527 from rajkan01/atcmd_remove_deprecated
Remove the deprecated ATCmdParser APIs.
2020-02-28 09:48:05 +00:00
Martin Kojtal fc5f3259de
Merge pull request #12458 from GaborAbonyi/add_musca_b1_platform
Add Musca B1 target
2020-02-27 13:53:58 +00:00
Rajkumar Kanagaraj 72d2f40bff Remove the deprecated ATCmdParser APIs. 2020-02-27 04:51:36 -08:00
Martin Kojtal 32f615e420
Merge pull request #12495 from kjbracey-arm/override_serial
C++11-ify virtualisation in FileHandle + Serials
2020-02-25 16:00:43 +00:00
Evelyne Donnaes a02f4b4856 Fix minimal-printf stack overflow 2020-02-25 10:44:11 +00:00
Kevin Bracey c39959ca8b C++11-ify virtualisation in FileHandle + Serials
Use `override` and `final` where appropriate, and eliminate unnecessary
`virtual`.
2020-02-24 10:37:17 +02:00
Anna Bridge 8c17270306
Merge pull request #12480 from 0xc0170/fix_spdx
Fix SPDX identifiers and licenses (excluding features and targets)
2020-02-21 16:34:30 +00:00
Tamas Kaman 551c3c553c Add ARM_MUSCA_B1 as a new target platform
Musca-B1 is a Cortex-M33 based target with security extension enabled.

- ARM_MUSCA_B1 is the non-secure target running mbed-os.
- ARM_MUSCA_B1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_B1 is submitted by a
  pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
  signs it and then concatenates the bootloader with the signed binary.

Change-Id: I4b36290941b5f0bb7aa7c12dda2f38b5c1e39ae2
Signed-off-by: Tamas Kaman <tamas.kaman@arm.com>
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-21 14:34:39 +01:00
Martin Kojtal 9cb8a12cc2 fix SPDX identifier typos 2020-02-21 07:01:55 +00:00
Martin Kojtal 21ad8af815 platform: fix SPDX identifiers 2020-02-21 07:00:58 +00:00
Bartek Szatkowski 954f22bb52 minimal-printf: Disable float by default 2020-02-19 15:29:39 +00:00
Bartek Szatkowski f9be9dc5be minimal-printf: Explicitly print %ll[diuxX] when 64b disabled 2020-02-19 15:29:38 +00:00
Bartek Szatkowski 554a04ba5f minimal-printf: README updates 2020-02-19 15:29:38 +00:00
Bartek Szatkowski 30c947efbb Enable minimal-printf by default for all builds
Also reenable floating point by default.
2020-02-19 15:29:38 +00:00
David Lin d725b13906
Fixed typo: 'lenght' in minimal-printf
Note that the word 'lenght' is wrong,
so that 'lenght' should been replaced with 'length'.
2020-02-16 18:11:18 +08:00
Evelyne Donnaes ae57b4303e Fix thread_sleep_for zero 2020-02-06 15:19:18 +00:00
Maciej Bocianski 63d14f3af4 add dummy SUPER_REALLOC/CALLOC calls to alloc wrappers
This code prevents the ARMC6 compiler/linker from removing
SUB_REALLOC/CALLOC symbols from image when LTO is enabled

Fixes below error:
L6137E: Symbol $Sub$$calloc was not preserved by the LTO codegen but is needed by the image.
2020-02-04 12:29:53 +01:00
Maciej Bocianski 783953e5dc ARMC6 keep __user_setup_stackheap symbol when LTO enabled
Fix for the error L6915E: Library reports error: Heap was used, but no heap region was defined
2020-02-04 12:29:53 +01:00
Martin Kojtal 250e58134f
Merge pull request #12286 from pea-pod/target-nucleo_l452re-p
Add new target: NUCLEO_L452RE-P
2020-02-03 16:34:36 +00:00
Kevin Bracey d063902ee8
Merge pull request #12336 from SeppoTakalo/disable_writebuf
Disable write buffering on debug builds.
2020-01-31 16:24:04 +02:00
Kevin Bracey 65a5d1b682
Merge pull request #12326 from kjbracey-arm/systimer_abs_fix
Correct SysTimer absolute time calculations
2020-01-31 15:01:36 +02:00
Seppo Takalo c352488412 Disable write buffering on debug builds.
In mbed_start_application() there was a code that was supposed to
set DISDEFWBUF to one when running a debug build. However, this code
was in the wrong place, as this function is only called from
bootloader.

Move the code to correct place so that standalone applications use it
as well.

For the reference of DISDEFWBUF bit, see
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/CHDCBHEE.html
2020-01-30 16:19:28 +02:00
Kevin Bracey de915a034b Correct SysTimer absolute time calculations
`SysTimer::set_wake_time` incorrectly assumed that the `SysTimer`s tick
count and the underlying HAL timer had the same zero base. This normally
holds, at least approximately, in RTOS builds where the HAL timer starts
from zero at the same time the SysTimer is initialised.

But in bare metal builds, the HAL timer could be started some time
before the SysTimer, giving a significant discrepancy.

Beyond that, there's no requirement for HAL timers to start from zero in
the spec.

Record the HAL timer start time to get the conversion right.
2020-01-29 15:28:20 +02:00
Rajkumar Kanagaraj 16fcdaa56f minimal-printf: README correction
- Updated the README with "target.printf_lib"
2020-01-28 06:56:12 -08:00
pea-pod f7c4693747 Add new target: NUCLEO_L452RE-P 2020-01-27 18:41:18 -06:00
Rajkumar Kanagaraj f1e1375685 Fix for the missing retrieve error context function call.
- Add the function to retrieve error context after a fatal error is called at
   system initialisation for the bare metal profile.
2020-01-23 07:39:29 -08:00
Anna Bridge 706625a982
Merge pull request #12297 from evedon/ed-update-mprintf-doc
Corrected minimal-printf README
2020-01-23 12:12:37 +00:00
PARKJIHOON 8ab00df7b4 Adding Samsung Exynos i S111 target code.
Adding a new target of HW development kit using [Samsung Exynos i S111](https://www.samsung.com/semiconductor/minisite/exynos/products/iot/exynos-i-s111/) module to Mbed-OS.
This will widen the HW choices of Mbed-OS enabled NB-IoT, GNSS and Security (eFuse, AES, SHA-2, PKA, Secure Storage, Security Sub-System, [PUF](https://en.wikipedia.org/wiki/Physical_unclonable_function)) modules.
Target Name: S5JS100

Co-authored-by: Ivan Galkin <ivan.galkin@samsung.com>
Co-authored-by: Seokwon Lee <swon.lee@samsung.com>
Co-authored-by: Zhizhe Zhu <zhizhe.zhu@samsung.com>
Co-authored-by: Xinyi Zhao <xinyi.zhao@samsung.com>
2020-01-22 14:40:50 +09:00
Anna Bridge 40a0b28068
Merge pull request #12225 from evedon/ed-heap-stack-test
Fix baremetal heap and stack initialisation
2020-01-21 16:27:37 +00:00
Evelyne Donnaes 7205b73ada Corrected minimal-printf README 2020-01-21 16:21:05 +00:00
Anna Bridge 80fe861f1d
Merge pull request #12035 from kjbracey-arm/callback_prep
Preparation for Callback changes
2020-01-21 11:50:43 +00:00
Evelyne Donnaes 3e3af70afc Fixed baremetal heap and stack initialisation.
Enabled heap_and_stack test for baremetal.
Added a test to check that global variables are initialised.

In mbed_sdk_boot:
- Added initialisation for mbed_stack_isr_start/size and mbed_heap_start/size for all toolchains.
- ARM toolchain:
   - Added call to mbed_toolchain_init() to initialise global variables.
   - Moved microlib initialisation code from mbed_retarget.cpp to mbed_sdk_boot.c.
- IAR toolchain: there is no equivalent to a software init hook that can be called. __low_level_init() was used but since this function is called before RAM initialisation, it cannot be used to initialize global variables. Defined a new __mbed_init() function called from IAR startup file instead.
2020-01-21 10:13:16 +00:00
Martin Kojtal 18c941cc84
Merge pull request #12207 from hugueskamba/hk-add-buffered_serial
Add BufferedSerial class to replace UARTSerial
2020-01-16 10:06:22 +00:00
Hugues Kamba a74ffacf81 Remove usage of UARTSerial in Mbed OS Core diretories
Replace with BufferedSerial as UARTSerial has been deprecated.
2020-01-13 13:20:57 +00:00
Hugues Kamba 3b59f6ce4d Minimal-printf: Fix wrapping of printf functions for the ARM compiler
As the ARM compiler is in GNU compatible mode, it defines __GNU__ which
(based on pre-processor condition in  mbed_printf_implentation.h)
causes the printf functions to be wrapped using _wrap_* instead of
$Sub$$*.

This commit modifies the pre-processor
conditions to check for __GNUC__last in order to correctly
substitute the printf functions depending on the toolchain in use.

It also gets rid of $Super$$* substitution as it is not needed. $Super$$
is used to identify the original unpatched functions.

Missing substitutions for ARM compiler internal optimized "printfs" are
also added.
2020-01-13 11:24:57 +00:00
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
Kevin Bracey 9577b0853b Add mstd_new for mstd::launder
Increasingly clever compilers can hit funny aliasing problems with
object stores like mbed::Callback. Add access to the C++17 launder
facility.
2020-01-09 14:52:50 +02:00
Martin Kojtal 8c4ed4a6cb
Merge pull request #11897 from kjbracey-arm/crc
MbedCRC: improve init value handling and tests
2020-01-09 13:31:30 +01:00
Martin Kojtal 222d31c2b6
Merge pull request #12037 from kjbracey-arm/sharedptr_move
SharedPtr: add move operations
2020-01-09 12:03:45 +01:00
Kevin Bracey 07d43b72d2 Add mstd::is_constant_evaluated
GCC 9 and sufficiently-new Clang (including ARM Compiler 6.13) give us
access to the C++20 (draft) `is_constant_evaluated` test. Allows us to
restrict code to compile-time only.

This is particularly useful when using assembler intrinsics, which the
compiler cannot optimise or compile-time evaluate. It allows us to write
something like

    constexpr uint32_t reverse_bits(uint32_t x)
    {
        if (is_constant_evaluated(x)) {
            // C code to do calculation here
            return x;
        } else {
            // an assembler intrinsic that cannot be optimised
            return __RBIT(x);
        }
    }

This can then be totally compile-time given a constant input.

(In this example, ultimately it would be a good idea to include this
functionality in CMSIS's GCC `__RBIT`, which needs it because GCC
requires use of assembler. Clang implements `__RBIT` as a built-in,
meaning it can already compute it at compile-time, so does not benefit.).
2020-01-08 13:36:17 +02:00
ccli8 ad80ed17fc [M2351] Change default stdio-baud-rate to 115200 2020-01-06 15:55:00 +08:00
Martin Kojtal fc2a71064d
Merge pull request #12068 from rajkan01/feature_bare_metal
Enabling small C library option and deprecating uARM toolchain
2020-01-03 11:35:48 +00:00
Martin Kojtal a7b312d687
Merge pull request #12175 from hugueskamba/hk-minimal-printf-fix-readme
Minimal-printf: Fix documentation as floating point is disabled by default
2020-01-02 10:11:47 +00:00
Hugues Kamba d3d1b74e79 Minimal-printf: Fix documentation as floating point is disabled by default 2019-12-30 11:28:16 +00:00
Heath Petersen a6b0909794 namespace and extern C don't need semicolon 2019-12-26 16:08:22 -06:00
Rajkumar Kanagaraj 957dca2082 Enabling small C library option and deprecating uARM toolchain
- By default, Mbed OS build tools use standard C library for all supported toolchains.
   It is possible to use smaller C libraries by overriding the "target.default_lib" option
   with "small". This option is only currently supported for the GCC_ARM toolchain.
   This override config option is now extended in the build tool for ARM toolchain.
 - Add configuration option to specify libraries supported for each toolchain per targets.
 - Move __aeabi_assert function from rtos to retarget code so it’s available for bare metal.
 - Use 2 memory region model for ARM toolchain scatter file for the following targets:
   NUCLEO_F207ZG, STM32F411xE, STM32F429xI, NUCLEO_L073RZ, STM32F303xE
 - Add a warning message in the build tools to deprecate uARM toolchain.
 - NewLib-Nano C library is not supporting floating-point and printf with %hhd,%hhu,%hhX,%lld,%llu,%llX
   format specifier so skipping those green tea test cases.
2019-12-19 10:05:11 -08:00
Anna Bridge fb8bbb83e4
Merge pull request #11997 from kjbracey-arm/rm_fp
Remove deprecated FunctionPointer class
2019-12-19 16:32:46 +00:00
Anna Bridge 806ad39648
Merge pull request #12101 from rajkan01/feature_crash_report_fix
Bare metal: Retrieve error context after crash
2019-12-17 16:27:59 +00:00
Anna Bridge 0770798bd2
Merge pull request #12048 from kjbracey-arm/sharedptr_nullptr
SharedPtr: add nullptr constructor
2019-12-17 16:21:54 +00:00
Anna Bridge 6b4262f7a0
Merge pull request #12032 from kjbracey-arm/fallthrough
Add MBED_FALLTHROUGH attribute
2019-12-17 16:20:35 +00:00
Anna Bridge d128ff4882
Merge pull request #11961 from hugueskamba/hk-add-unbuffered-serial-class
UnbufferedSerial: Introduce the class to replace RawSerial
2019-12-13 15:54:40 +00:00
Hugues Kamba 7b845409a0 UnbufferedSerial: Introduce the class to replace RawSerial
* Deprecate RawSerial.
* Introduce UnbufferedSerial to provide unbuffered I/O by implementing
  with a FileHandle interface for I/O	streams.
* Add Greentea test for the UnbufferedSerial class.
2019-12-12 08:44:09 +00:00
Antti Kauppila d5fdcfdab8 busy s... fix (ONME-4352)
oob handling added for OK in busy scenario

Fixed spellcheck error

trace added for ok
2019-12-12 09:36:34 +02:00
Rajkumar Kanagaraj f6a7f6587a Fixing the Mbed OS crash reporting and enable green tea test for bare metal.
Added missing mbed_error_initialize function call in bare metal boot code which is used
to retrieve the crash report from RAM in case of any previous abnormal re-boot but this function call is present in RTOS boot code.
2019-12-11 04:28:42 -08:00
Hugues Kamba 431f6cb604 Minimal Console: Use static pin map 2019-12-10 15:32:15 +00:00
Kevin Bracey 2b4b7232b7 SharedPtr: add nullptr constructor
For consistency with `std::shared_ptr`, and `mbed::Callback`, and as a
potential optimisation aid, give `SharedPtr` a distinct constructor for
`nullptr`.
2019-12-09 11:37:06 +02:00
Kevin Bracey 678ec0f3fb SharedPtr: add move operations
Optimise SharedPtr by giving it move constructor and assignment
operator.
2019-12-09 10:10:44 +02:00
Martin Kojtal 2536e9291d
Merge pull request #12034 from kjbracey-arm/systimer_warning
SysTimer: Suppress implicit virtual warning
2019-12-06 13:35:08 +01:00
Kevin Bracey a1bbbb8845 SysTimer: Suppress implicit virtual warning 2019-12-05 15:48:36 +02:00
Kevin Bracey d97460f8bb Add MBED_FALLTHROUGH attribute
C++17 standardised `[[fallthrough]]` for `switch` statements to suppress
compiler warnings. Provide access to it, or compiler-specific
alternatives.
2019-12-05 12:08:26 +02:00
Martin Kojtal 28caa43a91
Merge pull request #12025 from fkjagodzinski/fix-platform-unused_file
Platform: Delete an unused astyle output file
2019-12-04 12:37:26 +01:00
Filip Jagodzinski 001731c5af Platform: Delete an unused astyle output file 2019-12-04 10:16:24 +01:00
Martin Kojtal 2cf56b8f6d
Merge pull request #11891 from hugueskamba/hk-enable-minimal-printf-in-tools
minimal-printf: Enable using a target configuration parameter
2019-12-04 10:14:54 +01:00
Martin Kojtal 64d172c3bd
Merge pull request #11970 from kjbracey-arm/fault_crash
Avoid crashes during fault handler
2019-12-04 10:13:54 +01:00
Hugues Kamba d5aef28145 minimal-printf: Enable using a target configuration parameter 2019-12-03 12:31:51 +00:00