Commit Graph

399 Commits (510d743051a43e2758f5c7e8164453343d77461c)

Author SHA1 Message Date
Russ Butler 472ababfef Update deep sleep lock check in tests
When the define LPTICKER_DELAY_TICKS is set deep sleep can be randomly
disallowed when using the low power ticker. This is because a Timer
object, which locks deep sleep, is used to protect from back-to-back
writes to lp tickers which can't support that. This causes tests which
assert that deep sleep is allowed to intermittently fail.

To fix this intermittent failure this patch adds the function
sleep_manager_can_deep_sleep_test_check() which checks if deep sleep
is allowed over a duration. It updates all the tests to use
sleep_manager_can_deep_sleep_test_check() rather
than sleep_manager_can_deep_sleep() so the tests work even if deep
sleep is spuriously blocked.
2018-08-17 09:29:41 -05:00
Martin Kojtal 7a44185c1c CircularBuffer: volatile specifier removal
Volatile specifier in this case it not required as we currently have all accesses
to the buffer protected by critical section. This shall optimize accesses in
some cases to the buffer.

Fixes #7702
2018-08-08 10:11:59 +01:00
Cruz Monrreal 8292affb53
Merge pull request #7609 from bremoran/patch-2
Make location meaningful in print_error_report
2018-07-26 22:07:22 -05:00
Cruz Monrreal cc506eed14
Merge pull request #7603 from OpenNuvoton/nuvoton_override_gcc_sbrk
Nuvoton: Replace __wrap__sbrk with overriding _sbrk
2018-07-26 12:54:45 -05:00
Brendan Moran 96fbd02f8c
Make location meaningful in print_error_report
`handle_error` calls `MBED_CALLER_ADDR()`, but this is always a location from within platform/mbed_error.c. This is because `handle_error` is declared static. This does not cause the function to be inlined however. Instead, it is called by each function within mbed_error.c. For example, mbed_error yields this code:

```
000625c8 <mbed_error>:
   625c8:       b510            push    {r4, lr}
   625ca:       460c            mov     r4, r1
   625cc:       4611            mov     r1, r2
   625ce:       461a            mov     r2, r3
   625d0:       9b02            ldr     r3, [sp, #8]
   625d2:       f7ff feff       bl      623d4 <handle_error>
   625d6:       b968            cbnz    r0, 625f4 <mbed_error+0x2c>
   625d8:       4620            mov     r0, r4
   625da:       f7ff ff67       bl      624ac <print_error_report.constprop.0>
   625de:       f7ff fea8       bl      62332 <core_util_is_isr_active>
   625e2:       b910            cbnz    r0, 625ea <mbed_error+0x22>
   625e4:       f7ff fe9f       bl      62326 <core_util_are_interrupts_enabled>
   625e8:       b908            cbnz    r0, 625ee <mbed_error+0x26>
   625ea:       bf30            wfi
   625ec:       e7fd            b.n     625ea <mbed_error+0x22>
   625ee:       2001            movs    r0, #1
   625f0:       f000 f948       bl      62884 <__wrap_exit>
   625f4:       4800            ldr     r0, [pc, #0]    ; (625f8 <mbed_error+0x30>)
   625f6:       bd10            pop     {r4, pc}
   625f8:       80ff010f        .word   0x80ff010f
```

Note that at `625d2` there is a bl to handle error. That replaces the LR, which means that ALL calls to mbed_error will report a location of 0x625d6 or 0x625d7 (user vs. supervisor). I do not expect that this was the intention of the code. The simplest fix is to change line 99:

```C
static inline mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number)
```

Since `handle_error()` will be inlined, the link register will be kept the same, so `MBED_CALLER_ADDR()` will yield the expected result. However, there is no guarantee that the compiler will respect the `inline` keyword in all circumstances.

The result is that each function that wishes to report its caller must extract its caller. This code cannot be centralised.

