This patch modifies:
* the Beetle GCC ARM linker script
* the Beetle startup code
in order to define the memory regions that enable uvisor.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Implement the functions __cxa_guard_acquire, __cxa_guard_release and
__cxa_guard_abort so lazily initialized function-local static objects
are done so in a thread safe manner in GCC.
Fix the following linker errors:
ToolException: ./.build/LPC11U68/GCC_ARM/mbed-os/hal/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/startup_LPC11U68.o: In function `operator new(unsigned int)':
startup_LPC11U68.cpp:(.text._Znwj+0x0): multiple definition of `operator new(unsigned int)'
./.build/LPC11U68/GCC_ARM/mbed-os/hal/common/retarget.o:retarget.cpp:(.text._Znwj+0x0): first defined here
./.build/LPC11U68/GCC_ARM/mbed-os/hal/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/startup_LPC11U68.o: In function `operator new[](unsigned int)':
startup_LPC11U68.cpp:(.text._Znaj+0x0): multiple definition of `operator new[](unsigned int)'
./.build/LPC11U68/GCC_ARM/mbed-os/hal/common/retarget.o:retarget.cpp:(.text._Znaj+0x0): first defined here
./.build/LPC11U68/GCC_ARM/mbed-os/hal/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/startup_LPC11U68.o: In function `operator delete(void*)':
startup_LPC11U68.cpp:(.text._ZdlPv+0x0): multiple definition of `operator delete(void*)'
./.build/LPC11U68/GCC_ARM/mbed-os/hal/common/retarget.o:retarget.cpp:(.text._ZdlPv+0x0): first defined here
./.build/LPC11U68/GCC_ARM/mbed-os/hal/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/startup_LPC11U68.o: In function `operator delete[](void*)':
startup_LPC11U68.cpp:(.text._ZdaPv+0x0): multiple definition of `operator delete[](void*)'
./.build/LPC11U68/GCC_ARM/mbed-os/hal/common/retarget.o:retarget.cpp:(.text._ZdaPv+0x0): first defined here
collect2: error: ld returned 1 exit status
Signed-off-by: Tony Wu <tung7970@gmail.com>
One limitation of C++ is that implicit casts do not occur when
matching template overloads, as a consequence the callback's
argument type requires a strict match.
Unfortunately, the prevents the previously common pattern of using
void pointers as function arguments, causing unnecessary problems
for users porting code.
Thing *t;
void doit(void *p) { blablabla }
Callback<void()> cb(t, doit);
To avoid this, explicit overloads on void pointers were added. This
avoids a template expansion, and allows the implicit cast to occur
as the user would expect.
- Marked `call` and `operator()` functions as const
- Moved to static_cast for internal function pointer to avoid losing
compiler checked const-safety
- Added test for `operator=` with non-callback types
- Moved from zero-cast to value-initializer when callback is null
- Added `operator==` and `operator!=`
- Removed special handling of null callback
- Replicated doxygen to all overloads
- Added correct nops where uninitialized callbacks are called
- Added assertion for null callback
- Removed copy-constructor from callback constructor
This commit adds a dynamic memory tracer that calls a callback whenever
one of the basic memory allocation functions (malloc, realloc, calloc,
free) is called. The operation of the tracer is guarded by the
'MBED_MEM_TRACING_ENABLED` macro.
Infinite recursion during tracing is guarded by using atomic
increment/decrement primitives on the `trace_level` variable.
Thanks to @c1728p9 and @heky for their help and suggestions.
Additionally, the following changes were don to avoid combinatorial
explosion in function overloads as a result of adding cv-qualifiers:
- Added convenience function for inferred type
- Deprecated callback overloads qhere cv-qualifiers are not scalable
Supported overloads:
callback(void (*f)(A...));
callback(const Callback<R(A...)> &);
callback(T *t, void (*f)(T*, A...));
callback(const T *t, void (*f)(const T*, A...));
callback(volatile T *t, void (*f)(volatile T*, A...));
callback(const volatile T *t, void (*f)(const volatile T*, A...));
callback(T *t, void (T::*f)(A...));
callback(const T *t, void (T::*f)(A...) const);
callback(volatile T *t, void (T::*f)(A...) volatile);
callback(const volatile T *t, void (T::*f)(A...) const volatile);
remove target with RAM too small for RTOS GCC_ARM.
since newlib is used for RTOS re-entrance suport instead of nano-newlib :
Heap size is reduced because sdata and bss have increased.
Keep track of the current size allocated, maximum size allocated,
number of allocations, failed allocations and total size allocated for
both GCC and ARM. Report the maximum size allocated at the end of
testing.
Also, add a test to verify heap metrics are working as expected.
Check to see if ptr is NULL after acquiring the singleton lock to
prevent initialization race conditions. Also explicitly call the
constructor for type T.
1.Fix SPI flag name error
2.Fix SPI write blocking function
3.Use function pointer to implement SPI IRQ handler to reduce code size
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
This commit refactor the `lwip-eth/arch/TARGET_STM` folder and add the IPV4 feature for the
following targets:
- NUCLEO_F207ZG
- NUCLEO_F429ZI
- NUCLEO_F767ZI
- DISCO_F746NG
From the discussion on issue #2068:
Functions marked deprecated in the mbed library should notate when
the deprecation was started to allow efficient removal once a set
amount of time has expired.
Added the following macro:
MBED_DEPRECATED_SINCE("version", "message string")
Example usage:
MBED_DEPRECATED_SINCE("v5.1", "don't foo any more, bar instead")
void foo(int arg);
Adopted in existing deprecations:
- FunctionPointer
- RtosTimer
- Thread
This is common for any K64F not only for frdm-k64f that is named K64F. This
is causing conflicts with inheritance. This might be fixed better (long term
solution).
mbedci-test CI server is complian only with mbed-os release version 5.x.
This patch updates the Beetle section of the target.json file in order
to comply with the requirement.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
IAR compiler support is a mandatory requirement for mbed-os 5.1.
This patch adds support to IAR on Beetle mbed-os platform.
It contains:
* Linker script
* Startup code
* Target enablement
* Cordio libraries for BLE
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
The RTC1 counter can increase while the new value for the CC register
used by the os tick is computed. As a result, when interrupts are enabled
again RTC1 counter and CC register value are equal. If these two values are
equal then the interrupt for the CC channel used by the OS tick will be
generated the next time the RTC counter reach that value.
In other words, the next OS tick will occur 131 seconds latter.
This issue possibly concern all NRF51 targets with 32K of RAM but is
only visible on NRF51_DK target when their is heavy BLE load.
Set well defined limits for the heap and configure GCC and ARMCC to
correctly check these. IAR already correctly checked its heap.
This also statically declares the main thread stack so the
linker is responsible for its placement.
Currently this uses the same mechanism used by the rtos to conditionally
include the network-socket API. Perhaps this should be builtin to the
config system?
Note: this does require that the bug-compatible inclusion of mbed.h
be removed to avoid include-order issues.
per @sg-
The KL46Z passes all tests except the following when built with IAR:
tests-mbedmicro-rtos-mbed-threads. This is because the heap is becomes
fully allocated.This commit increases the heap from 8K to 16K.
This PR enforces that the default_build in a target's definition in
hal/targets.json is set to standard to be included in the version 5
release.
This is being enforced because small builds do not support
multi-threading. This makes the capabilities more consistent across all
boards in the version 5 release.
NOTE: This removes the MOTE_L152RC and the LPC11U68
from the version 5 release list because the 'default_build' for these
targets is currently set to 'small'.
Remove the critical section in mbed_rtc_time.c and instead use a
mutex to protect this. This function does not need to be interrupt
safe, just thread safe.
This fixes crashes on the GCC_ARM toolchain on the RTC test due to
trying to lock the GCC environment mutex while in a critical section.
Prior to this patch, this failure was likely to occur on STM and LPC
processor families.
The i2c expected wrongly a 32MHz core clock.
This commit add the following things:
- I2C now handle both 80MHz and 48MHz core clock speeds
- Align system_stm32l4xx.x files
1. Remove M453. It is not to support in this commit.
2. Remove uvisor. It is incomplete and not to support in this commit.
3. Replace __disable_irq() with critical_section APIs.
The key 'release' in hal/targets.json is ambiguous. This changes the key
to 'release_versions' to emphasize that the entries should be version
numbers/strings and that it should be an array, not a singular value.
Previously, the condition for including a target in a release was decided
by a 'release' key being set to 'true' in hal/targets.json. This doesn't
have enough granularity when we release multiple versions of mbed. This PR
changes the 'release' key to an array of strings, where each member is a
version that the target supports. Currently the valid versions are '2' and
'5'.
This PR also adds more robust checking for invalid target configurations
in a release. This is enforced whenever the release list is built from the
data, preventing invalid targets from coming into the release.
Finally, it updates the build_release.py script to use the new api for
fetching release targets.
This commit adds two implementations for the mbed wait functions (wait,
wait_ms, wait_us):
- with the RTOS present, the wait functions will use `Thread::wait` for
millisecond delays and a busy wait loop for sub-millisecond delays.
- with the RTOS not present, the wait functions will always use a busy
wait loop.
The NRF5x driver transmits a byte by writing it to the uart data
register and then waiting for the TXRDY event indicating that this
byte was sent. If another UART interrupt comes in at the right time
the the UART ISR handler will process and clear the TXRDY event,
even though this interrupt is not enabled. This causes serial_putc
to get stuck waiting on an already cleared TXRDY.
This patch fixing the lockup by preventing the UART ISR from handling
the TXRDY event if this interrupt is not enabled.
Beetle board is built to optimize power consumption therefore does not
provide on-board LEDs.
This patch adds a comment in PinNames in order to clarify that the
Emulated LEDs are provided for compatibility reasons with the MBED test
suite.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
With this change, we check for all-1s before executing erase. This means that
the cost of erasing a range is now proportional to the amount of sectors which
have been programmed. This should result in latency improvements in our use of
containers based on flash storage.
The RWW fix is controversial because it requires holding off interrupts for
periods of around 5ms at a time. But there were still some minor improvements
around that change which could be retained. This commit contains these
changes.
The LF clock initialization is already handled by the SystemInit function.
This code was causing troubles when run on targets with an alternate LF
clock.
MBED OS requires an us_ticker_read function that returns a 32bit
value in microseconds. This can not be represented directly on
the Beetle Timer Load register.
max_us_on_reg = (0xFFFFFFFF ticks)/DIVIDER_US
This patch introduces an intermediate layer that counts the timer wraps
around and returns the correct value of us to the MBED library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
MBED OS requires an lp_ticker_read function that returns a 32bit
value in microseconds. This can not be represented directly on
the Beetle Dual Timer Load register.
max_us_on_reg = (0xFFFFFFFF ticks)/DIVIDER_US
This patch introduces an intermediate layer that counts the timer wraps
around and returns the correct value of us to the MBED library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Before, the following results in a compilation error:
const struct Object *obj;
void obj_doit(const Object *obj);
Callback<void()> cb(obj, obj_doit);
This is especially noticable when migrating from the old Thread
constructor, which previously _required_ const.
Short term fix for all cv qualifiers through a C cast:
void *_obj = (void*)obj;
the unified target for NRF51 has been renamed MCU_NRF51_UNIFIED and
hal implementation has been moved from TARGET_MCU_NRF51822 to
TARGET_MCU_NRF51822_UNIFIED.
In the process, the only real taget kept for NRF51 based targets is
NRF51_DK.
It is too risky at this stage to switch NRF51822 (16K target) to the new
softdevice. The overhead of the RTOS is already too huge.
those symbols are not used.
bootloader and log are not needed in our case, just remove files causing
troubles.
define app_timer symbols with the RTX implementation.