Commit Graph

590 Commits (6ebc5be0f06e66ea9ec0f566af6e63c3f8ca3a9f)

Author SHA1 Message Date
Kevin Bracey 500e37f3a2 mbed_error: Always print full filename if passed
Don't extract filename from the stored error - print it directly.

Use "mbed_error_puts" for both error message and filename to avoid
buffer length limits.

Switch to puts also fixes the potential problem of an error message
containing a '%' upsetting the formatter - it should have been
mbed_printf_error("%s", error_msg) in the first place.
2018-10-22 09:53:21 +03:00
Kevin Bracey 10fe32277d mbed_error: Print thread names
As part of this, don't show empty current thread info in non-RTOS
build.
2018-10-22 09:53:21 +03:00
Kevin Bracey c3d0e2c2ef mbed_error: Correct full thread info print
Casts were covering up a type mismatch.

Print the "ready" list, and remove the explicit print of the idle thread
(it should be in the ready list).
2018-10-22 09:53:21 +03:00
Kevin Bracey 25d0fbaaeb mbed_error: remove redundant memset
If we want zero-fill, strncpy does it anyway.
2018-10-22 09:53:20 +03:00
Kevin Bracey c2076b5ec4 mbed_error: Simplify read of stack pointer 2018-10-22 09:53:20 +03:00
Kevin Bracey e20edbdb46 Add mbed_error_puts
This is potentially useful for printing long strings such as filenames
from assert messages, avoiding the buffer limit inherent in
mbed_error_printf.
2018-10-22 09:53:20 +03:00
Cruz Monrreal II 1c1432e8e7 Merge branch 'kegilbert-patch-6-1' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-18 20:01:36 -05:00
Amanda Butler 1f9ef36483
Edit DirHandle.h
Edit for active voice.
2018-10-18 11:11:03 -05:00
Cruz Monrreal e698f0b29f
Merge pull request #8076 from kjbracey-arm/error_stderr
Error output improvements
2018-10-18 08:39:17 -05:00
Cruz Monrreal ad6ada014a
Merge pull request #7948 from kegilbert/mbed_mem_trace_log_toggle
Add enable/disable cb function in mem_trace
2018-10-18 08:38:26 -05:00
Amanda Butler 7d604fedf8 Fix typo in DirHandle.md
Add "s" for agreement.
2018-10-17 22:42:28 -05:00
Kevin Gilbert 6b3bf28d0d Move inline code snippets to code blocks 2018-10-17 22:42:19 -05:00
Cruz Monrreal II 2a68339867 Merge branch 'typo-patch-underlying-1' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:45 -05:00
Cruz Monrreal II 9000821b4d Merge branch 'kegilbert-patch-2' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:44 -05:00
Cruz Monrreal II 3d753290c7 Merge branch 'cb_doxytypo_patch' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:42 -05:00
Cruz Monrreal II ecd109e0be Merge branch 'kegilbert-patch-3' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:41 -05:00
Cruz Monrreal II f8997fa1a4 Merge branch 'kegilbert-patch-4' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:40 -05:00
Cruz Monrreal II ae28c74690 Merge branch 'kegilbert-patch-5' of ssh://github.com/ARMmbed/mbed-os into rollup 2018-10-17 21:38:38 -05:00
Cruz Monrreal 1a6d2f6513
Merge pull request #8451 from korjaa/fix_possible_filebase_deadlock
Added missing _mutex->unlock() to FileBase::lookup().
2018-10-17 17:40:29 -05:00
Amanda Butler 3a8919b22d
Copy edit FileHandle.h
Copy edit file.
2018-10-17 17:26:27 -05:00
Kevin Gilbert 7709b24b29
api->API
Minor doxygen update, uppercase acronym
2018-10-17 17:20:10 -05:00
kegilbert 2d910cd8e7 Infered->Inferred
Signiture->Signature
2018-10-17 17:13:36 -05:00
Amanda Butler 048614638e
Copy edit mbed_rtc_time.h
Copy edit existing text.
2018-10-17 17:07:05 -05:00
Kevin Gilbert 3794fe5b6c
funtion->function
Minor doxygen typo patch
2018-10-17 17:01:48 -05:00
Kevin Gilbert 69e763e254
Minor mbed_assert doxy typos patch 2018-10-17 16:59:07 -05:00
Kevin Gilbert 3a04e6ae78
locable->lockable
Minor doxygen comment typo patch
2018-10-17 16:54:32 -05:00
Kevin Gilbert d24f10e50e
Remove extra e in deepsleep 2018-10-17 16:44:15 -05:00
Kevin Gilbert 435f4724e0
underlyng->underlying 2018-10-17 12:23:35 -05:00
Cruz Monrreal 7085d16661
Merge pull request #8354 from kjbracey-arm/singletonptr_align
SingletonPtr: const and alignment
2018-10-17 08:35:12 -05:00
Jaakko Korhonen 4efec08127 Added missing _mutex->unlock() to FileBase::lookup(). 2018-10-17 14:07:09 +03:00
Kevin Bracey 2df322c43d Don't overrun in error prints
vsprintf returns the amount it would have written if the buffer had been
big enough, but we used that value directly when outputting, thus
overrunning memory and dumping stack contents.

