Commit Graph

1293 Commits (b8a18e29bd843821c9cd41fdf6dd573a7426ab94)

Author SHA1 Message Date
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
Brendan McDonnell c4f10aafee typos 2018-02-20 20:11:19 -05:00
Cruz Monrreal 0ceecb946d
Merge pull request #5956 from marcuschangarm/feature-hal-swo
[feature-hal-itm] Instrumented Trace Macrocell HAL API for SWO debug output
2018-02-16 16:08:12 -06:00
Marcus Chang bbf92fdf0d Instrumented Trace Macrocell (ITM) HAL API
HAL API for initializing the ITM and setting SWO debug output.
Actual debug output implemented as SWO FileHandle.
2018-02-16 08:24:31 -08:00
Przemyslaw Stekiel c2760be01c Fix for issue #6054 - interrupts scheduled in the past.
When ticker is not driven by the 1 MHz clock and HAL driver need to perform conversion between microseconds and ticks, then the interrupt might be scheduled in the past. For details see: https://github.com/ARMmbed/mbed-os/issues/6054.

This patch provides fix for such case. Interrupt is fired immidiatelly when last read tick is equal to the calculated tick when interrupt should be generated.
2018-02-15 12:30:24 +00:00
Przemyslaw Stekiel 6d3ba94f98 Provide fix for issue #5835 - Tickers update should be atomic
Synchronise only (and all) the public functions.
2018-01-22 13:29:31 +01:00
Steven Cartmell 061795c489 Move in_critical_section implementation into the HAL
- Add function to HAL hal_in_critical_section()
- Wrap assert in FEATURE_UVISOR macro
2018-01-09 10:41:29 +00:00
Steven Cartmell 04d2f3de78 Amend critical section function descriptions 2018-01-05 14:55:58 +00:00
Steven Cartmell e14bee5209 Fix potential race condition in critical section HAL API
Call underlying HAL implementation to enter critical section/disable interrupts
before incrementing the global critical section counter.

Modify HAL implementations to track first entrances to the critical section and
only update the saved state on first enter.
2018-01-05 14:55:58 +00:00
Steven Cartmell a07c07fa63 Update HAL API header information 2018-01-05 14:55:57 +00:00
Steven Cartmell 84391f0b64 Remove invalid assert and move uVisor warning to correct function 2018-01-05 14:55:57 +00:00
Steven Cartmell 07a394ee8b Add Critical Section HAL API specification
- Define header functions for Critical Section HAL API
  - hal_critical_section_enter()
  - hal_critical_section_exit()

- Add weak default implementation for HAL API. The default implementation
  matches the previous behaviour stored in mbed_critical:
  - The first call to enter a critical section stores the state of interrupts
    before disabling and each successive call re-disables interrupts.
  - The last call (non-nested) will restore the IRQ state that was set on the
    enter to the critical section. Nested calls are ignored.

- Add function 'core_util_in_critical_section' to User facing API to determine
  if the program is currently in a critical section, instead of depending on
  'core_util_interrupts_enabled'.
2018-01-05 14:53:51 +00:00
Przemyslaw Stekiel 5da5b28f96 Add API to set ticker IRQ handler.
This API is added primarily for testing purposes, to be able to test HAL drivers without using upper layers to handle ticker interrupt.
By default IRQ handler is set to ticker_irq_handler() for us ticker and lp ticker - original one.

Usage example (setting custom ticker irq handler):

void my_irq_handler(const ticker_data_t *const) {
 // handle interrupt
}

ticker_irq_handler_type old_handler = set_us_ticker_irq_handler(my_irq_handler);

Respectively for lp timer set_lp_ticker_irq_handler() API should be used.
2017-10-30 10:38:38 +01:00
Jimmy Brisson fad67559ae Merge pull request #5028 from c1728p9/ticker_api_changes
Update ticker to map closely to hardware
2017-10-13 09:18:02 -05:00
Jimmy Brisson 8beedcef83 Merge pull request #5019 from fkjagodzinski/fix-ticker_API_docs
Fix an incorrect comment in ticker API
2017-10-09 11:11:36 -05:00
Russ Butler 0d3714e9b7 Optimize 1MHz and 32KHz use cases
Add optimizations for the most common use cases of the
us ticker, 1MHz,  and the lp ticker, 32KHz.
2017-10-05 11:57:13 -05:00
Russ Butler ec55b82acf Update ticker to map closely to hardware
Allow tickers to specify their native frequency and number of bits.
This allows the conversion to happen in common code rather than in
each vendor's implementation.
2017-10-05 11:57:12 -05:00
Russ Butler 8183749948 Initialize the HAL ticker on first read
Initialize the ticker on the first call to ticker_read* if the
ticker has not been initialized already.
2017-09-29 09:18:58 +01:00
Martin Kojtal 26f9144c45 Merge pull request #5000 from 0xc0170/fix_flash_page_doc
flash: add note about program size
2017-09-22 11:28:54 +01:00
Martin Kojtal fcdb04351f Sleep: add deepsleep locks for !DEVICE_SLEEP
If a target do not support sleep (no DEVICE_SLEEP defined),
we provide empty deep sleep locking.
2017-09-07 15:35:04 +01:00
Martin Kojtal cb4e9b32a2 Sleep HAL: add sleep manager API
Sleep manager provides API to lock/unlock deepsleep. This API allows a user to
control deep sleep.

This API should be done via atomic operations (to be IRQ/thread safe).
2017-09-07 15:34:47 +01:00
Martin Kojtal 3f58d3ef48 flash: add note about program size
Program size - the writable page size that flash controller supports.
Plus fix program page description - multiple pages program
2017-09-06 07:54:18 +01:00
Filip Jagodzinski b1ff37cdee HAL: ticker_api: Fix outdated comment 2017-09-05 13:31:12 +02:00
Russ Butler 026df0b7cd Turn on doxygen for DEVICE_* features
Enable doxygen for all device features. Also fix the warnings that
showed up once this was enabled.
2017-08-11 15:47:44 -05:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
Deepika fd43405ffe Allow user to set dummy tranfer byte for block read 2017-07-11 15:46:32 -05:00
Marcus Chang abca2ca48b FlashIAP: Add explicit read function to flash_api.h
On some platforms, the in-application memory is not memory mapped
and therefore cannot be accessed using memcpy.

The flash_read function added to flash_api.h (with a weak
implementation using memcpy in mbed_flash_api.c) can be used for
reading data from areas that are not memory mapped.
2017-07-06 18:53:32 +01:00
Sam Grove 8e76bf6da6 Merge pull request #4508 from kegilbert/kg-doxygen-framework-hal-rtos
Doxygen combined HAL, RTOS, and features/Framework updates to not produce warnings and errors [DOC Changes Only]
2017-06-08 23:52:33 -05:00
Deepika 6478e88808 Fix doxygen warnings in 'drivers' 2017-06-08 15:53:53 -05:00
Kevin Gilbert 7e2e80588d Removed bad \ref tag, but left in the tag name. Updated old param names in gpio_api.h and added new params in ticker_api.h 2017-06-08 15:52:31 -05:00
Sam Grove fa0cd205a2 Merge pull request #4094 from pan-/fix_hal_ticker
[HAL] Add support for 64 bit us timestamp
2017-06-01 23:25:26 -05:00
Martin Kojtal e229a49182 Merge pull request #4207 from geky/spi-remove-byte-locking
spi: Add SPI block-write to C++ and HAL for performance
2017-06-01 14:03:36 +02:00
Russ Butler 58041a215d Deprecate config store and related libraries
Deprecate configuration-store, flash-journal and
storage-volume-manager for the 5.5 release. Also disable the
storage tests.
2017-05-31 12:08:11 -05:00
Christopher Haster 31bf0d5099 spi: Added block-level SPI writes at the HAL level
Poking the block-level SPI writes through the HAL level gives more
freedom to targets to improve SPI transaction speed.
2017-05-25 12:04:58 -05:00
Vincent Coubard ab09a1722f ticker api: Schedule immediately event in the past. 2017-05-16 10:37:35 +01:00
Vincent Coubard aeffd738c7 ticker_api: Code clarification
* update_interrupt renamed into schedule_interrupt
* update_current_timestamp renamed into update_present_time
* ticker_event_queue_t::timestamp renamed into
* ticker_event_queue_t::present_time
* Fix doxygen comments in ticker_api.h
* Update comments internal comments in mbed_ticker_api.c
2017-05-16 10:37:35 +01:00
Vincent Coubard c20a1ccd4f ticker api: format code to meet mbed standards. 2017-05-16 10:37:35 +01:00
Vincent Coubard e119357822 [HAL] Ensure us_ticker and lp_ticker queue are correctly initialized. 2017-05-16 10:35:11 +01:00
Vincent Coubard 1057720114 [HAL] Add support of 64 bits timestamp in ticker API implementation. 2017-05-16 10:35:11 +01:00
Vincent Coubard 20149dfcf5 [HAL] Ad primitives for long lived timestamp to the ticker API.
- A new 64 timestamp type has been added: us_timestamp_t.
- Changed type of timestamp in ticker_events iinto us_timestamp_t.
- Event queue now have a to store a current, absolute timestamp.
- Add alternative versions of ticker_insert_event and ticker_read which accept
  in input us_timestamp_t.
