Commit Graph

11304 Commits (1b7a15501c8cd5d08ccd01b408c6dedb46e5ab1c)

Author SHA1 Message Date
Vincent Coubard c678ac8f50 mbed_localtime: Add support of year day.
This field is needed by the LPC43XX targets.
2017-06-11 09:48:20 +01:00
Vincent Coubard 89beb69f89 mbed_localtime: Add support of wday.
This field is necessary, it is used by several vendor RTC: Atmel, ST, NUVOTON,
NXP.
2017-06-11 09:48:19 +01:00
Vincent Coubard 45d590669e mbed_mktime: Improve documentation for doxygen. 2017-06-11 09:48:19 +01:00
Sam Grove c5808d5e7a Rename function st_rtc_localtime with _rtc_localtime 2017-06-11 09:48:19 +01:00
Vincent Coubard f9b9bcc343 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-11 09:48:18 +01:00
Russ Butler 3931874fb5 Simplify Ameba RTC driver
The Ameba RTC driver converts time_t to
second/minute/hour/day/month/year in rtc_write and back to time_t in
rtc_read. Replace this with an implementation which uses time_t
directly.
2017-06-11 09:48:18 +01:00
Seppo Takalo 4dbb39c24a Fix compilation for NCS36510 RF driver.
RTX porting for this driver was done against the previous API that
have now been reverted.
2017-06-11 09:48:18 +01:00
Laurent MEUNIER bbd0cdb0de STM32 L0: Add Flash API support
This is the introduction of Flash API support for STM32 L0 family.
2017-06-11 09:48:18 +01:00
Laurent MEUNIER ff6029ee3d Update stm32l476rg linker scripts for bootloader
Add MBED_APP_START and MBED_APP_SIZE to the linker scripts
so the start and size of an image can be specified. This allows the
ROM to be split into a bootloader region and an application region.
2017-06-11 09:48:17 +01:00
Laurent MEUNIER 08fb31be3b Rebase of: e51c40c061
Fix vector table

The address of the vector table is hardcoded to the start of flash.
This patch updates make it properly handle updating the VTOR with
a bootloader.
2017-06-11 09:48:17 +01:00
Laurent MEUNIER a80edddf93 Enable bootloader on NUCLEO_L476RG 2017-06-11 09:48:17 +01:00
Jimmy Brisson 121b7f1361 Fix typo in tools code to handle bootloader builds
fixes a regression
2017-06-11 09:48:16 +01:00
Kevin Gilbert deb4c92338 EventQueue.h Doxygen doc fixed up. Moved overloaded callback arguments documentation to overloaded functions to fix warnings. B0..B4 were not documentated additionally, only bulk docs for a0..a4 and c0..c4 were moved around. 2017-06-11 09:48:16 +01:00
Kevin Gilbert 1906f76dd8 Removed Doxygen errors from Event.h - Removed Makefile from branch - Moved a0..a4/c0..c4 parameter documentation from top level overloaded functions to each function to appease Doxygen. - Removed @see Event::Event from overloaded functions as the link did not work and the argument parameter documentation was moved down to each function - TODO: Cleanup EventQueue.h 2017-06-11 09:48:16 +01:00
Seppo Takalo 8d2537ba9c Fix typo that used 16kB for stack.
Intend is to use 2kB for stack, not 16kB, but the divide operand
has been forgotten here.
2017-06-11 09:48:15 +01:00
Russ Butler 9fef5bbef3 Fix semaphore usage on lpc1768 emac
The semaphore xTXDCountSem had the count to match the number of
resources available, but was being used as a binary semaphore in a
loop to listen for events. This patch updates the logic to make use of
the resource count.