Indicate truncation by inserting an ellipsis and newline. Slightly
increase the buffer size, so that we don't slightly decrease the maximum
printable characters because of the ellipsis insertion.

Partially addresses https://github.com/ARMmbed/mbed-os/issues/6850 by
forcing a newline when truncation happens - often truncation will drop a
newline and prevent a flush.
2018-10-17 12:55:20 +03:00
Kevin Bracey c989845d5a mbed_error_vfprintf -> mbed_error_vprintf
Name vfprintf doesn't make sense - if we have mbed_error_printf, this is
vprintf.
2018-10-17 12:55:20 +03:00
Kevin Bracey d05c60ee3f Sync output devices on exit
Mbed retarget does an `fflush` on stdout and stderr on exit - this
flushes the C library buffers (if it is buffering), but doesn't
flush any device buffers (eg UARTSerial's TX buffer). Add
sync() calls to the output device to do this.
2018-10-17 12:55:20 +03:00
Kevin Bracey 78f4b4bc82 Make mbed_error not serial-specific
Use write() on current output device instead - this works on the
assumption that write() is safe to call from critical section.

UARTSerial has previously been upgraded to support this, and this also
improves the behaviour when buffered serial is in use - the current
buffered output will be fully flushed before outputting the error
message.
2018-10-17 12:55:20 +03:00
Cruz Monrreal ce7e61e37e
Merge pull request #8255 from MateuszMaz/refactoring_mbed_assert
Change behaviour of mbed_asert to use mbed_error instead of mbed_die
2018-10-16 11:06:18 -05:00
Kevin Bracey e7815c64ad Align SingletonPtr data to 8 bytes, or use C++11
Be more cautious about alignment - align the data within a SingletonPtr
to 8 bytes rather than 4. This could increase padding overhead by up
to 8 bytes, sadly, but we may need this alignment for correct operation.

Conditional check added for C++11 - if in use we can get correct minimal
alignment by using alignas(T).
2018-10-16 13:32:52 +03:00
Deepika 1d23843833 Platform: Add required header file and namespace element instead add all 2018-10-15 10:39:41 -05:00
deepikabhavnani f55b929de9 ATCmdParser: Added namespace std for va_list 2018-10-15 10:39:41 -05:00
Cruz Monrreal ec03df4823
Merge pull request #7980 from kjbracey-arm/thread_deprecations
Clean up rtos::Thread deprecation warnings
2018-10-15 10:09:55 -05:00
Cruz Monrreal e0e915f5db
Merge pull request #8423 from cmonr/rollup2
Rollup PR: Additional doc PRs + lingering need:CI PRs
2018-10-15 10:04:04 -05:00
Cruz Monrreal II a51b0a3562 Merge branch 'atcmd_docs' of ssh://github.com/deepikabhavnani/mbed-os into deepikabhavnani-atcmd_docs 2018-10-12 21:46:59 -05:00
Cruz Monrreal II d0aec14124 Merge branch 'typo-fix-1-1' of ssh://github.com/ARMmbed/mbed-os into ARMmbed-typo-fix-1-1 2018-10-12 21:46:51 -05:00
Cruz Monrreal II 2f6aa3331f Merge branch 'heap_fix_7912' of ssh://github.com/deepikabhavnani/mbed-os into deepikabhavnani-heap_fix_7912 2018-10-12 21:46:27 -05:00
Amanda Butler 5b22304300
Edit ATCmdParser.md
Make minor grammar and spelling edits.
2018-10-12 17:16:09 -05:00
deepikabhavnani 92108858f5 Doc changes and rephrasing 2018-10-12 17:09:31 -05:00
Amanda Butler 00186e6f14
Copy edit mbed_rtc_time.h
Copy edit existing text for U.S. spelling and consistent capitalization.
2018-10-12 14:50:52 -05:00
Kevin Gilbert a9dbd728f6
wich->which 2018-10-12 13:52:23 -05:00
Cruz Monrreal II 8bb21afbf0 Merge branch 'sen_ErrorDoxyUpdate' of ssh://github.com/SenRamakri/mbed-os into SenRamakri-sen_ErrorDoxyUpdate 2018-10-12 12:07:28 -05:00
Cruz Monrreal II b7ef70dea4 Merge branch 'update_stats_docs' of ssh://github.com/bridadan/mbed into bridadan-update_stats_docs 2018-10-12 12:07:23 -05:00
Cruz Monrreal II 828b6f506a Merge branch 'sen_MemTraceDoxyUpdate' of ssh://github.com/SenRamakri/mbed-os into SenRamakri-sen_MemTraceDoxyUpdate 2018-10-12 12:07:21 -05:00
Cruz Monrreal II 98a9bb880b Merge branch 'fhtidy_doc' of ssh://github.com/kjbracey-arm/mbed-os into kjbracey-arm-fhtidy_doc 2018-10-12 12:07:07 -05:00
Senthil Ramakrishnan e547e3d88d Fix doxygen comments and spelling errors 2018-10-12 11:49:58 -05:00
Amanda Butler 9eab32e365
Copy edit changes to mbed_mem_trace.h
Delete extra spaces.
2018-10-12 11:13:31 -05:00
Amanda Butler 82c4ce607d
Edit mbed_stats.h
Capitalize ID for consistency.
2018-10-12 11:08:01 -05:00
Cruz Monrreal 6d7b655b87
Merge pull request #8331 from deepikabhavnani/getc_fix
Stream: add necessary flushes, removing unneeded IAR workaround
2018-10-12 08:59:16 -05:00
Kevin Bracey 1ef213ec89 Clean up Thread deprecation warnings
Static Thread methods and signal methods have been deprecated. Remove
all references in the main code, and most of the tests. Some tests of
the deprecated APIs themselves remain.
2018-10-12 14:57:13 +03:00
Brian Daniels ddedc155d4 Updating stats doc comments 2018-10-11 19:11:17 -05:00
Senthil Ramakrishnan 026c978515 Adding doxygen comments for mem trace enum 2018-10-11 16:58:47 -05:00
MateuszMaz e6ae3d2c51 Remove stray error_value 2018-10-09 18:49:47 +02:00
Filip Jagodzinski 9dce8b3ab5 HAL: SleepManager: Update header file
Move sleep manager API into its own doxygen group.
Add defined behavior section and links to tests.
2018-10-09 17:52:42 +02:00
Kevin Bracey 199d1667ff Make SingletonPtr methods const
Make get() and operators * and -> of SingletonPtr const - they are
logically const and thread-safe, despite the construction on first call.
This construction is "invisible" to the caller of those methods.
2018-10-09 18:08:05 +03:00
kegilbert eeada14721 Add enable/disable cb function in mem_trace 2018-10-08 11:50:10 -05:00
MateuszMaz cf43e1cb5c Fix message string 2018-10-08 18:41:50 +02:00
Cruz Monrreal f529dc799e
Merge pull request #8001 from kjbracey-arm/singletonptr_star
Add * operator to SingletonPtr
2018-10-08 10:25:46 -05:00
deepikabhavnani 0e758796f6 Signature to track memory allocations by wrapper functions.
Compilers allocate some section of memory without using wrapper function,
which is later freed when wrappers were initialized. Since the allocated
memory didn;t contain wrapper header the pointer got corrupt when calling to free.

This implementation of signature addition during malloc and signature check during
free helps in freeing the memory allocated by wrapper functions properly and
also the internal memory allocated by compilers (without malloc wrappers).
2018-10-08 07:45:01 -05:00
Deepika 6646323867 Alignment of 8 is not required for additional header
malloc guarantees aligned memory. If we add an alignment here, we are adding
additonal unused 4 bytes. Each allocator has its own 4/8 byte header
(GGC / ARM have 4 bytes).

So if user request for 8 bytes of memory stats will add 8 + allocator 8.
However if we remove the alignment in stats header, allocator will consider
add 4 bytes to 12 byte request and zero padding.

It will be beneficial to leave the padding to allocator.
2018-10-08 07:37:54 -05:00
Martin Kojtal 4fbd39c74e
Merge pull request #8108 from c1728p9/systick_rename
Rename device option STCLK_OFF_DURING_SLEEP
2018-10-06 07:46:49 +02:00
Deepika f79a354311 Replace fflush to fseek before writes
You are allowed in POSIX / ANSI C to read and write on the same stream, but you
have to do an fseek in between read and write call (getc->fseek->putc)

Thanks @Alex-EEE for sharing the fix: https://github.com/ARMmbed/mbed-os/pull/7749

Added test case for verification of the behavior
2018-10-05 14:29:15 -05:00
MateuszMaz 63d3a32894 Remove empty line 2018-10-05 21:25:28 +02:00
MateuszMaz 845655b621 Add case MBED_ERROR_CODE_ASSERTION_FAILED, fix names, pass expr to mbed_error 2018-10-05 21:15:03 +02:00
MateuszMaz a2f3c59768 Add ASSERTATION_FAILED error code 2018-10-04 20:47:16 +02:00
paul-szczepanek-arm 05a4337490 make it backwards compatible 2018-10-04 16:12:26 +01:00
paul-szczepanek-arm 3a408eb85a fix missing namespace mbed 2018-10-04 15:51:01 +01:00
deepikabhavnani 5f5882830f Add `overhead_size` element to get the overhead of stats
Heap statistics are used for analysing heap stats, but it doesn't tell anything
about real heap usage or malloc overheads. Adding `overhead_size` element
will help users to get the real heap usage.
2018-10-03 16:41:24 -05:00
Cruz Monrreal 4403a561b3
Merge pull request #7890 from deepikabhavnani/cb_issue_7701
Circular buffer should use conditional statement instead of modulo
2018-09-27 10:20:05 -05:00
MateuszM c3e7ddbb10 Changed behaviour of mbed_asert to use mbed_error instead of mbed_die. 2018-09-26 11:08:54 +02:00
Martin Kojtal ac6ca73dd8
Merge pull request #8165 from mprse/issue_8155_fix
Fix for issue #8155 (NRF52832: time stops after 35 minutes)
2018-09-24 12:59:22 +02:00
Martin Kojtal 9506f50112
Merge pull request #8036 from TeroJaasko/fix_mbed_error_c_memsets
platform: error: fix bogus usage of memset()
2018-09-24 08:23:02 +02:00
Cruz Monrreal 1a638c7870
Merge pull request #8106 from c1728p9/macros_to_config
Replace macros with config options
2018-09-22 16:40:53 -05:00
Martin Kojtal 3d94fb889b
Merge pull request #7903 from tkem/fix/cleanup-include-paths
Clean up include paths.
2018-09-19 12:16:09 +02:00
Kevin Bracey 1492829f82 poll: Un-doxygen internal comment 2018-09-18 12:40:03 +03:00
Przemyslaw Stekiel 814940cabe Fix for issue #8155 (NRF52832: time stops after 35 minutes)
Low power Timer is used as RTC for platforms that don't have HW RTC capabilities (like NRF52832).
`_rtc_lpticker_read(void)` function currently uses `Timer::read()` function to trace elapsed time.
`Timer::read()` returns seconds represented as `float` value, but this value is calculated from `int` since `Timer::read_us()` returns `int`.
This limits time tracing to ~35 min.
To fix this problem we will use `timer::read_high_resolution_us()` (which returns unsigned 64 bit value) instead of `Timer::read()`.
2018-09-18 09:48:53 +02:00
Cruz Monrreal 3da606e586
Merge pull request #8017 from TTornblom/master
IAR: Fix for #7662, only massage the error decode URL for the IAR .xcl
2018-09-17 19:46:12 -05:00
Russ Butler ab50681c33 Rename device option STCLK_OFF_DURING_SLEEP
Rename STCLK_OFF_DURING_SLEEP to SYSTICK_CLK_OFF_DURING_SLEEP to avoid
confusion with the STmicroelectronics.
2018-09-12 14:40:25 -05:00
Russ Butler b9b4b8ada6 Replace macros with config options
Add a config option for the following values:
MBED_SYS_STATS_ENABLED
MBED_STACK_STATS_ENABLED
MBED_CPU_STATS_ENABLED
MBED_HEAP_STATS_ENABLED
MBED_THREAD_STATS_ENABLED
MBED_CONF_APP_MAIN_STACK_SIZE
MBED_CONF_APP_TIMER_THREAD_STACK_SIZE
MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
MBED_CONF_APP_THREAD_STACK_SIZE

To maintain backwards compatibility inside the RTOS both
APP and RTOS config values can be used.
2018-09-12 13:59:46 -05:00
Kevin Bracey eaddf0a160 FileBase: Fix unsetting of default when destroyed
Code that should unset a FileBase from being the default when it is
destroyed was broken by a `==` instead of `=` typo.
2018-09-10 11:20:36 +03:00
Tero Jääskö 321548cadc platform: error: fix bogus usage of memset()
Code had mixed up order of 'c' and 'n' arguments to memset().
Fix this.

Spotted-by: kjbracey-arm & a GCC profile without "-fno-builtin"

Related GCC warnings:
---8<---8<----
[Warning] mbed_error.c@123,5: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
[Warning] mbed_error.c@282,5: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
2018-09-07 15:40:44 +03:00
TTornblom 0d97803ad8 IAR: Fix for #7662, only massage the error decode URL for the IAR .xcl
file.
2018-09-06 12:16:15 +02:00
Kevin Bracey 390f6e7a7b Add * operator to SingletonPtr
Sometimes you want don't want to directly call a method on your
SingletonPtr-wrapped object, but you want to pass it to something
else.

For example

    SingletonPtr<PlatformMutex> mutex;
    mutex->lock();

is fine, but what about

    SingletonPtr<PlatformMutex> mutex;
    ScopedLock<PlatformMutex> lock(*mutex.get());

Add an overload for operator* to make this more elegant:

    SingletonPtr<PlatformMutex> mutex;
    ScopedLock<PlatformMutex> lock(*mutex);

This addition is consistent with standard C++ classes such as
`unique_ptr` and `shared_ptr`, which likewise have
get, operator-> and operator*.
2018-09-05 18:15:47 +03:00
Kevin Bracey a67f09851b Add special handling for "/default" filesystem
Allow a FileBase (normally a FileSystemLike) to be set as the default,
so it can be looked up as "/default" as well as its actual name.
2018-09-05 13:28:42 +03:00
Cruz Monrreal 83e0e65a42
Merge pull request #7726 from SenRamakri/sen_BLE_ErrorUpdate
Update BLE error calls to use new error codes and mbed_error
2018-09-02 20:47:40 -05:00
Cruz Monrreal f82feecc51
Merge pull request #7822 from donatieng/nfc-impl
Add initial NFC support to Mbed OS
2018-08-31 19:01:25 -05:00
Cruz Monrreal a849fa46df
Merge pull request #7662 from SenRamakri/sen_ErrorUrl
Add Error Decoding URL to error report
2018-08-31 18:27:30 -05:00
Cruz Monrreal 88eb8aab23
Merge pull request #7794 from c1728p9/boot_overhaul
Update Mbed 5 boot sequence
2018-08-30 10:22:15 -05:00
Senthil Ramakrishnan e84e56bc8d Add Error Decoding URL in error report 2018-08-30 12:19:59 +01:00
Vincent Coubard 913f219fc1 Span: Fix type used in is_convertible traits. 2018-08-29 19:42:46 +01:00
Thomas Kemmer a16c374725 Clean up include paths. 2018-08-27 20:47:19 +02:00
Cruz Monrreal 1b051c7687
Merge pull request #7402 from kegilbert/mem-tracing-config-patch
Replace mbed_mem_tracing_enabled macro with config option
2018-08-27 10:34:24 -05:00
Cruz Monrreal c12c69fef0
Merge pull request #7828 from pan-/span
Platform: Add C++ Span class.
2018-08-27 10:28:59 -05:00
Deepika 4e263b17b9 Refactor circular buffer test to platform folder 2018-08-27 09:33:07 -05:00