- Add documentation explaining the limitation and behavior of ticker_read and
  ticker_insert_event.
2017-05-16 10:35:11 +01:00
adustm f740d2f3bc Add an mbed API that allows the initialization of the CAN at the correct
CAN bus frequency
2017-05-15 14:14:26 +02:00
mjrgh 094d9ac909 Fix crash with events in the past
ticker_insert_event() can crash on KLXX (and probably other platforms) if an event is inserted with a timestamp before the current real time.  

The problem is easy to trigger:  you just need to set up a Ticker object, and then disable interrupts for slightly longer than the Ticker object's interval.  It's generally bad practice to disable interrupts for too long, but there are some cases where it's unavoidable, and anyway it would be better for the core library function not to crash.  The case where I had an unavoidably long interrupts-off interval was writing flash with the FTFA.  The FTFA hardware prohibits flash reads while an FTFA command is in progress, so interrupts must be disabled for the whole duration of each command to ensure that there are no instruction fetches from flash-resident ISRs in the course of the execution.  An FTFA "erase sector" command takes a fairly long time (milliseconds), and I have a fairly high frequency Ticker (1ms).

The problem and the fix are pretty straightforward.  ticker_insert_event() searches the linked list to figure out where to insert the new event, looking for a spot earlier than any event currently queued.  If the event is in the past, it'll usually end up at the head of the list.  When the routine sees that the new event belongs at the head of the list, it calls data->interface->set_interrupt() to schedule the interrupt for the event, since it's the new soonest event.  The KLXX version of us_ticker_set_interrupt() then looks to see if the event is in the past, which we've stipulated that it is, so rather than actually setting the interrupt, it simply calls the handler directly.  The first thing the Ticker interrupt handler does is re-schedule itself, so we re-enter ticker_insert_event() at this point.  This is where the problem comes in:  we didn't finish updating the linked list before we called set_interrupt() and thus before we recursed back into ticker_insert_event().  We set the head of the list to the new event but we didn't set the new event's 'next' pointer.

The fix is simply to finish updating the list before we call set_interrupt(), which we can do by moving the obj->next initialization ahead of the head pointer update.
2017-03-21 12:02:33 -07:00
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
0xc0170 bae0f97bc9 flash: add flash algo common layer
If target supports flash algo, it can get common HAL implementation, providing
feature "HAL_FLASH_CMSIS_ALGO". This simplifies target code, and having
one implementation that can be shared by many targets.