With RTX5 the OS traps with an error if the a semaphore is released
more times than its count with an error similar to
"Semaphore 10000e6c error -17". Because xTXDCountSem is being used
as a binary semaphore it triggered this trap. With this patch the
semaphore is no longer used as a binary semaphore and no longer traps.
2017-06-11 09:48:15 +01:00
Sam Grove 1ff08912c3 Fix doxygen warnings. 2017-06-11 09:48:15 +01:00
Jimmy Brisson 633efd795d Remove doxygen warnings in nsapi 2017-06-11 09:48:15 +01:00
Jimmy Brisson 5e8c3ac6b9 Enable doxygen for nsapi 2017-06-11 09:48:14 +01:00
Jimmy Brisson 9109b8310b Remove more warnings from doxygen config 2017-06-11 09:48:14 +01:00
Jimmy Brisson 61e03cb8c7 Check for no warnings in travis 2017-06-11 09:48:14 +01:00
Jimmy Brisson 1faf905d55 Remove warnings from doxyfile_options 2017-06-11 09:48:13 +01:00
Sam Grove 236ce19779 Remove previous docs building method and replaced by `doxygen doxyfile_options` 2017-06-11 09:48:13 +01:00
Sam Grove f9dd86dea4 Ignore doxygen builds temporay object database 2017-06-11 09:48:13 +01:00
Sam Grove 821af242a3 Update doxyfile_options that has settings used by developer.mbed.org
Should be kept in sync with doxygen_options.json which is used for
building the doxygen which is used by docs.mbed.com It is intended
only generate doxygen for specific directories which present the
public APIs for mbed OS
2017-06-11 09:48:13 +01:00
Sam Grove ec6c7ee65e Fix doxygen warnings. 2017-06-11 09:48:12 +01:00
Sam Grove 072890d962 Fix doxygen warnings. 2017-06-11 09:48:12 +01:00
Sam Grove 38d999477d Fix doxygen warnings. 2017-06-11 09:48:12 +01:00
Russ Butler a4b479233d Safely initialize RTC on kinetis devices
When initializing the RTC on Kinetis devices, handle the case where
the time overflow interrupt is pending and the case where the time
alarm flag is pending. These flags persist across reset and if not
handled will cause a crash when powering up the low power ticker.

This problem manifested as a lp_ticker test failure on the K22F and
K64F on CI only when running a nightly. This problem has been present
but was made obvious by PR #4094 which configures all tickers to
interrupt at least every MBED_TICKER_INTERRUPT_TIMESTAMP_MAX_DELTA
(~31 minutes). This caused the RTC alarm to fire 31 minutes after the lp_ticker
or lp_timeout test and caused the next run of the lp_ticker test to
crash on boot.
2017-06-11 09:48:11 +01:00
Francisco J. Manno 206e1b7634 STM32s Serial does not properly handle parity bits
Reworked the serial_format() function for STM32F0x
devices to take the format in the form:
data_bits - parity - stop_bits

E.g. 8 - N - 1

where data_bits exclude the parity bit.
Added a case for 7 bits data as at least the chips
STM32F0x1/STM32F0x2/STM32F0x8 support 7 bits data.

Consolidated serial_format() and uart_init()
functions into a general TARGET_STM serial_api.c
file since the functions are common to all STM targets.

Fixes #4189
2017-06-11 09:48:11 +01:00
Bradley Scott b1f3ef4872 STM32: Fix 32-bit us ticker interrupt scheduling
For STM32 targets using a 32-bit timer for the microsecond ticker, the
driver did not properly handle timestamps that are in the past.  It
would just blindly set the compare register to the requested timestamp,
resulting in the interrupt being serviced up to 4295 seconds late
(i.e. after the 32-bit timer counts all the way around to hit the
timestamp again).

This problem can easily be reproduced by creating a Timeout object
then calling the timeout's attach_us() member function to attach a
callback with a timeout of 0 us.  The callback will not get called for
over 2147 seconds, and possibly up to 4295 seconds late if no other
microsecond ticker events are getting scheduled in the meantime.

Now, after the compare register has been set, the timestamp is checked
against the current time to see if the timestamp is in the past, and
if so, the compare event is manually set.

NOTE: By checking if the timestamp is in the past after configuring the
capture register, we ensure proper handling in the case where the timer
updates past the timestamp while setting the capture register.
2017-06-11 09:48:11 +01:00
arostm eef244063b NUCLEO_F412ZG: Remove hal_conf file The board have to use th hal_conf file from F4/device directory 2017-06-11 09:48:10 +01:00
Laurent MEUNIER 2f80b9a28f STM32 16bits tickers: consider all corner cases in us_ticker_set_interrupt
The present commit comes from monkiineko mbed contributor.
The comments in code explains in details all the possible case and
how they are handled.
2017-06-11 09:48:10 +01:00
Laurent MEUNIER 2ab994415d STM32 16 bits ticker: fix grammar issues in comments 2017-06-11 09:48:10 +01:00
Laurent MEUNIER 070eb8de8e STM32 16 bits tickers: save useless instance init
TimMasterHandle.Instance initialization can be removed from here,
because it will either have been already done previously,
or it will be done in the us_ticker_init() call immediately below.
2017-06-11 09:48:10 +01:00
Laurent MEUNIER 1d89537610 STM32 16 bits tickers: remove unused prototype
Since rework, this prototype is not needed anymore.
2017-06-11 09:48:09 +01:00
Laurent MEUNIER 3972a34abc STM32 16 bits ticker: don't check FLAG just clear it
Not having the check will make the code more efficient.
2017-06-11 09:48:09 +01:00
Laurent MEUNIER 46d41d336f STM32 16 bits tickers, no need to check TIM_FLAG_CC1OF FLAG
Following previous fixes on 16 tickers handling, the overflow flag
condition will not happen anymore, so the work-around in place is
not needed anymore
2017-06-11 09:48:09 +01:00
Laurent MEUNIER efa1045fa6 STM32: 16 bits ticker, fixes in set function and handler
This commit simplifies ticker interrupt set function and handler.

