Commit Graph

775 Commits (c5ad70c1e5ce060216419375c50350650b33488a)

Author SHA1 Message Date
Rajkumar Kanagaraj dc9fbfa6fb Fix for Problem copying the instance from BSS to stack
-Created global instance of either LowPowerTicker or Ticker
2019-06-03 16:32:14 +02:00
Rajkumar Kanagaraj 33793e710d Added the ticker support
-Modified the device dont have support of lp ticker will ticker for watchdog callback register
2019-06-03 16:32:14 +02:00
Rajkumar Kanagaraj dfe4b533c3 Update Watchdog
- Changed the process into static method
 - used the singletonptr for creating the low power ticker instance
 - Added the mbed stub into cmake build for cellularnonipsocket,loramacrypto
2019-06-03 15:31:20 +02:00
Rajkumar Kanagaraj cd26a74efb fix for astyle 2019-06-03 15:24:02 +02:00
Rajkumar Kanagaraj f94eb3cf13 Fix for the Ci build issue 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj 43c2647be7 fix: Fixing rebased created bugs 2019-06-03 15:24:00 +02:00
Rajkumar Kanagaraj 47030cd23f SW watchdog unittest cases
-Added the mock class function to mock mbed_assert_internal
  -Added the unit test case to test start,kick,stop
  -Modified the interface api name from is_alive to process
  -added the unit test cases for process
2019-06-03 15:23:59 +02:00
Rajkumar Kanagaraj 3ea9521408 HW Watchdog and SW watchdog interface
- Added Hw watchdog periodic kick calls software watchdog is_alive check
2019-06-03 15:23:58 +02:00
Rajkumar Kanagaraj bcea865db2 Add SW Watchdog
-SW watchdog has interface name start(),stop(),kick()	Sw watchdog internally has static list and shared across multiple instance of SW watchdog
	- Sw watchdog initialize timeout value,unique string via constructor whenever threads created sw watchdog object
	-Threads make sure pass proper timeout value,Unique string while creating the instance.
	-start() called by components(BLE,WIFI etc.,),it adds the entry into static list with few details current count ,etc.,
	-kick() called by registered components(BLE,WIFI etc.) to reset current count to zero.
        -is_alive - interface API to mbed_watchdog_manager
        -implementation optimization
2019-06-03 15:23:57 +02:00
Rajkumar Kanagaraj 400b2ee8a7 Add HwWatchdog
- mbed_watchdog_mgr has interface name mbed_wdog_manager_start(),mbed_wdog_manager_stop(),mbed_wdog_manager_kick()
    - HwWatchdog is going to attach with LowPowerTIcker for periodic callback functionality
    - mbed_wdog_manager_start() will either get start either by BL/RTOS Aps,it reads the timeout value specified via macro and macro gets defined in target.json file.
    - mbed_wdog_manager_start() internally configure below HAL hw watchdog with timeout specified via target.json
    - mbed_wdog_manager_start() internally divide the timeout(specified in target.json) by the 2 and attach LowPowerTicker with periodic callback of hw_kick()
    - mbed_wdog_manager_start() internally create one instance of sw watchdog class,to access the static list data structure of sw watchdog class
    - mbed_wdog_manager_kick() function periodically get called and refresh the hw watchdog to avoid watchdog reset
    - converted C++ code into C based APIs
    - added boolean to control watchdog start and stop
    - Added detach from ticker on stop API