Be careful with flash cmsis algo, in some cases they execute code that
can affect the system. For instance, it can disable cache, or affect
some system clocks. Therefore this feature should be well tested.
2017-02-21 14:08:33 -06:00
0xc0170 fdfb82030c hal: add flash hal api
Add a flash api with functions to erase and program. The api also
includes functions to query flash start, flash size, page size and
sector size.
2017-02-21 14:08:09 -06:00
Bartek Szatkowski 6a045a49a9 Platform: Add sleep/deepsleep user facing functions
Add sleep/deepsleep functions to platform layer which are replacing HAL
functions with the same name, rename existing symbols in HAL layer
to hal_sleep/hal_deepsleep. This way sleep functions
are always available, even if target doesn't implement them, which makes
the code using sleep clearer. It also enables us to make decision on in
which builds (debug/release) the sleep will be enabled.
2017-01-19 09:39:29 +00:00
Martin Kojtal 72b1fa71b5 Merge pull request #3301 from 0xc0170/fix_issue#2725
I2C - correct return values for write functions (docs) - part 1
2016-12-02 15:47:08 +01:00
0xc0170 11d6f388d2 I2C - correct return values for write functions
The correction was made based on the i2c hal, and some target implementations
(early implementations like nxp 1768, freescale KLXX).
2016-11-21 11:26:02 +00:00
Christopher Haster b09ca768b6 Moved emac_api.h to the appropriate folder
Previously in hal/hal/emac_api.h, the emac_api must have
been missed during restructuring
2016-11-17 13:52:42 -06:00
Martin Kojtal f8b682c943 lwip-interface: fix issue #2993
DEVICE_ are passed as command line -D, thus no inclusion is required.
``platform.h`` is C++ header file, should not be pulled in C files
2016-10-13 11:42:31 +01:00
Sam Grove 3a16ca9855 Merge pull request #2911 from theotherjimmy/docs-generation
[Tools] Add documentation generation script
2016-10-06 15:57:08 -05:00
Jimmy Brisson f1a78027d3 Add tags to our code 2016-10-04 15:02:44 -05:00
Christopher Haster 5cd2d7869e Merge remote-tracking branch 'upstream/master' into feature_wifi_ublox_merge 2016-10-02 07:29:07 -05:00
Christopher Haster 13bf0bd470 Merge commit 'upstream/master~' into feature_wifi_ublox 2016-10-02 06:35:12 -05:00
Martin Kojtal 3f66a62f87 UBLOX_C029: remove emac implementation
It depends on the driver that will come separately, therefore this will be
enabled once driver is in place.
2016-10-01 19:35:10 +01:00
Sam Grove 301b77c4b2 For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
Sam Grove b7fcfd93d8 Move can_helper.h into hal/ given its a requirement of the can c hal. 2016-10-01 01:44:08 -05:00
Christopher Haster 15904b7544 restructure - Split hal into drivers+platform+hal
hal/common/AnalogIn.cpp -> drivers/AnalogIn.cpp
hal/api/AnalogIn.h -> drivers/AnalogIn.h
hal/api/AnalogOut.h -> drivers/AnalogOut.h
hal/common/BusIn.cpp -> drivers/BusIn.cpp
hal/api/BusIn.h -> drivers/BusIn.h
hal/common/BusInOut.cpp -> drivers/BusInOut.cpp
hal/api/BusInOut.h -> drivers/BusInOut.h
hal/common/BusOut.cpp -> drivers/BusOut.cpp
hal/api/BusOut.h -> drivers/BusOut.h
hal/common/CAN.cpp -> drivers/CAN.cpp
hal/api/CAN.h -> drivers/CAN.h
hal/api/CircularBuffer.h -> drivers/CircularBuffer.h
hal/api/DigitalIn.h -> drivers/DigitalIn.h
hal/api/DigitalInOut.h -> drivers/DigitalInOut.h
hal/api/DigitalOut.h -> drivers/DigitalOut.h
hal/api/DirHandle.h -> drivers/DirHandle.h
hal/common/Ethernet.cpp -> drivers/Ethernet.cpp
hal/api/Ethernet.h -> drivers/Ethernet.h
hal/common/FileBase.cpp -> drivers/FileBase.cpp
hal/api/FileBase.h -> drivers/FileBase.h
hal/api/FileHandle.h -> drivers/FileHandle.h
hal/common/FileLike.cpp -> drivers/FileLike.cpp
hal/api/FileLike.h -> drivers/FileLike.h
hal/common/FilePath.cpp -> drivers/FilePath.cpp
hal/api/FilePath.h -> drivers/FilePath.h
hal/common/FileSystemLike.cpp -> drivers/FileSystemLike.cpp
hal/api/FileSystemLike.h -> drivers/FileSystemLike.h
hal/common/I2C.cpp -> drivers/I2C.cpp
hal/api/I2C.h -> drivers/I2C.h
hal/common/I2CSlave.cpp -> drivers/I2CSlave.cpp
hal/api/I2CSlave.h -> drivers/I2CSlave.h
hal/common/InterruptIn.cpp -> drivers/InterruptIn.cpp
hal/api/InterruptIn.h -> drivers/InterruptIn.h
hal/common/InterruptManager.cpp -> drivers/InterruptManager.cpp
hal/api/InterruptManager.h -> drivers/InterruptManager.h
hal/common/LocalFileSystem.cpp -> drivers/LocalFileSystem.cpp
hal/api/LocalFileSystem.h -> drivers/LocalFileSystem.h
hal/api/LowPowerTicker.h -> drivers/LowPowerTicker.h
hal/api/LowPowerTimeout.h -> drivers/LowPowerTimeout.h
hal/api/LowPowerTimer.h -> drivers/LowPowerTimer.h
hal/api/PortIn.h -> drivers/PortIn.h
hal/api/PortInOut.h -> drivers/PortInOut.h
hal/api/PortOut.h -> drivers/PortOut.h
hal/api/PwmOut.h -> drivers/PwmOut.h
hal/common/RawSerial.cpp -> drivers/RawSerial.cpp
hal/api/RawSerial.h -> drivers/RawSerial.h
hal/common/SPI.cpp -> drivers/SPI.cpp
hal/api/SPI.h -> drivers/SPI.h
hal/common/SPISlave.cpp -> drivers/SPISlave.cpp
hal/api/SPISlave.h -> drivers/SPISlave.h
hal/common/Serial.cpp -> drivers/Serial.cpp
hal/api/Serial.h -> drivers/Serial.h
hal/common/SerialBase.cpp -> drivers/SerialBase.cpp
hal/api/SerialBase.h -> drivers/SerialBase.h
hal/common/Stream.cpp -> drivers/Stream.cpp
hal/api/Stream.h -> drivers/Stream.h
hal/common/Ticker.cpp -> drivers/Ticker.cpp
hal/api/Ticker.h -> drivers/Ticker.h
hal/common/Timeout.cpp -> drivers/Timeout.cpp
hal/api/Timeout.h -> drivers/Timeout.h
hal/common/Timer.cpp -> drivers/Timer.cpp
hal/api/Timer.h -> drivers/Timer.h
hal/common/TimerEvent.cpp -> drivers/TimerEvent.cpp
hal/api/TimerEvent.h -> drivers/TimerEvent.h
hal/api/Transaction.h -> drivers/Transaction.h
hal/api/can_helper.h -> drivers/can_helper.h
hal/.yotta_ignore
hal/CMakeLists.txt
hal/hal/analogin_api.h -> hal/analogin_api.h
hal/hal/analogout_api.h -> hal/analogout_api.h
hal/hal/buffer.h -> hal/buffer.h
hal/hal/can_api.h -> hal/can_api.h
hal/hal/dma_api.h -> hal/dma_api.h
hal/hal/ethernet_api.h -> hal/ethernet_api.h
hal/hal/gpio_api.h -> hal/gpio_api.h
hal/hal/gpio_irq_api.h -> hal/gpio_irq_api.h
hal/hal/i2c_api.h -> hal/i2c_api.h
hal/hal/lp_ticker_api.h -> hal/lp_ticker_api.h
hal/common/mbed_gpio.c -> hal/mbed_gpio.c
hal/common/mbed_lp_ticker_api.c -> hal/mbed_lp_ticker_api.c
hal/common/mbed_pinmap_common.c -> hal/mbed_pinmap_common.c
hal/common/mbed_ticker_api.c -> hal/mbed_ticker_api.c
hal/common/mbed_us_ticker_api.c -> hal/mbed_us_ticker_api.c
hal/module.json
hal/hal/pinmap.h -> hal/pinmap.h
hal/hal/port_api.h -> hal/port_api.h
hal/hal/pwmout_api.h -> hal/pwmout_api.h
hal/hal/rtc_api.h -> hal/rtc_api.h
hal/hal/serial_api.h -> hal/serial_api.h
hal/hal/sleep_api.h -> hal/sleep_api.h
hal/hal/spi_api.h -> hal/spi_api.h
hal/hal/storage_abstraction/Driver_Common.h -> hal/storage_abstraction/Driver_Common.h
hal/hal/storage_abstraction/Driver_Storage.h -> hal/storage_abstraction/Driver_Storage.h
hal/hal/ticker_api.h -> hal/ticker_api.h
hal/hal/trng_api.h -> hal/trng_api.h
hal/hal/us_ticker_api.h -> hal/us_ticker_api.h
hal/api/mbed.h -> mbed.h
hal/api/CThunk.h -> platform/CThunk.h
hal/common/CallChain.cpp -> platform/CallChain.cpp
hal/api/CallChain.h -> platform/CallChain.h
hal/api/Callback.h -> platform/Callback.h
hal/api/FunctionPointer.h -> platform/FunctionPointer.h
hal/api/PlatformMutex.h -> platform/PlatformMutex.h
hal/api/SingletonPtr.h -> platform/SingletonPtr.h
hal/api/critical.h -> platform/critical.h
hal/common/mbed_alloc_wrappers.cpp -> platform/mbed_alloc_wrappers.cpp
hal/common/mbed_assert.c -> platform/mbed_assert.c
hal/api/mbed_assert.h -> platform/mbed_assert.h
hal/common/mbed_board.c -> platform/mbed_board.c
hal/common/mbed_critical.c -> platform/mbed_critical.c
hal/api/mbed_debug.h -> platform/mbed_debug.h
hal/common/mbed_error.c -> platform/mbed_error.c
hal/api/mbed_error.h -> platform/mbed_error.h
hal/common/mbed_interface.c -> platform/mbed_interface.c
hal/api/mbed_interface.h -> platform/mbed_interface.h
hal/common/mbed_mem_trace.c -> platform/mbed_mem_trace.c
hal/api/mbed_mem_trace.h -> platform/mbed_mem_trace.h
hal/common/mbed_rtc_time.cpp -> platform/mbed_rtc_time.cpp
hal/common/mbed_semihost_api.c -> platform/mbed_semihost_api.c
hal/api/mbed_stats.h -> platform/mbed_stats.h
hal/common/mbed_wait_api_no_rtos.c -> platform/mbed_wait_api_no_rtos.c
hal/common/mbed_wait_api_rtos.cpp -> platform/mbed_wait_api_rtos.cpp
hal/api/platform.h -> platform/platform.h
hal/common/retarget.cpp -> platform/retarget.cpp
hal/api/rtc_time.h -> platform/rtc_time.h
hal/api/semihost_api.h -> platform/semihost_api.h
hal/api/toolchain.h -> platform/toolchain.h
hal/api/wait_api.h -> platform/wait_api.h
2016-09-30 19:18:09 -05:00
Christopher Haster 0bad622a16 restructure - Moved targets out to top level
hal/targets -> targets
hal/targets.json -> targets/targets.json
2016-09-30 19:18:09 -05:00
Sam Grove 7f8cadae7f Merge pull request #2869 from geky/callback-fix-overloads
callback - Remove problematic callback overloads
2016-09-30 15:39:13 -05:00
Sam Grove 20756cbf77 Merge pull request #2860 from ARMmbed/event_loop_mbed_events_new
Event loop with mbed-events
2016-09-30 15:24:24 -05:00
Sam Grove 4c79daf576 Merge pull request #2857 from MultiTechSystems/mtq-mdot-rtos-fixes
resolve multiple STM32F411RE configurations in mbed_rtx.h
2016-09-30 15:01:53 -05:00
Sam Grove b0b7b3cf9c Merge pull request #2849 from pan-/fix_nordic_critical_section
Fix nordic critical section entry and exit
2016-09-30 15:00:43 -05:00
Martin Kojtal 56a223e3f4 emac interface - typedef should be available for non-emac targets
As it's required by lwip_bringup function
2016-09-30 19:06:02 +01:00
Bogdan Marinescu 53218f9be8 Include events library headers in mbed.h
The inclusion is conditioned by the presence of the events library
(`MBED_CONF_EVENTS_PRESENT`). This ensures backward compatibility with
SDK builds.
2016-09-30 17:12:00 +03:00
Martin Kojtal bad51a56a1 targets: remove emac for k64f, not supported yet 2016-09-30 09:42:14 +01:00
Christopher Haster f8917e1cd9 callback - Removed problematic callback overloads
Unfortunately, it is very difficult to infer the parameters of
function-objects generically in C++03 without any additional type
information. The current implementation fails to do so, and the compiler
simply bails with "unable to deduce template parameter".

