Commit Graph

11777 Commits (mbed-os-5.5)

Author SHA1 Message Date
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
Laurent MEUNIER 01a0ba8d47 STM32 F1: Only set GPIO pin speed in case of Output mode
There were still side effects, in particular on I2C master slave test,
when setting by default the Pin Speed for F1 family. So for F1 family,
let's do it only in case of Output which is the only case where this
actually applies on this family.
2017-06-11 09:48:05 +01:00
Leon Lindenfelser 945156136c Add IAR to post_binary_hook toolchains so the boot loader is pre-pended to the binary file when using the IAR compiler. 2017-06-11 09:48:05 +01:00
hisener 294b003a35 Update CONTRIBUTING.md 2017-06-11 09:48:04 +01:00
Mahadevan Mahesh 86ad4b82a4 Issue#4250: Fix USB driver for Kinetis devices
Move memory allocation to be done at a different location. Currently allocated
in a function that is called from the interrupt handler.

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-06-11 09:48:04 +01:00
Sam Grove 92fbf2a9b3 Add versioning information to mbed OS 5.5 release branch 2017-06-04 12:03:26 -05:00
Sam Grove 40042f0b00 Merge pull request #4295 from Patater/armv8m
Update uVisor to v0.28.1
2017-06-04 11:13:58 -05:00
Jaeden Amero 3ef7845baa uVisor: Import uVisor v0.28.1 2017-06-04 14:42:00 +01:00
Niklas Hauser 9f63d3f603 uVisor: Remove process_malloc.h from uvisor-lib.h 2017-06-04 14:42:00 +01:00
Niklas Hauser 8fb74f42d2 uVisor: Wrap _memalign_r and _calloc_r 2017-06-04 14:41:59 +01:00
Jaeden Amero 778d6822bf RTX5: uVisor: Switch threads very carefully
uVisor doesn't set the PSP of the target thread. The RTOS sets the PSP
of the target thread from the target thread's TCB. However, when
interrupts of higher priority than PendSV happen between the call to
uVisor to switch boxes, and the RTOS setting PSP, the uVisor vIRQ
interrupt handler will attempt to use an invalid PSP (the PSP from
before the box and thread switch). This leads to a crash. Make box and
thread switching atomic by disabling interrupts immediately before the
box switching until immediately after the new PSP is set.
2017-06-04 14:41:59 +01:00
Sam Grove 0da63eef2b Merge pull request #4087 from geky/localfs-fslike-fix
LocalFileSystem: Repair the FileSystemLike hooks
2017-06-04 08:35:26 -05:00
Sam Grove 273f653921 Merge pull request #4438 from 0xc0170/dev_realtek
Add REALTEK_RTL8195AM to mbed-os
2017-06-04 08:34:26 -05:00
Sam Grove 1fa30b7403 Resolve conflict in builtin type names
In class MBRBlockDevice the tole32 function had used union member
names u32 and u8. The introduction of REALTEK_RTL8195AM cauesd a
conflict with type names in basic_types given they're aliased as
macros to uint32_t and uint8_t respectively.
2017-06-03 18:12:28 -05:00
Sam Grove be35b3fb81 spi: Added default spi_master_block_write implementation to REALTEK_RTL8195AM
There is an easy default implementation of spi_master_block_write that
just calls spi_master_write in a loop, so the default implementation
of spi_master_block_write has been added to all targets.
2017-06-03 17:14:11 -05:00
Yuguo Zou 3c3a9a67fe fix STRINGIFY redefining issue 2017-06-03 20:15:05 +01:00
Yuguo Zou fdea7b146c fix icf file misspelling 2017-06-03 20:15:05 +01:00
Yuguo Zou b76c8a93c5 clean up GPL license with APACHE2.0 2017-06-03 20:15:05 +01:00
Yuguo Zou 7602d2749a remove unsupported device_name 2017-06-03 20:15:05 +01:00
Yuguo Zou f71f578435 Switch to rtx2
remove rtx and switch to rtx2
2017-06-03 20:15:05 +01:00
Yuguo Zou 88d4d1d0f8 exporter coding style fix
should use space instead of tab
2017-06-03 20:15:04 +01:00
Yuguo Zou c31d5479be fix multiple i2c peripherals possible conflicting issue 2017-06-03 20:15:04 +01:00
Yuguo Zou 92ca664fda Add support for mbed exporter
(uvision, gcc_arm, iar)
2017-06-03 20:15:04 +01:00
Yuguo Zou 4eda93e760 resolve RTWInterface initialization run after error issue 2017-06-03 20:15:04 +01:00
Yuguo Zou e2891647f2 add comment for the delay in analogout_api.c
see analogout_init()
2017-06-03 20:15:04 +01:00
Yuguo Zou 0c046a4c38 improve coding style 2017-06-03 20:15:04 +01:00
Yuguo Zou 005ce58f44 cmsis5\rtx5 put NVIC vector ops in mbed_boot.c 2017-06-03 20:15:04 +01:00
Yuguo Zou e8fd5bbdf4 move archives into target specific directories 2017-06-03 20:15:03 +01:00