2019-06-03 15:23:56 +02:00
Steven Cartmell 366893ae71 Add independent watchdog reference implementation for STM32 2019-05-24 11:20:25 +02:00
Steven Cartmell 6b3d790fc1 Add function to fetch platform specific reset reason register values 2019-05-24 11:20:24 +02:00
Steven Cartmell 41878bc3de Add Reset Reason platform API 2019-05-24 11:20:23 +02:00
Martin Kojtal 541dee4531
Merge pull request #10553 from korjaa/semihosting_docs
Add semihosting and SWO examples to mbed_override_console().
2019-05-23 21:40:37 +01:00
Jaakko Korhonen 9fb4437003 Update mbed_retarget.h coding style, star binds to the right. 2019-05-23 09:27:05 +03:00
Gabor Kertesz 40627a5220 Fix last issues
Imports working McuBoot for reset.
Updates microsec ticker driver.
Default baudrate is set to 115200 to see TF-M boot messages.
Stack top is set to scatter file dependent and not hard-coded.
2019-05-22 17:17:26 +03:00
Martin Kojtal 5be51a5b86
Merge pull request #9960 from marcuschangarm/fix-no-rtos-wait
Use LP tickers for waiting in no RTOS builds when available
2019-05-21 09:13:27 +01:00
Marcus Chang 6aca51fc17 Use LP tickers for waiting in no RTOS builds when available
For bare metal builds, use the lp_ticker for calls to wait_ms.
2019-05-16 07:02:06 -07:00
Kevin Bracey c799dc3332 ARMC5: fix mbed_atomic_impl.h assembly 2019-05-16 13:06:16 +03:00
Martin Kojtal 3ea1c56124
Merge pull request #10147 from kjbracey-arm/atomic_bitwise
Assembler atomics
2019-05-13 14:18:05 +01:00
Jaakko Korhonen a48d12683f Add semihosting and SWO examples to mbed_override_console(). 2019-05-10 10:05:06 +03:00
M. Rahimi d30bdbe08b Enabled crash reporting for DISCO_F407VG target 2019-05-07 19:25:46 +04:30
Martin Kojtal 1de0712272
Merge pull request #9944 from deepikabhavnani/stm32_splitheap
GCC - Add support to split heap across 2-RAM banks
2019-04-30 11:02:51 +01:00
Anna Bridge 23af842715
Merge pull request #10078 from OpenNuvoton/nuvoton_fix-heap-in-rtosless
Fix heap init error in rtos-less code
2019-04-26 13:31:10 +01:00
Kevin Bracey 2bb40450ec Add non-volatile atomic loads and stores
Volatile makes no real difference when we're using assembler, or locked
functions, but leaving it off could be more efficient for the basic
loads and stores. So add non-volatile overloads in C++ for them.
2019-04-26 13:12:35 +03:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
Martin Kojtal 94898a12ab
Merge pull request #10358 from kjbracey-arm/error_print_improvements
Error print improvements
2019-04-17 08:04:15 +01:00
Martin Kojtal 237bf04507
Merge pull request #10395 from kjbracey-arm/mbed_error_warnings
mbed_error: Avoid negative left shift
2019-04-16 08:23:45 +01:00
Deepika 20a341d55f Add more information and comments 2019-04-15 12:00:19 -05:00
Kevin Bracey b8e80dd2fb Don't trap RTX errors or mutex errors during errors
Once a fatal error is in progress, it's not useful to trap RTX errors
or mutex problems, so short-circuit the checks.

This makes it more likely that we may be able to get the console
initialised if it is being written to for the first time by `mbed_error`
in a difficult context - such as an RTX error callback from inside an
SVCall.

For example, the one-line program

   osMutexAcquire(NULL, 0);

will generate an RTX error trap, then `mbed_error` will try to call
`write(STDERR_FILENO)` to print the error, which will prompt mbed_retarget to
construct a singleton `UARTSerial`. This would trap in the mutex
for the singleton or the construction of the UARTSerial itself, if
we didn't allow this leniency. If we clear the mutex checks, then
`UARTSerial::write_unbuffered` will work.
2019-04-15 11:29:04 +03:00
Kevin Bracey a4010942eb mbed_error: Avoid negative left shift
User uses of `MBED_MAKE_ERROR` assemble a new error that gets its bottom
16 bits from an existing negative 32-bit error code. This lead to
undefined behaviour when `<<` was used on it - even though it was a
shift by zero!