Rather than leaving the user with a small novel of error messages, this
patch removes the problematic callback overloads, leaving only callback
overloads for the original pointer types.
2016-09-29 16:30:49 -05:00
andreas.larsson f8ad018e14 Added 2016-09-29 12:01:35 +01:00
andreas.larsson 31a1a7fe9b Fixed bug in packetIndication for packetInfo->rxData + use mutexes + cleanup 2016-09-29 11:57:15 +01:00
andreas.larsson 2ce9039a1a Added wifi_emac_api.cpp 2016-09-29 11:51:44 +01:00
andreas.larsson 05974a6578 Added EMAC 2016-09-29 11:50:59 +01:00
Vincent Coubard dcf03310d0 NRF5 - Fix usage of volatile variable in nordic critical section implementations. 2016-09-29 10:05:02 +01:00
Martin Kojtal f12676dfc7 Merge branch 'master' into feature_wifi
Conflicts:
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
	hal/targets.json
2016-09-29 09:20:46 +01:00
svastm d37e4d876d STM32L4 - Rename RTC_LSI 2016-09-29 10:00:48 +02:00
svastm f361a430ef STM32L1 - Rename RTC_LSI 2016-09-29 10:00:45 +02:00
svastm da44e99a1c STM32L0 - Rename RTC_LSI 2016-09-29 10:00:41 +02:00
svastm 57208bb651 STM32F7 - Rename RTC_LSI 2016-09-29 10:00:38 +02:00
svastm a0fd0d39c1 STM32F4 - Rename RTC_LSI 2016-09-29 10:00:34 +02:00
svastm faae46385f STM32F3 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm 574e7b7622 STM32F2 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm a4db938b7a STM32F1 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm 9053d3b9ea STM32F0 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
Sam Grove 2564a833c0 Merge pull request #2822 from anangl/master
TARGET_NRF5: Removed waiting for TX completed from 'serial_putc()'.
2016-09-28 15:37:58 -07:00
Sam Grove 9e1b53f6d3 Merge pull request #2851 from geky/callback-function-objects
callback - Add size-limited function-object overloads to Callback
2016-09-28 15:00:09 -07:00
Sam Grove 7608401f2b Merge pull request #2810 from toyowata/master
[LPC1347] Fix PwmOut prescaler for 16-bit timer
2016-09-28 14:58:55 -07:00
Sam Grove 3d1531fcb1 Merge pull request #2767 from mikaleppanen/lwip_2_0
Replace lwIP 1.4.1 with lwIP 2.0
2016-09-28 14:58:22 -07:00
Mike Fiore fdd267cadf resolve multiple STM32F411RE configurations in mbed_rtx.h 2016-09-28 14:57:46 -05:00
Christopher Haster 161a2ec259 callback - Added size-limited function-object overloads to Callback
The callback class can now accept generalized function-objects:

    class Thing {
    public:
        int value;

        void operator()() {
            printf("hi! %d\n", value);
        }
    };

    Callback<void()> cb(Thing(2));

However, with the intention of avoiding implicit dynamic-memory
allocations, the Callback class is limited to a single word of storage.
Exceeding this size will eliminate the function-object type from the
overload set and fail to compile.

Effort was invested to make this situation very clear to the user. Here
is an example error message with noise removed:

    [ERROR] ./main.cpp: In function 'int main()':
    ./mbed-os/hal/api/Ticker.h:101:10: note:
        no known conversion for argument 1 from 'BigFunc' to 'mbed::Callback<void()>'

The real benefit of this change is the ability for users to hook into
the attributes of the Callback class. This mostly allows lifetime
management of the function-objects from third-party libraries (such as
the Event class from mbed-events).

Note: The convenient `callback` function may become ambiguous if
provided with a type that defines multiple incompatible `operator()`
member functions.
2016-09-28 12:23:29 -05:00
Christopher Haster 804a621231 callback - Moved internal dispatch mechanism to generated op-table
This allows additional attributes to be attached to the internally
generated type such as move and destructor operations with no increase
in RAM footprint.

The current overloads can't take advantage of this, but it does open
the possibility for more powerful overloads that can provide these
additional attributes.

Changes to mbed-os memory consumption:

        .text   .data   .bss
before  57887   2292    7692
after   57842   2292    7691
2016-09-28 12:23:24 -05:00
Vincent Coubard c536392079 TARGET_NRF5 - Add critical section enter/exit overrides for NRF5 targets.
This change takes advantage of the reworked primitives of SDK v11.
2016-09-28 13:43:31 +01:00
svastm 0766d39746 STM32F4 - Enable the low power timer
Enable the low power timer for the following targets:
 - NUCLEO_F411RE
 - NUCLEO_F401RE
 - DISCO_F429ZI
 - NUCLEO_F446RE
 - NUCLEO_F410RB
 - DISCO_F469NI
 - NUCLEO_F446ZE
 - B86B_F446VE
2016-09-28 09:36:37 +02:00
svastm 21b11a26ec STM32F4 - Add low power timer 2016-09-28 09:31:03 +02:00
Vincent Coubard 1aa76b7724 HAL - Tag implementation of critical section enter/exit as weak so it can be overriden.
This change allows a port to provide its own implementation of:
* core_util_critical_section_enter
* core_util_critical_section_exit

Some system like the NRF series require specific behavior for the critical
section and now can override it properly.
2016-09-28 08:13:46 +01:00
Mika Leppänen 2bad43d7ca Corrected K66F and K64F drivers to make "or" operation instead of "and" when multicast
group address is added to filter.
2016-09-28 08:48:43 +03:00
Głąbek, Andrzej 86005da023 Merge branch 'master' of https://github.com/ARMmbed/mbed-os
* 'master' of https://github.com/ARMmbed/mbed-os: (63 commits)
  [XDOT_L151] add IAR support
  Modify mbedtls scripts to add config-no-entropy.h
  Remove extra spaces
  [XDOT_L151] include xDot in mbed 5 releases
  [STM32F429ZI] INITIAL_SP correction
  [STM32F091RC] patch for tests-mbedmicro-rtos-mbed-threads
  mbedtls trng - remove MBEDTLS_ENTROPY_HARDWARE_ALT
  targets - add TRNG device_has to STM32F7 targets
  mbedtls - move TRNG mbed impl into platform folder
  TRNG HAL - fix length doc wording for get_bytes
  HAL TRNG - add dummy variable to empty structs
  TRNG - protect HAL implementation if DEVICE_TRNG is not defined
  TRNG - remove set seed function
  HAL - RNG rename to TRNG
  HAL - rng nuvoton cleanup code style
  RNG - fix warnings due to obj not used for some targets
  RNG - rename rng_get_numbers to rng_get_bytes
  mbedtls - mbed wrapper rename to mbed_rng
  HAL: Add rng set seed value function
  NUMAKER_PFM_NUC472: Add RGN HAL API implementation
  ...