I have modified `mbed_error.c` to report the caller of each error reporting function, rather than the error reporting function itself.
2018-07-26 16:21:17 +01:00
ccli8 313f322cf7 [Nuvoton] Replace __wrap__sbrk with overriding _sbrk
With _sbrk being weak, we can override it directly rather than #if to support heap with
two-region model.
2018-07-26 15:47:25 +08:00
Senthil Ramakrishnan 7cedccc488 Improved logic in wait_us to avoid division operation in sub-millisec case 2018-07-25 15:04:06 -05:00
Deepika b05d105493 Update stats to fetch Mbed OS version info 2018-07-13 11:58:49 -05:00
Cruz Monrreal 6fcb77ee34
Merge pull request #7434 from deepikabhavnani/version_header
Separate version header file in Mbed OS
2018-07-13 11:43:15 -05:00
Deepika 05d8c74aee Separate version header file to get version updates in Mbed OS 2018-07-11 09:41:30 -05:00
Senthil Ramakrishnan b6179d281d Remove error reporting for release builds 2018-07-06 10:15:07 -05:00
Senthil Ramakrishnan a29eee4e73 Don't print error reports in release builds 2018-07-06 09:56:34 -05:00
Senthil Ramakrishnan a443e9bb47 Fix wrong config binding 2018-07-03 14:00:46 -05:00
Cruz Monrreal 7e0f75e831
Merge pull request #7331 from TomoYamanaka/improve_bootloader
Improve the process for Cortex-A9 in mbed_application
2018-07-03 07:37:19 -05:00
Martin Kojtal ffcb6ecfb5 platform: astyle update 2018-06-29 10:38:44 +01:00
Senthil Ramakrishnan 0e25447b78 Fix error history related comments 2018-06-27 15:32:38 -05:00
TomoYamanaka 9c99d7eb17 Improve the process for Cortex-A9 in mbed_application
I added the powerdown func by GIC in mbed_application because Cortex-A9 use GIC instead of NVIC.
This process prevent unexpected interrupt when updating software by using bootloader.
2018-06-26 19:17:59 +09:00
Cruz Monrreal ea47342f81
Merge pull request #7214 from SenRamakri/sen_ErrorOptimAndConfig
Error handling configuration updates and Optimization for exception handling
2018-06-25 10:10:49 -05:00
TomoYamanaka 5c036cb1ba Add the process for Cortex-A in mbed_applicaion
I added the process for Cortex-A in mbed_application.c because this process was for only Cortex-M.
Also I enabled the macro of MBED_APPLICATION_SUPPORT for Cortex-A.
2018-06-22 10:47:23 +09:00
Senthil Ramakrishnan baa44eb3f2 Limit error filename capture to 64 chars, wrapping tests with right configs and astyle fixes. 2018-06-20 11:56:32 -05:00
Senthil Ramakrishnan cbb12e326d Updates to configuration flags used in error handling implementation.
The new configuration make Error history tracking switched off by default and enabled by using the config flag MBED_CONF_PLATFORM_ERROR_HIST_ENABLED.
Config flag MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO enables printing info of all threads. This will be turned off by default.
2018-06-20 11:56:31 -05:00
Cruz Monrreal dabb112ebd
Merge pull request #7117 from OpenNuvoton/nuvoton_fix_armc6_memtrace2
Fix compile error with MBED_MEM_TRACING_ENABLED and ARMC6
2018-06-14 10:14:46 -05:00
Cruz Monrreal 38f9519ccc
Merge pull request #6949 from OpenNuvoton/nuvoton_m23_bootloader
Support mbed_start_application for Cortex-M23
2018-06-07 10:10:46 -05:00
Martin Kojtal 4f90f4c735 error: fix undeclared memcpy
Some targets do not get string header file in, results in the warning:
implicit declaration of function 'memcpy'
2018-06-06 09:00:27 +01:00
ccli8 0597998d91 Fix compile error with MBED_MEM_TRACING_ENABLED and ARMC6 2018-06-05 17:34:28 +08:00
Cruz Monrreal 50cd664628
Merge pull request #7050 from SenRamakri/sen_ErrorHandlingFilenameFix
Fix for filename capture not working
2018-06-04 10:43:56 -05:00
Senthil Ramakrishnan 576bd61d96 Do not capture filename for release builds 2018-05-31 11:30:33 -05:00
Senthil Ramakrishnan 68e59a11b9 Fix for error report not printing when calling error API 2018-05-31 11:27:20 -05:00
Senthil Ramakrishnan 07a6ab0864 Fix for filename capture not working 2018-05-31 10:39:58 -05:00
deepikabhavnani d764a7c627 OS version is not available in code, need a fix for this in next patch release 2018-05-30 08:57:47 -05:00
ccli8 23dcd82fab Remove superfluous MOVT in mbed_start_application/start_new_application 2018-05-30 09:39:07 +08:00
ccli8 3c14cb6332 Fix mbed_start_application on Cortex-M23
1. M23 doesn't support ICTR and supports up to 240 external interrupts.
2. Fix reset of SHPR
3. Fix inline assembly compile error with ARMC6
2018-05-28 11:43:27 +08:00
Bartek Szatkowski efd307fa79 Rename new occurrences of LOWPOWERTIMER to LPTICKER 2018-05-25 12:33:43 -05:00
Senthil Ramakrishnan 92e0cbfaef Doxygen fixes 2018-05-23 13:27:57 -05:00
Senthil Ramakrishnan 5ef6728c08 Splitting MBED_ERROR macros to support ones with/without error value argument 2018-05-23 12:21:28 -05:00
Senthil Ramakrishnan 693a6c40bb Refactor error reporting 2018-05-23 12:21:11 -05:00
Senthil Ramakrishnan d4fe75731d Adding mbed prefixes to all macros and functions to avoid namespace conflicts 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan 147d9cac4e Test application/cases optimization for some low memory targets, macro changes and test fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan f9c25612ae Fix test failures when trap errors are enabled and other fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan cbfc06577b Fixes to align with naming conventions 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 92df68b1ea Changed variable names for registers to avoid namespace conflicts, build fixes, macros and other fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 530e9d323f Changed variable names for registers to avoid namespace conflicts and rtos disabled build fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 2e28dd95e1 Change set_error/set_error_fatal to warning/error, add itm support and other changes 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 7c6c718f75 Fixed entity reporting and comments 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 839fef0ad1 Added more tests for error log and error reporting, updated doxygen comments 2018-05-23 12:21:07 -05:00
Senthil Ramakrishnan 9041b475c6 Error handling/logging implementation and tests 2018-05-23 12:21:07 -05:00
Martin Kojtal 23d8085174
Merge pull request #6878 from bulislaw/rtc_lp_ticker
Add low power timer fallback for platforms without RTC
2018-05-22 14:35:18 +02:00
Martin Kojtal 5d027f4e27
Merge pull request #6857 from deepikabhavnani/cpu_stats
CPU Statistics
2018-05-22 14:30:21 +02:00
Martin Kojtal 02af950f62
Merge pull request #6336 from geky/fat-errors
fatfs: Update error code mapping
2018-05-22 14:27:01 +02:00
Cruz Monrreal a301db5d43
Merge pull request #6791 from kjbracey-arm/fcntl
Add POSIX fcntl flag support
2018-05-21 17:17:02 -05:00