There were issues around the 16 bits timer wrap-around timing as we were
aligning interrupts with wrap-around limits (0xFFFF) and then reading
TIM_MST->CNT again in timer_update_irq_handler which could lead
to crossing case with the wrap-around (TIM_FLAG_UPDATE) case.

Now we're using the 16 lower bits of the timestamp as the reference from
using in set_compare and never changing it. There is also no need to set
comparator again in timer_update_irq_handler. This is more robust and
also more efficient.
2017-06-11 09:48:08 +01:00
Laurent MEUNIER 23c04b7365 STM32 16bits ticker: rework us_ticker_read()
Move to a single more reliable implementation of us_ticker_read()
There were historically 2 versions of us_ticker_read() implementation.

The one removed here was not reliable because us_ticker_read() can be
called in interrupt context which means that TIM_MST->CNT would have
wrapped around while SlaveCounter is not yet updated. So there is a need
to check the TIM_FLAG_UPDATE inside this function, which was not done in
the implementation that is removed here.
2017-06-11 09:48:08 +01:00
Vincent Coubard 747b624594 utest_case.h : Fix comment indentation 2017-06-11 09:48:08 +01:00
Vincent Coubard c11d497803 utest case: Indicate explicitely that no data member shall be declared in the Case class. 2017-06-11 09:48:07 +01:00
Vincent Coubard 9d67ce2d91 utest optimization: Allow case data structure to be put in ROM.
This patch split the Case class in two entities: Case and case_t. case_t contains the test case data structure while Case provide the interface to the test case. Unlike the class Case, case _t is a POD and can be instantiated at compile time and put in the constant data section (in ROM).

The Specification class has also been modified to accept arrays of case_t.
2017-06-11 09:48:07 +01:00
Sam Grove afe80f8de6 Proper fix for 1fa30b7403
Replace #define with typedef
2017-06-11 09:48:07 +01:00
Jimmy Brisson 5a0bd97927 Fix a typo in test code
I goofed on spelling (swapped two letters). Whoops.
2017-06-11 09:48:07 +01:00
Russ Butler 91c1089b8a Fix config store deprecation warnings
Silence deprecation warnings in the config store C and C++ files. This
removes warnings that not relevant to applications. Note - using
these deprecated functions still gives an error outside of these files.
2017-06-11 09:48:06 +01:00
Russ Butler 52b767496e Fix warning about unused mutex
Move the metrics mutex into the ifdef MBED_STACK_STATS_ENABLED since
it is not used ouside of it. This fixes the warning:
[Warning] greentea_metrics.cpp@37,28: 'mutex' defined but not used [-Wunused-variable]
2017-06-11 09:48:06 +01:00
Antti Yli-Tokola 43e4ab9e55 Revert Initialize remove_from_list flag to true. * Cause regression in cloud registration 2017-06-11 09:48:06 +01:00
Antti Yli-Tokola 42ad29daf4 mbed-coap fixes. This commit includes: * Add support for sending response to duplicate messages * Add randomness for retransmission time * Fix usage sn coap blockwise max time data stored * CoAP parser option handler does not seem to handle "Option Length" completely according to spec * Handle '0' value if duplication buffer size is set through the sn_coap_protocol_set_duplicate_buffer_size() 2017-06-11 09:48:05 +01:00
Laurent MEUNIER 40f3192e00 STM32 HAL I2C fix RXNE case
As reported in issue #4214, there are seen issues seen first on
NUCLEO_F103RB in case of successive Reads of 1 byte at a time.

This issue is due to a wrong state management in the end of read sequence.
Also F1 i2c driver was not fully aligned to others, which is updated here.
2017-06-11 09:48:05 +01:00