# Conflicts:
#	hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/serial_api.c
2016-09-28 07:06:28 +02:00
Sam Grove 58c12f19b2 Merge pull request #2824 from jeromecoutant/PR_F429ZI_SP
[STM32F429ZI] INITIAL_SP correction
2016-09-27 21:56:24 -07:00
Sam Grove 4a6558083e Merge pull request #2814 from bcostm/adcintch_F3
STM32F3xx - Add support of ADC internal channels
2016-09-27 21:54:27 -07:00
Sam Grove 681cff8010 Merge pull request #2785 from pan-/remove_warnings_from_nordic_target
TARGET_NRF - Remove warnings from nordic target.
2016-09-27 21:53:28 -07:00
Sam Grove d204d69003 Merge pull request #2749 from bcostm/serialFC_disco-f746ng
DISCO_F746NG - Add Serial Flow Control pins
2016-09-27 21:52:37 -07:00
Sam Grove 50c30d384d Merge pull request #2741 from pan-/conf_flush_at_exit
Add configuration for IO flushing during exit.
2016-09-27 21:52:13 -07:00
Sam Grove 5ef720246b Merge pull request #2726 from jeromecoutant/PR_NUCLEO_F207ZG_D11
[NUCLEO_F207ZG] Conflict with Arduino D11 and Ethernet port
2016-09-27 21:51:48 -07:00
Sam Grove 66329c4e71 Merge pull request #2827 from MultiTechSystems/xdot-add-release
include MultiTech xDot in mbed 5 releases
2016-09-27 18:42:58 -07:00
Mike Fiore 7b2942157a [XDOT_L151] add IAR support 2016-09-27 16:09:15 -05:00
Andres AG 21a7b1de04 Modify mbedtls scripts to add config-no-entropy.h 2016-09-27 16:19:39 +01:00
Mike Fiore 1b8cb3ca76 [XDOT_L151] include xDot in mbed 5 releases 2016-09-27 08:48:08 -05:00
jeromecoutant dfbb5675ed [STM32F429ZI] INITIAL_SP correction 2016-09-27 14:39:20 +02:00
Głąbek, Andrzej d0eed52cde Removed waiting for TX completed from 'serial_putc()', moved it to 'serial_init()' to allow passing tests MBED_37/38. 2016-09-27 14:03:42 +02:00
Martin Kojtal e0a48e9f6b K64F: add EMAC device_has 2016-09-27 10:23:45 +01:00
Martin Kojtal ef58562ad0 targets - add TRNG device_has to STM32F7 targets 2016-09-27 09:14:48 +01:00
Martin Kojtal 88b2220548 TRNG HAL - fix length doc wording for get_bytes 2016-09-27 09:14:37 +01:00
Martin Kojtal 48544fc6eb HAL TRNG - add dummy variable to empty structs
Otherwise it's implementation specific, IAR fails to compile.
2016-09-27 09:14:31 +01:00
Martin Kojtal f8c6c23ced TRNG - protect HAL implementation if DEVICE_TRNG is not defined 2016-09-27 09:14:26 +01:00
Martin Kojtal 9048113562 TRNG - remove set seed function 2016-09-27 09:14:21 +01:00
Martin Kojtal ea1041ea36 HAL - RNG rename to TRNG 2016-09-27 09:13:59 +01:00
Martin Kojtal da1b423685 HAL - rng nuvoton cleanup code style 2016-09-27 08:51:53 +01:00
Martin Kojtal a225bafdbb RNG - fix warnings due to obj not used for some targets 2016-09-27 08:51:51 +01:00
Martin Kojtal e8ca16dde7 RNG - rename rng_get_numbers to rng_get_bytes 2016-09-27 08:51:49 +01:00
Martin Kojtal 1d9cacbbd2 HAL: Add rng set seed value function 2016-09-27 08:51:45 +01:00
Martin Kojtal 5e351c201a NUMAKER_PFM_NUC472: Add RGN HAL API implementation 2016-09-27 08:51:42 +01:00
Martin Kojtal 72fac611f2 STM32F4/F7: Add RNG HAL implementation 2016-09-27 08:51:40 +01:00
Martin Kojtal 02fd613a81 k66f: add RNG HAL implementation 2016-09-27 08:51:37 +01:00
0xc0170 132a5bbff3 k64f: add RNG HAL implementation
Replaces old mbedtls entropy file, to use new RNG HAL API.
2016-09-27 08:51:31 +01:00
0xc0170 6da5515e1c HAL: add RGN API
Provides init, free and get numbers functions.
2016-09-27 08:51:26 +01:00
Mike Fiore 4820c87c68 [XDOT_L151] add SWD & UART pin names to match pinout diagram 2016-09-27 00:13:08 -07:00
Mike Fiore a93b7d2651 [XDOT_L151] add RTOS configuration for xDot 2016-09-27 00:13:08 -07:00
Mike Fiore 1f40f3de97 [XDOT_L151] initial SP for ARM_STD build was set to 0x2008000 instead of 0x20008000 & caused DAPLink to reject FW 2016-09-27 00:13:08 -07:00
Mike Fiore 7836c6eaf1 rebase support for MultiTech xDot platform
[XDOT_L151] copy new target CMSIS files from NZ32_SC151 target

[XDOT_L151] remove Modtronix code, add HardFault_Handler, update clock configuration to match xDot hardware

[XDOT_L151] copy new target HAL files from NZ32_SC151 target

[XDOT_L151] update HAL to match xDot hardware

[XDOT_L151] add xdot_eeprom.* and xdot_low_power.* files

[XDOT_L151] add RTOS support for target

Conflicts:
	rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c

[XDOT_L151] match NUCLEO_L152RE startup code for GCC_ARM so RTOS works

[XDOT_L151] fix GPIO write failure

[XDOT_L151] add XDOT_L151CC target to targets.json

[XDOT_L151] change xDot default stack size to 256 bytes and main stack size to 1.5kB

[XDOT_L151] update PinNames.h to match rev E hardware - no change to external pinout

[XDOT_L151] update style in custom xDot HAL files

Conflicts:
	rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h
	rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
2016-09-27 00:13:08 -07:00
Vincent Coubard 815551380f TARGET_NRF51_DONGLE_LEGACY - Add NRF51_DONGLE to the list of paths available for this target. 2016-09-26 23:56:33 -07:00
Vincent Coubard 46ab3cab79 NRF51_DK_LEGACY: Add the path TARGET_NRF51_DK to the list of available paths.
This fix the build of this target.
2016-09-26 23:56:33 -07:00
Vincent Coubard d61ab652de NRF51_DONGLE - remove ANALOGIN from the list of capabilities. 2016-09-26 23:56:33 -07:00
Vincent Coubard 8f79b6dbc8 NORDIC - Update NRF51_DONGLE target to takes advantage of the NRF5 implementation
of BLE and device drivers.
2016-09-26 23:56:33 -07:00
Vincent Coubard 9dd0c672ca HAL - Add a newline at the end of hal/api/Callback.h.
This remove a warning issued by ARMCC.
2016-09-26 23:10:24 -07:00
svastm 9f85f77001 STM32F7 - Add low power timer
Enable the low power timer for the following targets:
 - NUCLEO_F746ZG
 - NUCLEO_F767ZI
 - DISCO_F746NG
 - DISCO_F767ZI
