Commit Graph

951 Commits (83a9606140aabe6ab0276c85539d187e3dec7ca2)

Author SHA1 Message Date
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
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
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
Martin Kojtal ad3647c191
Merge pull request #11957 from kjbracey-arm/crc-redo
MbedCRC and CRC HAL revisions (6.0 redo)
2019-12-03 13:21:36 +01:00
Martin Kojtal 25ca5d2a72
Merge pull request #11880 from kjbracey-arm/callback_variadic
Remove deprecated Callback methods
2019-12-03 09:04:55 +01:00
Martin Kojtal 111d1ca15e
Merge pull request #11962 from evva-sfw/feature/Bug_in_mbed_alloc_wrappers.cpp
Bug in mbed_alloc_wrappers.cpp
2019-12-02 16:16:16 +01:00
Kevin Bracey 60e07ef8d6 Remove deprecated FunctionPointer class 2019-12-02 15:53:47 +02:00
Kevin Bracey 0b28553ac2 Remove deprecated Callback methods 2019-12-02 15:27:10 +02:00
Kevin Bracey c67816b5ff Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-12-02 14:45:37 +02:00
Martin Kojtal d58e9d6e76
Merge pull request #11959 from hugueskamba/hk-fix-minimal-console
Minimal Console: Fix compilation error
2019-11-28 15:47:20 +01:00
Kevin Bracey fc05d51bcd Avoid crashes during fault handler
If the fault handler was hit before the stdio console was used and
initialised, the initialisation code caused a "mutex in ISR" trap,
stopping the register dump from happening.

Temporarily set the `error_in_progress` flag at the top of the fault
handler, and restore it before calling `mbed_error`. Take the
opportunity to suppress fault dumps on recursive crashes, much as is
done inside `mbed_error`.
2019-11-28 15:03:26 +02:00
Przemyslaw Stekiel b2dad08387 Change explicit pinmap to static pinmap 2019-11-28 08:32:12 +01:00
Przemyslaw Stekiel ba12228556 Explicit pinmap: Fix build failures reported by CI 2019-11-28 08:32:03 +01:00
Przemyslaw Stekiel d75cc97d80 Explicit pinmap - fix style 2019-11-28 08:32:02 +01:00
Przemyslaw Stekiel a7b298f353 mstd_cstddef: add C support and macros for C++11 2019-11-28 08:32:00 +01:00
Przemyslaw Stekiel 3d719f7e35 K64F, NUCLEO_F429ZI: Use explicit pinmap for console 2019-11-28 08:32:00 +01:00
Philipp Steiner 0b36529cfa replace #ifdef MBED_MEM_TRACING_ENABLED and #ifdef MBED_HEAP_STATS_ENABLED with #if MBED_MEM_TRACING_ENABLED and #if MBED_HEAP_STATS_ENABLED 2019-11-27 15:54:22 +01:00
Hugues Kamba 240758db42 Minimal Console: Fix compilation error
Build successfully when `platform.stdio-convert-tty-newlines` or
`platform.stdio-convert-newlines` are set to `true` by ensuring
`isatty()` is also included when `platform.stdio-minimal-console-only`
is set to `true`.
2019-11-27 12:17:03 +00:00
Martin Kojtal 394cf7a0eb
Merge pull request #11947 from hugueskamba/hk-fix-minimal-console
Minimal Console: Fix syntax errors
2019-11-27 11:30:08 +01:00
Hugues Kamba 72d5b51762 Minimal Console: Fix syntax errors 2019-11-26 14:09:01 +00:00
Martin Kojtal 5f7ecea00b
Revert "MbedCRC and CRC HAL revisions" 2019-11-26 13:45:37 +00:00
Martin Kojtal 2bde6581a6
Merge pull request #11720 from mtomczykmobica/ONME-4405
ATCmdParser: merge scanf and recv functions
2019-11-21 15:29:29 +01:00
Marcin Tomczyk 1d3a1b7c6c ATCmdParser: unittests implementation 2019-11-20 22:37:01 -08:00
Marcin Tomczyk 15eb2a6e4f ATCmdParser: merge scanf and recv functions.The goal is to give a configuration parameter for this function which would indicate are we trying to find a match from one line(scanf) or do we might end up processing multiple lines(recv) to find a match. 2019-11-20 22:35:55 -08:00
Martin Kojtal fd22997b60
Merge pull request #11559 from kjbracey-arm/crc
MbedCRC and CRC HAL revisions
2019-11-13 18:24:04 +01:00
Martin Kojtal eab1c2e594
Merge pull request #11796 from hugueskamba/hk-add-minimal-console-to-retarget
mbed_retarget: Add a minimal console implementation to provide basic functionalities
2019-11-13 17:11:27 +01:00
Kevin Bracey 8811972201 Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-11-13 14:31:49 +02:00
Hugues Kamba 051991fafb mbed_retarget: Add a minimal console implementation to provide basic functionalities
The retarget code allocates an array of FileHandle* for console and file
handling (filehandles). A tiny target only needs a console (putc/getc).
There is no need for file handling.

The POSIX layer and the array of FileHandle* is not required for small
targets that only need a console ; this code is optionally compiled
out if the configuration parameter platform.stdio-minimal-console-only is
set to `"true"`.
2019-11-11 15:14:00 +00:00
Martin Kojtal 6240335855
Merge pull request #11729 from hugueskamba/hk-fix-minimal-printf-percentage-printing
minimal-printf: Fix handling of the two character sequence %%
2019-10-23 16:19:44 +02:00