Commit Graph

1260 Commits (7717af9e29c34d30a3e7b9ddfccfc55eeb27d10c)

Author SHA1 Message Date
Aksel Skauge Mellbye 7717af9e29 Add flash API support 2017-06-11 09:48:37 +01:00
Kevin Gilbert aed4543ecd Original pull request had added these checks to a deleted file. Replicating that change to allow builds on the NRF52840_DK (see original PR #4088 to see the explanation for the removal of spi async) 2017-06-11 09:48:36 +01:00
Andrzej Puzdrowski c479a6a025 disbale SPIM which fix block device 2017-06-11 09:48:36 +01:00
Andrzej Puzdrowski 9d096176ec Rebase of 7e8cfa8076
[NRF52840]: fix SdBlockDevice capability device by disabling SPI_ASYNC mode.
2017-06-11 09:48:35 +01:00
Laurent MEUNIER f7119af2aa STM32 L4: Flash API typo 2017-06-11 09:48:35 +01:00
Laurent MEUNIER d903955760 Removing duplicate defines
Those defines are already available in STM32 L4 SDK and don't need to
be (re)defined here.
2017-06-11 09:48:34 +01:00
Laurent MEUNIER b5c3801730 Fix L432KC compilation error 2017-06-11 09:48:34 +01:00
Laurent MEUNIER d2354e2c1f Activate FLASH on STM32 L4 targets 2017-06-11 09:48:34 +01:00
Laurent MEUNIER 08b8b63f2c STM32L4 : add Flash API support 2017-06-11 09:48:33 +01:00
Aksel Skauge Mellbye 6f2cbf25ed Fix bug with SPI MISO and CS handling 2017-06-11 09:48:33 +01:00
Aksel Skauge Mellbye ca90cc1563 Add bootloader support
* Make memory sections configurable in linker files
* Dynamically determine vector location in flash for NVIC relocation
* Advertise bootloader support in targets.json
2017-06-11 09:48:33 +01:00
Jimmy Brisson 191ea7580c Correctly name rom.a 2017-06-11 09:48:31 +01:00
Sam Grove 78e149c161 Add virtual nvic support to OC_MBUINO (LPC11U24 based) 2017-06-11 09:48:30 +01:00
Russ Butler e155d1a830 Define CMSIS_VECTAB_VIRTUAL for M0 targets
Define CMSIS_VECTAB_VIRTUAL for the M0 targets which have a
corresponding driver. The only M0 target missing this is the LPC4330_M0
which is not part of the 2 or 5 release.
2017-06-11 09:48:30 +01:00
Russ Butler d5320977ff Restore cmsis_nvic for Cortex-M0 targets
Restore cmsis_nvic (cmsis_nvic.c and cmsis_nvic.h) files for the
implementations which use a mechanism other than the VTOR to set
interrupts. These are vendor specific and were done for M0 devices
which do not have a VTOR.

Note - There were two cmsis_nvic files which did not use the VTOR that
which not restored in this patch. This is because these targets were
not M0 devices and could use the new unified implementation instead.
These files are:
targets\TARGET_ARM_SSG\TARGET_MPS2\TARGET_MPS2_M0P\device\cmsis_nvic.c
targets\TARGET_ONSEMI\TARGET_NCS36510\device\cmsis_nvic.c

Note - cmsis_nvic.c and cmsis_nvic.h were initial removed in
(and restored from) the commit:
b97ffe8fdc -
"CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation"
2017-06-11 09:48:30 +01:00
Russ Butler 44bb5bec0b Change NUCLEO_L031K6 to M0+
Change the core type of the NUCLEO_L031K6 from an M0 to an M0+
so NVIC_SetVector works correctly.
2017-06-11 09:48:29 +01:00
Aksel Skauge Mellbye ceecd123f8 Enable dynamic heap with ARMCC
When using ARM Compiler 5, the RTX config hard-coded the heap and stack
sizes to specific values. This prevented the RTX HAL from dynamically
allocating unused memory as heap space.

Specifically, the HEAP_START define prevents this logic in RTX_CM_lib.h
from activating. The rest of the defines are also set in that header,
and should be removed from here.
2017-06-11 09:48:26 +01:00
Mahadevan Mahesh 745a1ed17d Fix comments in KW41Z hardware entropy driver
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-06-11 09:48:26 +01:00
Mahadevan Mahesh a86ea3d520 Add TRNG support for KW41Z
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-06-11 09:48:26 +01:00
Andreas Larsson 7a6dba69eb Fixed wrong stack size start 2017-06-11 09:48:25 +01:00
Andreas Larsson cb08d6f14c Fixed comment, 439ZI to more generic 439xI 2017-06-11 09:48:25 +01:00
Andreas Larsson a8c5e71897 Fixed comment alignments 2017-06-11 09:48:25 +01:00
Andreas Larsson 656b9b0f70 Added MBED_APP_START and MBED_APP_SIZE used by the app when a boot loader is present 2017-06-11 09:48:24 +01:00
Andreas Larsson aa6aa82471 Rebase of: 2d2f0a0b5c
Added missing bootloader_supported for NUCLEO_F439ZI
2017-06-11 09:48:24 +01:00
Aksel Skauge Mellbye c9b8bee5ad Bugfixes to using bootloader with Series 1 devices. 2017-06-11 09:48:23 +01:00
Aksel Skauge Mellbye 7550f62777 Fix compile warnings and ticker test failure
* Using PinName as bitfield doesn't work without warnings, since NC
  needs all 32 bits to be represented.
* lp_ticker should not be freed when interrupt is disabled, since this
  will kill the timebase.
2017-06-11 09:48:23 +01:00
Andrzej Puzdrowski 98bb2472fd change: trng_get_bytes returns at last one random byte. 2017-06-11 09:48:22 +01:00
Andrzej Puzdrowski 75bfbcf056 fix non-blocking mode of TRNG driver improve coding style. 2017-06-11 09:48:22 +01:00
kl-cruz b26fcf489c Fixed length in trng in every mode 2017-06-11 09:48:22 +01:00
kl-cruz 045718c9c2 added trng implementation for nrf52840 2017-06-11 09:48:21 +01:00
Steven Cooreman 80ad824e7d Add behavior to throw away collected entropy on occurrence of a noise alarm. 2017-06-11 09:48:21 +01:00
Steven Cooreman bb2d4e3078 Remove internal test functions 2017-06-11 09:48:21 +01:00
Steven Cooreman 062ae8ceee Update to 4 spaces/tab 2017-06-11 09:48:21 +01:00
Steven Cooreman fcfb7de98d Remove leftover comment about mbedTLS plugin 2017-06-11 09:48:20 +01:00
Steven Cooreman aaac6adaa9 Add TRNG support
Adding support for the TRNG peripheral present on Series 1 Configuration 2 devices.
2017-06-11 09:48:20 +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
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
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