2016-09-26 21:34:07 -07:00
svastm 49335577e1 STM32F7 - Add low power timer 2016-09-26 21:34:07 -07:00
Sam Grove 5310c2e2cd Merge pull request #2762 from svastm/lp_timer_l0
STM32L0 - Add low power timer
2016-09-26 21:33:27 -07:00
0xc0170 20f5adbab2 Merge branch 'master' into feature_wifi
Conflicts:
	features/net/FEATURE_IPV4/lwip-interface/EthernetInterface.cpp
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.h
	features/net/network-socket/WiFiInterface.h
2016-09-26 16:36:17 +01:00
Christopher Haster c3e0569768 callback - Fixed parameter misname
Problematic line:
memcpy(&_func, obj, sizeof obj);

Should be:
memcpy(&_func, method, sizeof method);

Introduced during renaming of callback arguments for clarity:
https://github.com/ARMmbed/mbed-os/pull/2794
2016-09-26 10:08:39 -05:00
svastm e319d903ab STM32L0 - Enable the low power timer
Enable the low power timer for the following targets:
 - NUCLEO_L053R8
 - NUCLEO_L073K8
 - NUCLEO_L011K4
 - NUCLEO_L031K6
 - DISCO_L053C8
2016-09-26 16:29:03 +02:00
svastm 85718c51ec STM32L0 - Add low power timer 2016-09-26 16:26:55 +02:00
bcostm e1d169ec7d STM32F3xx - Add ADC internal channels "pins" 2016-09-26 14:54:36 +02:00
bcostm 39e71829f0 STM32F3xx - Add one more bit for the channel number. Declare ADC internal channels "pins". 2016-09-26 14:54:05 +02:00
bcostm 213b44d3fc STM32F3xx - Disable GPIO configuration for ADC internal channels 2016-09-26 14:51:50 +02:00
Vincent Coubard 68317215e5 TARGET_MCU_NRF51822 - remove non accessible return. 2016-09-26 13:29:10 +01:00
Vincent Coubard 18370ab258 TARGET_MCU_NRF51822 - Fix padding warning with ARMCC.
See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0496c/CACHCBBJ.html
for A1581W.
2016-09-26 13:29:09 +01:00
Vincent Coubard 039584332e TARGET_NRF5 - Explicitaly convert objects uint32_t to object of type PinName. 2016-09-26 13:29:05 +01:00
Vincent Coubard 80740dda06 TARGET_NRF - Fix possible invalid comparison. 2016-09-26 13:28:44 +01:00
Vincent Coubard 0e0cc2687a TARGET_NRF5 - Fix signed to unsigned comparison. 2016-09-26 13:28:42 +01:00
Vincent Coubard 54f52d7a5f TARGET_MCU_NRF51822 - Initialize uninitialized variable in spi_api.c.
Even if that wasn't dangerous, this changes makes the compiler happy.
2016-09-26 13:28:41 +01:00
Vincent Coubard 36c001d0e8 TARGET_MCU_NRF51822 - Fix inline keyword position. 2016-09-26 13:28:39 +01:00
Vincent Coubard ede837df7c Nordic - reorder __INLINE qualification to avoid warning. 2016-09-26 13:28:37 +01:00
Vincent Coubard 4ae2453eb6 NORDIC - remove the unused and incorrect PACKED() macro from the Nordic SDK.
This macro is not used anywhere.
2016-09-26 13:28:36 +01:00
Toyomasa Watarai 6478a07859 [LPC1347] Fix cast warning for GCC_ARM 2016-09-26 16:16:27 +09:00
Toyomasa Watarai ec406b1740 [LPC1347] Fix PwmOut prescaler for 16-bit timer
* Fix PwmOut prescaler for 16-bit timer
* Remove static variable pwm_clock_mhz
* Fix spike pulse issue when 0% duty
2016-09-26 16:06:01 +09:00
Sam Grove c49e970909 Merge pull request #2794 from geky/callback-c-order
callback - Reorder optional argument to static C function
2016-09-25 22:07:45 -05:00
Sam Grove 78a2d289e7 Merge pull request #2792 from jeromecoutant/PR_NUCLEO_F303ZE
[NUCLEO_F303ZE] MBED-OS5 capability
2016-09-24 16:48:31 -05:00
Sam Grove 24f9612da5 Merge pull request #2775 from NXPmicro/KSDK_SDHC_Driver_Update
Update KSDK SDHC driver for K64F & K66F
2016-09-24 16:47:48 -05:00
Sam Grove c4748e2e75 Merge pull request #2771 from svastm/fix_deepsleep_l4
STM32L4 - Update deepsleep implementation
2016-09-24 16:45:38 -05:00
Sam Grove 35a8b1fdea Merge pull request #2764 from svastm/lp_timer_l4
STM32L4 - Add low power timer
2016-09-24 16:44:32 -05:00
Sam Grove 7d464b18a2 Merge pull request #2763 from svastm/lp_timer_l1
STM32L1 - Add low power timer
2016-09-24 16:44:15 -05:00
Sam Grove a765afddf0 Merge pull request #2759 from svastm/lp_timer_f0
STM32F0 - Add low power timer
2016-09-24 16:41:37 -05:00
Sam Grove 3c6776f9bf Merge pull request #2753 from jeromecoutant/PR_NUCLEO_F767ZI_CAN
[NUCLEO_F767ZI] Add CAN capability
2016-09-24 16:41:10 -05:00
Sam Grove 6d628f6e1a Merge pull request #2751 from bcostm/serialFC_L0
STM32L0xx - Add Serial Flow Control
2016-09-24 16:40:54 -05:00
Sam Grove 2eb0b2ca6b Merge pull request #2747 from toyowata/master
[LPC11U68] Fix pin interrupt select offset
2016-09-24 16:40:36 -05:00
Sam Grove 97c2734b49 Merge pull request #2734 from tung7970/fix-mbedos
Fix signed/unsigned comparison warning in SerialBase.cpp
2016-09-24 16:39:29 -05:00
Sam Grove 29b0551eb7 Merge pull request #2728 from andreaslarssonublox/eth_fix
Added ethernet and enabled IPV4 feature for the EVK-ODIN-W2/C029 target
2016-09-24 16:35:49 -05:00
Sam Grove 1934e20959 Merge pull request #2719 from NXPmicro/Update_ARM_Linker_File
Updated ARM linker scripts for Kinetis platforms that use SDK 2.0
2016-09-24 16:33:21 -05:00
Sam Grove bd3d6abbc4 Merge pull request #2715 from pan-/NDEBUG_optimization
Allow the trace output by mbed error to be conditional of NDEBUG.
2016-09-24 16:32:34 -05:00
Sam Grove ad0b9c2efd Merge pull request #2707 from stevew817/feature/IAR_GiantGecko
[EFM32] Add IAR support for remaining Silicon Labs targets
2016-09-24 16:29:52 -05:00
Sam Grove 60f661da62 Merge pull request #2684 from nvlsianpu/introduce_peer_manager
[BLE NRF5] introduce the SDK nRF5 Peer manager into BLE security features
2016-09-24 16:28:18 -05:00
Sam Grove 8e473be5f3 Merge pull request #2622 from egostm/dev_i2c_asynch
[STM32F4] Add asynchronous I2C
2016-09-24 16:27:20 -05:00
Sam Grove 63f5854761 Merge pull request #2585 from beeverycreative/master
Added support for ADC only pins in LPC43xx
2016-09-24 16:26:50 -05:00
Sam Grove 297597c7f4 Merge pull request #2415 from svastm/serial_asynch_f0
[STM32F0] Add asynchronous serial
2016-09-24 16:22:55 -05:00
Sam Grove f0c00bfd21 Merge pull request #2586 from tung7970/feature-rtx-config
RTOS - Move per-target RTX config to mbed_rtx.h
2016-09-23 15:21:39 -05:00
Martin Kojtal 8bfd108aa5 Merge pull request #2729 from bulislaw/feature_wifi
HAL: Add Emac interface
2016-09-23 12:52:13 +01:00
Toyomasa Watarai 1553c45fd2 break statement is on new line 2016-09-23 19:13:33 +09:00
Christopher Haster b371eb5269 callback - Reordered optional argument to static C function
Before:
Callback<void()> a = callback(obj, member)
Callback<void()> b = callback(context, function)

