Commit Graph

978 Commits (8f1bf967d3667c612c883b05237f6f740949f29d)

Author SHA1 Message Date
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