Avoid the undefined behaviour warning from Clang by masking before
shifting.
2019-04-12 17:31:46 +03:00
Martin Kojtal 4d56b94686
Merge pull request #10349 from studavekar/fix-nuvonton-crash-data
Fix crash capture feature for nuvoton
2019-04-12 14:13:58 +01:00
ccli8 64515c063f Fix heap init error in rtos-less code
In rtos-less code, heap is defined by assuming one-region. Through weak-reference to
ARM_LIB_HEAP, heap definition is fixed if ARM_LIB_HEAP is defined.
2019-04-12 14:34:37 +08:00
Cruz Monrreal 582edf503a
Merge pull request #10366 from kjbracey-arm/feature_CMSIS_5_ca812421
Update CMSIS to 5.5.1
2019-04-11 20:34:00 -05:00
Kevin Bracey 020f0e580d Astyle format mbed_fault_handler.[ch] 2019-04-10 16:04:43 +03:00
Kevin Bracey 07a2ca381b Move fault handlers to platform directory
Having them in cmsis causes grief when attempting to update CMSIS with
the importer script.
2019-04-10 14:36:52 +03:00
Deepika 3593444e93 Add support of heap memory split between 2-RAM banks.
Please note the heap address of the both the banks must not be contigious else
GCC considers it to be single memory bank and does allocation across the banks,
which might result into hard-fault
2019-04-09 12:08:49 -05:00
Kevin Bracey aa0e86475c mbed_error_puts: Prime STDERR_FILENO before writing
Prime the console outside the critical section, improving the chances of
nice initialisation.
2019-04-09 16:15:17 +03:00
Kevin Bracey f2a13a85a1 mbed_assert_failure: Don't take critical section
Assert failure took a critical section before calling `mbed_error`.

There's no need to take a critical section on assert failure -
mbed_error does not do this, and is designed to operate from normal
contexts.

Avoiding the critical section will improve the chances of console
initialisation due to assert failure working nicely.
2019-04-09 16:15:09 +03:00
Shrikant Tudavekar d810b85094 remove unused __CRASH_DATA_RAM_SIZE__ 2019-04-08 15:47:18 -05:00
Shrikant Tudavekar 4b182b92f1 enable crash capture for NUMAKER_PFM_NUC472 2019-04-08 15:36:28 -05:00
Kevin Bracey f6456d8c81 Add option to disable default UART console
New `target.console-uart` option added to indicate whether a target has
a console UART on STDIO_UART_TX/RX/RTS/CTS pins. (The existing option
`target.console-uart-flow-control` indicates whether RTS and or CTS is
available in addition to TX and RX).

The option defaults to true, and is currently true on all platforms. It
only applies if DEVICE_SERIAL is true, so no need to go through and mark
it false for non-SERIAL platforms.

An application can turn off target.console-uart to save ROM/power/etc if
they don't want to use the serial console.  If this is turned off, the
console won't be activated for stdin/stdout, but the application is
still free to open `UARTSerial(STDIO_UART_TX, STDIO_UART_RX)`
themselves.
2019-04-08 15:56:44 +03:00
Cruz Monrreal 8614382fe2
Merge pull request #10151 from kjbracey-arm/sleepmgr_optimise
Sleep manager: optimise counter
2019-03-28 17:09:42 -05:00
d-kato 090fcb007f Changed LOOP_SCALER of "wait_ns()" 2019-03-26 19:02:46 +09:00
Kevin Bracey b81cefb48c Sleep manager: optimise counter
No need for a critical section - can just use atomic ops.
2019-03-18 18:10:17 +02:00
Cruz Monrreal e417ad2a3a
Merge pull request #10122 from kjbracey-arm/mbed_error_warnings
mbed_error.c: fix warnings
2019-03-16 23:01:49 -05:00
David Saada eb5cef84fd Add bootloader support for the LPC55S69 board
bla
2019-03-16 00:13:40 +02:00
Kevin Bracey d40347f81e mbed_error.c: fix warnings
Correct printf formats, and avoid an unused static function warning.
2019-03-15 14:10:49 +02:00
Martin Kojtal 943254c78c
Merge pull request #9896 from kfnta/wait_us_no_usticker
wait_us without usticker
2019-03-14 09:44:25 +01:00
Mahesh Mahadevan 0aa8dc2383 Updated LOOP_SCALER value for Cortex-M33
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2019-03-08 07:33:48 -06:00