After:
Callback<void()> a = callback(obj, member)
Callback<void()> b = callback(function, context)

This ordering is more intuitive based on feedback from users. This order
was initially considered but proved problematic when integrated with
other variable arguments in attach functions.

With `callback` as a separate convenience function, this style
no longer presents a problem.
2016-09-23 04:52:58 -05:00
svastm 6d73dd338b STM32L4 - Update deepsleep implementation 2016-09-23 11:42:48 +02:00
Bartek Szatkowski ed0dfb48ea HAL: Add Emac interface 2016-09-23 10:34:21 +01:00
Martin Kojtal e4dde3460f Merge pull request #2774 from AlessandroA/uvisor_rpc
uVisor: Update to v0.25.0
2016-09-23 09:48:07 +01:00
jeromecoutant ad4680abd2 [NUCLEO_F303ZE] MBED-OS5 capability 2016-09-23 09:24:55 +02:00
Erwan GOURIOU 22d6bc076a [dev_asynch_i2c] reduce footprint for i2c_s struct 2016-09-22 09:52:21 +02:00
Erwan GOURIOU d7dda282c2 [dev_asynch_i2c] Extend asynch I2C to STM32F4 boards
Move i2c_s to common_objects.h
Introduce I2C Master/Slave asynch test
Test I2C asynch master/slave on STM32F4 boards
2016-09-22 09:52:21 +02:00
Erwan GOURIOU 1707b3c582 [dev_asynch_i2c] Move i2c_s to common_objects.h 2016-09-22 09:43:52 +02:00
Erwan GOURIOU 8982ff1971 [dev_i2c] Fix I2C byte transfer API to enable Master/Slave test on F411RE
i2c_byte_write could be used to send byte and address.
In case used for address, ADDR Flag should be reset.
2016-09-22 09:39:10 +02:00
Erwan GOURIOU d2c3dc3d08 [dev_asynch_i2c] HAL Fix to support Master Rx w/ repeated start
As per reference manual, closing communication for master receiver
with repeated start requires, after reading second last data byte
(after second last RxNE event):
-Clearing ACK bit (same as non repeated start case)
-Set START bit (instead of STOP bit in non repeated start case)
This is valid for I2C_FIRST_FRAME and I2C_NEXT_FRAME conditions
2016-09-22 09:39:10 +02:00
Erwan GOURIOU 4b42fc5a22 [dev_asynch_i2c] Test Asynch I2C on F411RE
Add single board I2C master/slave asynch test
2016-09-22 09:39:10 +02:00
Erwan GOURIOU 7632f7aa5c [dev_asynch_i2c] Enable asynch I2C on NUCLEO_F411RE
Dev Asynch I2c
One limitation linked to HAL bug:
Master RX(Repeated Start) KO
2016-09-22 09:34:51 +02:00
Tony Wu aa663ea42d RTOS - Move per-target RTX config to mbed_rtx.h
Disintegrate global RTX target config. Move per-target fragment
to mbed_rtx.h under each vendor's directory.

One mbed_rtx.h is defined for each vendor at this moment, however,
the granularity of mbed_rtx.h can be per-chip, or per-board
if necessary.

Signed-off-by: Tony Wu <tung7970@gmail.com>
2016-09-22 15:09:49 +08:00
Sam Grove 0c0455bf3f Merge pull request #2745 from pan-/disable_global_objects_destruction
Disable global objects destruction
2016-09-22 00:48:08 -05:00
Sam Grove 28013dddc4 Merge pull request #2650 from svastm/lp_timer_f3
STM32F3 - Add low power timer
2016-09-22 00:47:30 -05:00
Sam Grove 4fa65a656e Merge pull request #2542 from LMESTM/dev_spi_asynch_stm32f4
Dev spi asynch stm32f4
2016-09-22 00:45:08 -05:00
Mahadevan Mahesh c3b4a43bec Update KSDK SDHC driver for K64F & K66F
1. Use function pointer for interrupt handler, this should reduce the code-size
   for applications that do not use this driver
2. Fix the wait for initialization of the SD card
3. Fix SDHC driver support for non-word aligned accesses
4. Remove some redundant code & assert function calls.
5. Updated various comments

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-09-21 12:07:09 -05:00
Alessandro Angelino 373b0ba34a CMSIS 5: Virtualize NVIC_SystemReset
This applies only when the virtualization option is explicitly set.
Currently only uVisor virtualizes the NVIC APIs.
2016-09-21 17:15:42 +01:00
Martin Kojtal 2866e21bea Merge pull request #2701 from simonqhughes/master
CFSTORE Integration with Storage-Volume-Manager and Flash-Journal API update to the latest versions
2016-09-21 17:03:31 +01:00
svastm e38b1d12fb STM32L1 - Enable the low power timer
Enable the low power timer for the NUCLEO_L152RE
2016-09-21 10:57:15 +02:00
svastm 37ee192205 STM32L1 - Add low power timer 2016-09-21 10:56:37 +02:00
Laurent MEUNIER 04fe4d2588 [STM32F4 HAL] Avoid SPI spurious interrupt
If SPI TXE is not disabled at the end of transfer, MBED application
callback that is registered for transfer completion might be called twice
2016-09-20 19:25:25 +02:00
Laurent MEUNIER 00086a6f44 [STM32F4] Simplify spi Asynch transfer implementation
Following discussion on:

it seems now clear that the transfer API is meant to be used either
with only Rx, or only Tx or Rx and Tx with the same lenth.

Therefore we're removing support of transfers of Rx and Tx with different
lenghts - this makes porting to HAL more direct and simpler.
2016-09-20 19:25:25 +02:00
Laurent MEUNIER e68b550c2a [STM32F4] enable SPI ASYNCH 2016-09-20 19:25:25 +02:00
Laurent MEUNIER c5323c13a8 [STM32F4] SPI: avoid duplicate information accross layers
Same information was stored in spi_api.c and STM32 HAL layers.
Modify code to avoid this duplicate information.
2016-09-20 19:25:25 +02:00
Laurent MEUNIER 478168c712 [STM32F4] SPI ASYNCH support
This commit is highly derived from an existing work from salkinium.

It adds SPI ASYNC support to STM32 F4 devices. This required a small
rework of the structure to have SYNCH and ASYNCH co-exist.
2016-09-20 19:25:25 +02:00
Laurent MEUNIER 5fdce5fbf7 [STM32F4] move spi_s to common file 2016-09-20 19:25:25 +02:00
Mahadevan Mahesh 47db661e8d Updated ARM linker scripts for Kinetis platforms that use SDK 2.0
1. Fix Heap start address
2. Update to the latest script provided by the Kinetis SDK team

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-09-20 10:38:04 -05:00
svastm 883ff3a1d4 STM32L4 - Enable the low power timer
Enable the low power timer for the following targets:
 - DISCO_L476VG
 - NUCLEO_L432KC
 - NUCLEO_L476RG
2016-09-20 17:36:56 +02:00
svastm 35d101ee50 STM32L4 - Add low power timer 2016-09-20 17:36:56 +02:00
svastm e70921a5e1 STM32F3 - Enable the low power timer
Enable the low power timer for the following targets:
 - NUCLEO_F302R8
 - NUCLEO_F303K8
 - NUCLEO_F303RE
 - NUCLEO_F334R8
 - DISCO_F334C8
 - DISCO_F303VC
2016-09-20 17:21:13 +02:00
svastm 06df09f250 STM32F3 - Add low power timer 2016-09-20 17:21:13 +02:00
svastm 369ecf2b26 STM32F0 - Enable the low power timer
Enable the low power timer for the following targets:
 - NUCLEO_F070RB
 - NUCLEO_F072RB
 - NUCLEO_F091RC
2016-09-20 17:19:56 +02:00
svastm e4f643144d STM32F0 - Add low power timer 2016-09-20 17:19:56 +02:00
jeromecoutant 012f2c3353 [NUCLEO_F767ZI] Add CAN capability 2016-09-20 16:18:11 +02:00
bcostm 15f7a87f18 STM32L0xx - Add SERIAL_FC in "device_has" 2016-09-20 14:18:54 +02:00
bcostm f9dd9d3cfb STM32L0xx - Add UART_RTS and CTS pins 2016-09-20 14:17:40 +02:00
svastm a1324151d2 [STM32F0] Enable asynchronous serial 2016-09-20 12:57:56 +02:00
svastm 12210bc12f [STM32F0] Add asynchronous serial 2016-09-20 12:57:56 +02:00
bcostm 7dfc2fd424 DISCO_F746NG - Add Serial Flow Control pins 2016-09-20 09:58:05 +02:00
Toyomasa Watarai d52498f2fa [LPC11U68] Fix pin interrupt select offset
* Fix incorrect comment
* Add offset value calculation by interrupt port number
2016-09-20 15:24:56 +09:00
Vincent Coubard f4f8b491d1 Override exit and atexit functions from newlib.
This change simplify the exit and initialization process.
It also reduce the number of hidden memory allocation made by atexit.
2016-09-19 15:17:39 +01:00
Vincent Coubard b67d863c0a Disable registration of atexit handlers on ARMCC.
This prevent destructors for global C++ objects to be invoked at exit.
By default atexit handlers registration involved dynamic allocation.
2016-09-19 13:29:29 +01:00
jeromecoutant a6ed7cd77b [NUCLEO_F207ZG] Conflict with Arduino D11 and Ethernet port
The board has a jumper that be used to select between using ethernet
or using SPI for the same pin.
Without this patch, a user that configures the board in 'SPI' mode
would get a "pinmap not found for peripheral" error.
With this change a user doesn't have to change the mbed library
when switching modes
(of course user has to take care of SW and HW matching...
SPI wouldn't work as expected if board is configured in Ethernet)
2016-09-19 11:33:54 +02:00
Vincent Coubard 9803b62b4d Makes flush of IOs at exit configurable.
This change allows program which doesn't use the IO subsystem to
completelly get rid of it in the binary generated.

IO's are still flushed by default but it can be overriden in
configuration.
2016-09-19 10:33:48 +01:00
Sam Grove 6aae4170ba Merge pull request #2698 from TsungtaWu/master
DELTA_DFBM_NQ620 target
2016-09-18 17:47:12 -05:00
Sam Grove ee1cba0b69 Merge pull request #2572 from tung7970/master
Fix STM32F407VG target name and LPC11U6X linker errors
2016-09-18 17:44:55 -05:00
Sam Grove c4a02b037e Merge pull request #2463 from svastm/serial_asynch_l0
[STM32L0] Add asynchronous serial
2016-09-18 17:44:08 -05:00
Tony Wu 59dcd3f40c Fix signed/unsigned comparison warning in SerialBase.cpp
Silence the following compiler warning:

Compile: SerialBase.cpp
[Warning] SerialBase.cpp@34,23: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Tony Wu <tung7970@gmail.com>
2016-09-17 21:58:05 +08:00
Sam Grove c19dd19f9c Merge pull request #2723 from NXPmicro/Update_Serial_API
KSDK serial_api.c: Fix assertion error for ParityEven
2016-09-16 17:38:33 -05:00
Sam Grove 184e58d581 Merge pull request #2704 from jeromecoutant/PR_DISCO_L476VG_SPI
DISCO_L476VG: add SPI nicknames
2016-09-16 17:35:17 -05:00
Sam Grove 6b8774fb4e Merge pull request #2703 from anangl/master
TARGET_NRF5: Changed 'serial_baud' implementation to support special baud rates.
2016-09-16 17:34:41 -05:00
Sam Grove 8cdb69eca1 Merge pull request #2696 from c1728p9/add_nrf51_device_has
Add device_has to all nrf51 devices
2016-09-16 17:33:25 -05:00
Sam Grove 27c6e25bcc Merge pull request #2687 from nvlsianpu/add_fs_data_secton_gcc
[NRF5] Add fs_data symbol in data secton for gcc
2016-09-16 17:32:41 -05:00
Sam Grove 5920896169 Merge pull request #2681 from bcostm/adcintch_F0
STM32F0xx - Add support of ADC internal channels
2016-09-16 17:31:53 -05:00
Sam Grove 2fbbf0a4f8 Merge pull request #2666 from stevew817/bugfix/EFM32_us_timer
[EFM32] Microsecond ticker optimization
2016-09-16 17:28:23 -05:00
Sam Grove 27eb9c0969 Merge pull request #2620 from bcostm/serialfc_F4
NUCLEO_F429ZI - Add SERIAL_FC macro
2016-09-16 17:22:18 -05:00
Sam Grove ffdf9ddcae Merge pull request #2619 from bcostm/serialfc_L1
NUCLEO_L152RE - Add Serial Flow Control
2016-09-16 17:22:02 -05:00
Sam Grove 5b5da03129 Merge pull request #2616 from bcostm/serialfc_F3
STM32F3xx - Add Serial Flow Control pins + enable it
2016-09-16 17:21:43 -05:00
Sam Grove 75af749baa Merge pull request #2571 from svastm/serial_asynch_f7
STM32F7 - Add asynchronous serial
2016-09-16 17:20:51 -05:00
andreas.larsson 0e5a0d68b3 Enabled feature IPV4 for C029 2016-09-16 11:31:33 +02:00
Steven Cooreman 6700ab7d0d [EFM32] Remove HG from mbed 5
Remove Happy Gecko from mbed 5 builds until we can verify all of the examples fit using the ARM toolchain
2016-09-16 10:04:51 +02:00
Mahadevan Mahesh 20fc6ce180 KSDK serial_api.c: Fix assertion error for ParityEven
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-09-15 15:59:40 -05:00
Sam Grove da14bce7a2 Merge pull request #2518 from fvincenzo/master
Enable uvisor on Beetle
2016-09-15 14:01:07 -05:00
Vincent Coubard 903afa33c4 Allow the trace output by mbed error to be conditional of NDEBUG.
This change avoid inclusion of printf and friends code in a binary when it
is compiled with the macro NDEBUG enabled (this macro is usually enabled
for production builds).

Unlike assert, the error function will still crash/halt the execution of the
application even if NDEBUG is enabled; the traces are just not outputed.
2016-09-15 14:20:37 +01:00
Steven Cooreman 964aeec0c0 [EFM32] Add all platforms (except Zero) to mbed 5 build 2016-09-15 09:52:23 +02:00
Głąbek, Andrzej c9c946f3b4 Made the constant array in serial_baud() static. 2016-09-14 21:52:24 +02:00
Steven Cooreman 9c5ce840b9 [EFM32] Add IAR support for remaining Silicon Labs targets
Added startup files and IAR memory map files for the remaining Silicon Labs targets as part of the mbed enabled criteria.
2016-09-14 17:06:21 +02:00
jeromecoutant 0b25fd5863 DISCO_L476VG: add SPI nicknames 2016-09-14 15:02:15 +02:00
Głąbek, Andrzej b2de59d8ed Changed 'serial_baud' implementation to make it possible to use baud rates like 56000 or 31250. 2016-09-14 14:44:33 +02:00
Simon Hughes 655a37ad6a Remove storage_abstraction directory from include pathname which is not supported in mbed sdk builds 2016-09-14 13:18:10 +01:00
Martin Kojtal 21a2123aad Merge pull request #2669 from andreaslarssonublox/updated_master
Target - Add u-blox C029 target
2016-09-14 10:35:22 +01:00
Martin Kojtal e014b0f502 Merge pull request #2522 from svastm/cthunk_cm7
Add CThunk for CM7
2016-09-14 08:19:08 +01:00