Commit Graph

1117 Commits (11b6a4eaf9f1b047e83c693f8d1e036f16a037d4)

Author SHA1 Message Date
svastm 26251314c5 [NUCLEO_L432KC] Add CMSIS target 2016-06-30 14:48:06 +02:00
Jarek Zgoda e7209fea53 Rename field in targets.json, missing features removed 2016-06-30 12:36:19 +02:00
Jarek Zgoda 811530796b Rename "generic" -> "bluepill" (common name) 2016-06-30 12:36:19 +02:00
Jarek Zgoda 2f6314c2d0 This board does not claim Arduino compatibility 2016-06-30 12:36:19 +02:00
Jarek Zgoda 3006f70552 Support for Blue Pill 2016-06-30 12:36:18 +02:00
Laurent MEUNIER f1ccebb28b [NUCLEO_F746ZG] Add Arduino Form Factor property 2016-06-30 10:47:30 +02:00
Andrzej Puzdrowski 02bc98aecf Merge branch 'nordic_sdk_integration' of https://github.com/ARMmbed/mbed-nordic into nordic_sdk_integration
# Conflicts:
#	hal/targets.json
2016-06-30 10:39:38 +02:00
Andrzej Puzdrowski adf15c8117 CR of AnalogIn 2016-06-30 09:32:48 +02:00
Sam Grove 07958da38b Merge pull request #2065 from NXPmicro/K22_KL27_Updates
K22 kl27 updates
2016-06-29 22:24:35 -05:00
Andrzej Puzdrowski 9d137c834c AnalogIn for nRF52 add u16 readout API realization. Polish rest of the code. 2016-06-29 15:23:11 +02:00
Andrzej Puzdrowski f19efb6a43 AnalogIn for nRF51 Fixes
multiinstances was not suported for nrf51
made nrf_saadc SDK hal private for nRF52
2016-06-29 12:29:38 +02:00
tomoyuki yamanaka 355e9775f8 In targets.json, add the "IPV4" setting for RZ_A1H
We added "IPV4" of Compile Macro in "targets.json" file.
We failed in the reletion test of IPV4 because "IPV4" was not entered into our Build Target setting.
2016-06-29 15:31:07 +09:00
Andrzej Puzdrowski 44bef4100e AnalogIn api implenetation for nRF52 - supplement in target descriptor 2016-06-29 08:04:33 +02:00
Sam Grove 737a7809f9 Merge pull request #2063 from geky/fix-heap
Removed heap region from ARM sct file on K devices
2016-06-28 20:54:33 -05:00
Christopher Haster 1bf641d6b3 Removed heap region from ARM sct file on K devices
- __heap_size__ was used to allocate a fixed size region for the heap in
  RW_IRAM1
- __user_setup_stackheap in sys.cpp uses Image$$RW_IRAM1$$ZI$$Limit as the
  start of the heap, which leaves the fixed size region unused
2016-06-28 20:16:19 -05:00
Sam Grove 0cf924429a Merge pull request #1952 from adustm/b_f7ethernetnew
[NUCLEO_F746ZG] add IPV4 support for F7 in mbed
2016-06-28 17:47:35 -05:00
Sam Grove c6db458ff6 Merge pull request #2014 from TomoYamanaka/master
RTX - init sequence (C++ array init) for Cortex-A version
2016-06-28 17:45:57 -05:00
Sam Grove a773b639d6 Merge pull request #2013 from egostm/spi_freq_selection
Spi freq selection
2016-06-28 17:43:43 -05:00
Sam Grove a6f640c3f8 Merge pull request #2009 from MultiTechSystems/mdot-leds-fix
[MTS_MDOT_F411RE] add LED2-LED4 definitions
2016-06-28 17:40:42 -05:00
Mahadevan Mahesh 096a48bebe Enable PORTIN, PORTOUT and PWMOUT for KL27
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-06-28 15:15:03 -05:00
Mahadevan Mahesh f15a178be0 Set the clock source in KL27 PWMOUT driver
By default the TPM clock source is disabled

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-06-28 15:14:58 -05:00
Andrzej Puzdrowski 63bfe7dc1b Merge branch 'nordic_sdk_integration' of https://github.com/nvlsianpu/mbed-nordic into nordic_sdk_integration 2016-06-28 17:35:55 +02:00
Andrzej Puzdrowski eef471bee4 AnalogIn api implenetation for nRF52 2016-06-28 17:31:49 +02:00
Głąbek, Andrzej 3ff34ef58d Merge branch 'nordic_sdk_integration' into hal_improvements
# Conflicts:
#	hal/targets.json
2016-06-28 12:13:50 +02:00
Andrzej Puzdrowski 1c262e3444 remove unwanted initialization of adc_value 2016-06-28 11:58:18 +02:00
adustm 941eca961f Bug fix for MBED_16 on STM32F7 family 2016-06-28 11:11:58 +02:00
Martin Kojtal 05b8db418a Merge pull request #2025 from pan-/nrf51_nano
Use nano lib by default for nrf51 based targets.
2016-06-28 10:12:54 +02:00
Colin Hogben 9455e89b8e [K64F] serial_api.c: Fix #1979 assertion error for ParityEven 2016-06-28 06:04:16 +01:00
adustm 53ff006f53 Add timeinfo.tm_isdst = -1 to pass MBED_16 test with IAR. 2016-06-27 17:17:05 +02:00
Vincent Coubard dbc6b34bc2 Use nano lib by default for nrf51 based targets. 2016-06-27 14:34:33 +01:00
Andrzej Puzdrowski 5ba9392280 Merge branch 'nordic_sdk_integration' of https://github.com/nvlsianpu/mbed-nordic into nordic_sdk_integration
# Conflicts:
#	hal/targets.json
2016-06-27 12:42:13 +02:00
tomoyuki yamanaka d6624c078a RTX - init sequence (C++ array init) for Cortex-A version
This is an update to RTX kernel for Cortex-A version to allow c++ libc array init to be called after kernel start.
Ref: https://github.com/mbedmicro/mbed/pull/1730
2016-06-27 19:40:22 +09:00
Andrzej Puzdrowski a664be0347 Fix AnalogInput fo nRF51. 2016-06-27 12:28:17 +02:00
Erwan GOURIOU bc08631931 [STM32L4xx] Change SPI clock selection
Update of STM32L4 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU 67e6f729c7 [STM32L1xx] Change SPI clock selection
Update of STM32L1 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU b126d345d1 [STM32L0xx] Change SPI clock selection
Update of STM32L0 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU e8103fbb94 [STM32F7xx] Change SPI clock selection
Update of STM32F7 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU c87ff7872a [STM32F3xx] Change SPI clock selection
Update of STM32F3 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency

Signed-off-by: Erwan GOURIOU <frq07517@st.com>
2016-06-27 10:03:57 +02:00
Erwan GOURIOU 837cb78b39 [STM32F1xx] Change SPI clock selection
Update of STM32F1 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU 0739d31235 [STM32F0xx] Change SPI clock selection
Update of STM32F0 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Erwan GOURIOU b574bb5048 [STM32F4xx] Change SPI clock selection
Update of STM32F4 family CPI clock selection algo.
Maximum SPI clock is obtained from APB domain clock (based on HAL API).
Then algo sets maximum frequency available below requested frequency
2016-06-27 10:03:57 +02:00
Sam Grove 245d4b8deb Merge pull request #2003 from rgrover/PR
minor fix for a warning when compiling with ARMCC
2016-06-26 00:48:49 -05:00
Mike Fiore e10feb7724 [MTS_MDOT_F411RE] add LED2-LED4 definitions 2016-06-24 16:38:32 -05:00
Sam Grove e508525bd4 Merge pull request #2000 from egostm/STM32F4xx_ADC2_support
[STM32F4] Add ADC2 support to F4 family
2016-06-24 16:15:30 -05:00
Głąbek, Andrzej 1357fb0ffc Polished ticker related code. 2016-06-24 16:30:11 +02:00
Rohit Grover b12f0c2ad2 take care of a compiler warning 2016-06-24 15:21:04 +01:00
Rohit Grover 7b110f077e make use of symbol BLOCK1_SIZE to replace a naked constant 2016-06-24 15:21:04 +01:00
Rohit Grover 0c5a7beb20 white space diffs 2016-06-24 15:21:03 +01:00
Rohit Grover 717651eb3f add better comments to the #if blocks guarding KSDK2 support 2016-06-24 15:21:03 +01:00
Laurent MEUNIER db7628c4b6 [STM32] Add SPI defaults pins to DISCO_F429ZI 2016-06-24 15:06:59 +02:00
Głąbek, Andrzej ba863f4e3d Enabled I2C_ASYNCH. 2016-06-24 09:02:29 +02:00
Głąbek, Andrzej 3bdbccb5c0 Corrected serial_api implementation, so 'serial_putc' no longer requires enabled interrupts. 2016-06-24 08:27:52 +02:00
Laurent MEUNIER 0f49396a0a [STM32F4] Add ADC2 support to F4 family
Introducing ADC2 support for NUCLEO_F446ZE implies to have the support
in the core part for all F4 chipsets that possibly support it (even if
not supported on all boards).
2016-06-23 17:08:22 +02:00
Głąbek, Andrzej f880312477 Merge branch 'nordic_sdk_integration' of https://github.com/ARMmbed/mbed-nordic into nordic_sdk_integration
# Conflicts:
#	hal/targets.json
#	hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822/system_nrf51.c
#	hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/system_nrf52.c
2016-06-23 07:03:18 +02:00
Głąbek, Andrzej 601b96dde2 Restored alternative method of RTOS tick generation for NRF51, which was undesirably removed when the new us_ticker implementation was introduced. 2016-06-22 15:09:54 +02:00
Głąbek, Andrzej 6c7d15d381 Re-enabled SPI after adjusting HAL implementation to slightly different API. 2016-06-22 13:55:36 +02:00
Sam Grove 3f5ab2fbb1 Revert "cfstore flash-journal integration with config_system (Resubmitted)" 2016-06-21 17:32:57 -05:00
Michel Jaouen 0c7b6dced5 [TARGET_STM32F3]: Update Hal 1.5.0 2016-06-21 11:46:34 +02:00
Andrzej Puzdrowski 05fea6e286 Corection in macros for NRF5x devices
Remove duplicated macro "BLE_STACK_SUPPORT_REQD" for MCU_NRF51
add macro "S132" for MCU_NRF52
2016-06-21 09:13:20 +02:00
Simon Hughes f299b113bb Adding K64F config properties while retaining additional targets LOWPOWERTIMER 2016-06-17 17:33:39 +01:00
Simon Hughes 6d76dacef7 cfstore flash mode set to async by default 2016-06-17 17:16:23 +01:00
Simon Hughes e5c081e23f cfstore flash mode set to sync by default 2016-06-17 17:16:21 +01:00
Simon Hughes 8f6957e195 cfstore flash-journal integration sync mode test fixes. 2016-06-17 17:16:19 +01:00
Bogdan Marinescu 8e8f389d3a Merge pull request #1876 from geky/newline-conversion
Add newline conversion for stdout
2016-06-17 13:29:56 +03:00
Vincent Coubard daf7ef352d Import assert fix from mbed v3. 2016-06-17 11:26:48 +01:00
Vincent Coubard d1b902a46d Update NRF51 link and startup sequence.
* Update softdevice offset so they match the offset of sd 2.0.
* Update RAM initialization sequence.
* Import fs_data section in final binary
2016-06-17 11:26:46 +01:00
Vincent Coubard 3fe77a5efe Fix known BUG in nrf_svc.h when compiled by GCC. 2016-06-17 11:26:44 +01:00
Vincent Coubard 96b2604469 Remove obsolete softdevices. 2016-06-17 11:26:42 +01:00
Vincent Coubard 10c803ee3b Add LF clock initialization in startup sequence. 2016-06-17 11:26:40 +01:00
Vincent Coubard 38671de942 Remove unused BLE services. 2016-06-17 11:26:38 +01:00
Vincent Coubard 1b826f286b Namespace softdevice headers to avoid conflict wih other headers. 2016-06-17 11:26:25 +01:00
Vincent Coubard 7ad0af3265 Enable BLE feature on NRF51 and nrf52.
Update softdevice references.
Add BLE and softdevice related macros.
Add specific macros for NRF52_DK.
2016-06-17 11:02:37 +01:00
Vincent Coubard c8dc17aa4f Import radio notification from the nordic SDK (required y BLE
implementation).
2016-06-17 11:00:24 +01:00
Christopher Haster 54609f6d62 Added default value for MBED_CONF_CORE_STDIO_CONVERT_NEWLINES 2016-06-17 03:54:39 -05:00
Martin Kojtal abf9850559 Merge pull request #1796 from BartSX/lptickerF0
[STM32F0xx] LowPowerTicker implementation
2016-06-17 09:51:09 +01:00
Bartosz Szczepanski 4b5a3175f9 [STM32F0xx] Enable LowPowerTimer
Change-Id: Id23b9d3a0f9a9a3c8a8501a4ba8de6256bc591dd
2016-06-17 08:30:15 +02:00
Bartosz Szczepanski c094dcd960 [STM32F0xx] LowPowerTicker implementation
Change-Id: I3eb37aa7e35df901b7d3cd00069638425fb3fdc6
2016-06-17 08:18:37 +02:00
Sam Grove a07a118410 Merge pull request #1961 from 0xc0170/spi_order_name
spi hal - specify default bit order
2016-06-17 00:05:38 +01:00
Andrzej Puzdrowski 441a665302 fix implemet pwm_write 2016-06-16 18:53:39 +01:00
Andrzej Puzdrowski 4fcffd40b1 fix pwm hal implemenation for nRF51.
PwmOut::pwm renamed to PwmOut::pwm_name
2016-06-16 17:23:35 +01:00
Martin Kojtal 42bc1a43ee Merge pull request #1890 from bcostm/fix_f0_force_serial_reset
[STM32F0] Add USART force/release Reset at Init phase
2016-06-16 17:10:30 +02:00
Martin Kojtal b79e95ab7e Merge pull request #1894 from bcostm/fix_f3_force_serial_reset
[STM32F3] Add USART force/release Reset at Init phase
2016-06-16 17:07:31 +02:00
Martin Kojtal 39acdd66a0 Merge pull request #1945 from jeromecoutant/PR_UpdateF0_driver_v1_6_0
STM32Cube_FW_F0_V1.6.0
2016-06-16 17:06:10 +02:00
0xc0170 50663758f0 spi hal - specify default bit order 2016-06-16 15:31:17 +01:00
Martin Kojtal b4bb088876 Merge pull request #1960 from AlessandroA/fix_volatile_missing
K64F KSDK2: Re-add missing volatile in CLOCK functions
2016-06-16 15:52:21 +02:00
Martin Kojtal 9836fedd33 Merge pull request #1915 from anpilog/master
Fix pin mode for STM32F1 target.
2016-06-16 15:22:16 +02:00
Alessandro Angelino 75fa7af17c K64F KSDK2: Re-add missing volatile in CLOCK functions
A previous patch removed two `volatile` keywords by mistake, which are
here re-introduced.

Fixes:

* 23904e7 "Access MCG and SIM through secure access"
2016-06-16 13:18:24 +01:00
Głąbek, Andrzej 52b9563e56 Added modifications in SDK drivers needed for mbed HAL implementation. 2016-06-16 12:09:24 +01:00
Christopher Haster 1480c231e9 Added config option for newline conversion 2016-06-15 21:14:26 -05:00
Christopher Haster 2330dcc49a Added newline conversion for stdin
stdin converts the following character sequences:

\n   -> \n
\r\n -> \n
\r   -> \n
\n\r -> \n

For original behaviour, a serial object can be instantiated explicitly
2016-06-15 20:58:30 -05:00
Christopher Haster 69c33625eb Added newline conversion for stdout
stdout converts the following character sequences:

\n   -> \r\n
\r\n -> \r\n
\r   -> \r
\n\r -> \n\r

For original behaviour, a serial object can be instantiated explicitly
2016-06-15 20:58:30 -05:00
Głąbek, Andrzej 082fd409ce Added LF clock starting code to SysInit. 2016-06-15 21:43:38 +01:00
Głąbek, Andrzej df6bd2f66c Changed the drivers HAL implementations to the ones using NRF5 SDK, moved nrf_drv_config.h to MCU specific targets, updated lists of device features, so non-compiling stuff is excluded from build. 2016-06-15 20:56:03 +01:00
Bogdan Marinescu 74270b2a94 Added feature list for K64F
IPv4 driver exists on the build tree, so enabling it.

Signed-off-by: Seppo Takalo <seppo.takalo@arm.com>
2016-06-15 20:53:08 +03:00
Głąbek, Andrzej 96a175973d Updated device definition file for NRF52_DK target. 2016-06-15 18:06:13 +01:00
Głąbek, Andrzej 2eaa468c50 Added missing SDK drivers, added SOFTDEVICE_PRESENT macros in targets definitions. 2016-06-15 17:51:40 +01:00
adustm fa55f1b56f [NUCLEO_F746ZG] Enable Ethernet feature for mbed-os 2016-06-15 18:45:57 +02:00
Vincent Coubard 216fa9dfa7 Introduce nordic SDK v11, cleanup path and targets. 2016-06-15 16:43:06 +01:00
Vincent Coubard f2c4b770fd Factorization of NRF51 and NRF52 targets.
A new wbase target has been added (NRF5).
In this target, commonalities between 51 and 52 will be shared.
2016-06-15 12:30:04 +01:00
Vincent Coubard 70ffeb61be Add softdevice S132 binary for nrf52 targets. 2016-06-15 11:27:44 +01:00
Vincent Coubard a3b9c78df6 Update detection code for NRF52. 2016-06-15 11:26:53 +01:00
Vincent Coubard 9d85bfda25 Implementation of nrf52 target (draft). 2016-06-14 22:39:45 +01:00
Vincent Coubard 9d66dca950 Add NRF52 and NRF52_TARGETS. 2016-06-14 22:39:06 +01:00
Martin Kojtal 9b5adb8cd1 Merge pull request #1752 from svastm/add_nucleo_l011k4
Add NUCLEO_L011K4
2016-06-14 22:00:28 +02:00
Martin Kojtal 53d7115b49 Merge pull request #1895 from bcostm/fix_l0_force_serial_reset
[STM32L0] Add USART force/release Reset at Init phase
2016-06-14 21:53:45 +02:00
Martin Kojtal 4dcefa604a Merge pull request #1913 from BartSX/816f0xx
[STM32F0xx] Fix for #816 issue
2016-06-14 21:53:26 +02:00
Martin Kojtal 1f9d28346f Merge pull request #1924 from 0xc0170/fix_armcc
Fix armcc ulib template - removal
2016-06-14 20:06:26 +02:00
Jaeden Amero af572350f0 Don't call __disable_irq for uVisor
This is a hack to get debug builds applications that use uVisor to work.
The assertions in core_util_critical_section fail because interrupts can't
actually be disabled from unprivileged mode.

Without this hack, core_util_critical_section_enter() calls
mbed_assert_internal() when the assertion fails, which calls
core_util_critical_section_enter() again, which calls
mbed_assert_internal() again; this is infinite recursion.

core_util_critical_section_enter needs some fixing.
2016-06-14 14:09:56 +00:00
Niklas Hauser 516c7cdb80 Rename NVIC_Set/GetVector for K64F
This allows FEATURE_UVISOR to virtualize the NVIC calls.
2016-06-14 14:06:45 +00:00
Niklas Hauser e4c217e21d Backport virtual NVIC mechanism from CMSIS 5 2016-06-14 14:06:45 +00:00
Niklas Hauser 23904e74be Access MCG and SIM through secure access 2016-06-14 14:06:45 +00:00
Niklas Hauser 37238fb9be Add secure access header to CMSIS 2016-06-14 14:06:44 +00:00
Alessandro Angelino 8db93cf0d9 K64F: Explicitly set the start of .uvisor.bss 2016-06-14 14:06:44 +00:00
Alessandro Angelino abd24ae4f1 K64F: Explicitly set the start of .text
If you don't specify the start address of a section explicitly, that
section can end up at different addresses depending on its alignment. If
the alignment of a section is not explicitly set, it inherits it from
the element with the highest alignment inside that section.

Since the uVisor code is in the .text section, and it *must* end up at a
known location, we set the start address of .text to 0x410, which is the
value that the uVisor binary expects.
2016-06-14 14:06:44 +00:00
Brian Daniels 8bbc163d3f Removing K64F_UVISOR target 2016-06-14 05:00:19 +01:00
Martin Kojtal e9b56018d2 Merge pull request #1848 from TomoYamanaka/master
Implement SystemcoreClock
2016-06-14 01:53:10 +02:00
0xc0170 269697d6d4 targets - remove ulib template
armcc provides command line option for choosing a lib type, and we use this,
thus a template is not needed.
2016-06-14 00:41:45 +01:00
Martin Kojtal ab5bd795a4 Merge pull request #1920 from 0xc0170/fix_inclusion
Fix inclusion (board.c and critical.c)
2016-06-14 01:10:06 +02:00
Martin Kojtal 9a06a7509b Merge pull request #1921 from akselsm/efm32-license-update
[EFM32] Update license texts.
2016-06-14 00:30:26 +02:00
Aksel Skauge Mellbye 8bdfb6c71d [EFM32] Update license texts. 2016-06-13 23:23:58 +01:00
Martin Kojtal f03943ccf6 Merge pull request #1889 from svastm/fix_rtos_uarm_l4
[STM32L4XX] Fix heap size for RTOS on uARM
2016-06-13 23:40:37 +02:00
0xc0170 81a7bdc482 critical - fix __STDC_LIMIT_MACROS for armcc
UINT32_MAX is defined only if __STDC_LIMIT_MACROS is provided prior
including stdint.h
2016-06-13 22:14:13 +01:00
0xc0170 3b2d75fcda error - include interface header file
to get mbed_error_vprinf() declaration
2016-06-13 21:54:44 +01:00
Vincenzo Frascino f8d7a76128 [BEETLE] Enable RTOS on Beetle
This patch enables RTOS support on Beetle.
It contains:
* Updated Beetle Startup code for ARMCC
* Modified SysTick Driver
* RTOS specific configuration parameters
* RTOS specific test suite enablement

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 16:21:19 +01:00
Martin Kojtal 89c1bef1b1 Merge pull request #1916 from c1728p9/fix_gcc
Fix GCC malloc lock
2016-06-13 16:17:02 +02:00
Russ Butler 8c2e352dd8 Fix GCC malloc lock
The malloc lock functions were not declared as extern "C" so they
are not getting linked to the standard library.  Add extern "C" to
fix this.

This bug was introduced in the commit:
d0b7b3b497 -
Fix duplicate symbols for malloc lock and unlock
2016-06-13 15:00:42 +01:00
Vincenzo Frascino ce1c2c780a [BEETLE] Add LED Emulation
The current version of MBED test environment requires LEDs to be present
in the platform.

Beetle HW does not provide any user programmable LEDs. This patch provides an
emulation of the feature by using dummy PINs.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 14:26:49 +01:00
Vincenzo Frascino c1442139a0 [BEETLE] Add support for uVision 5 exporter
This patch adds support for uVision 5 exporter to the Beetle Target.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 14:26:45 +01:00
Vincenzo Frascino 09b5551d41 [BEETLE] Add initial Beetle HAL files
This patch adds support for BEETLE SoC Target into the HAL layer.
It contains:
* Beetle Platform Configuration
* I2C API
* SPI API
* Serial API
* Port API
* us Ticker API

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 14:26:30 +01:00
Andrii Anpilogov 9c0d45598e Fix pin mode for STM32F1 target. Failed for pin_index 0 (PA_0, PB_0, PC_0). 2016-06-13 20:47:25 +08:00
Vincenzo Frascino 44be0626a6 [BEETLE] Add initial Beetle CMSIS files
This patch adds support for BEETLE SoC Target into the CMSIS layer.
It contains:
* Beetle System Core
* APB DualTimer Driver
* APB Timer Driver
* eFlash Driver
* Flash Cache Driver
* ARM Toolchain Support
* GCC ARM Toolchain Support

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 11:56:14 +01:00
Vincenzo Frascino 0d3268b61c [BEETLE] Add initial support
This patch adds support for the BEETLE Target. The compilers supported by
this target are:
* ARMCC
* GCC ARM

The exporters and the CMSIS/HAL components will follow in future patches.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 11:55:33 +01:00
Maciej Bojczuk bb65961089 [NUCLEO_F030R8] Set NVIC Timer priorities
This fix is a solution for issue #816 when having two separate IRQ handlers
in Timers (UPDATE Irq and OutputCompare Irq). The update priority needs to
be higher to avoid undefined behaviours.

Change-Id: Ic143ed0f3e4e42ad5f7b95337d8c005b7ec61274
2016-06-13 11:27:37 +02:00
Maciej Bojczuk 899cd44619 [NUCLEO_F070RB] Set NVIC Timer priorities
This fix is a solution for issue #816 when having two separate IRQ handlers
in Timers (UPDATE Irq and OutputCompare Irq). The update priority needs to
be higher to avoid undefined behaviours.

Change-Id: I5ef2c27926167ed22108901cd63586692a5f8f90
2016-06-13 11:27:37 +02:00
Bartosz Szczepanski 91422cb7e1 Revert "[NUCLEO_F030R8] 16-bit timer register update"
This reverts commit 01ff0b9ab7.
2016-06-13 11:27:37 +02:00
Bartosz Szczepanski ff1c172696 Revert "[NUCLEO_F070RB] 16-bit timer register update"
This reverts commit 82d82d0b2a.
2016-06-13 11:27:37 +02:00
Bartosz Szczepanski 3222d07d35 Partial revert of "[STM32Fxxx] Fix issue #816"
This is a partial revert of 07b841b and currently we are only reverting the
STM32F0xx family because new fix will be presented that's why we want to keep,
still the original solution only F1xx family (it will be fixed in future).

Change-Id: I147065299310c9fea499bf3ced8808a44699a1a1
2016-06-13 11:26:45 +02:00
svastm dd829053f9 [NUCLEO_L011K4] Move device.h defines to target.json 2016-06-13 10:30:18 +02:00
svastm c9bf3ca2fd [NUCLEO_L011K4] Add to the build and export scripts 2016-06-13 10:24:19 +02:00
svastm 062962a215 [NUCLEO_L011K4] Update HAL API 2016-06-13 10:24:19 +02:00
svastm f38c5e47f9 [NUCLEO_L011K4] Add HAL target 2016-06-13 10:24:19 +02:00
svastm c951f59993 [NUCLEO_L011K4] Add CMSIS target 2016-06-13 10:24:19 +02:00
Sam Grove 5acdad9fd7 Merge pull request #1907 from c1728p9/only_allow_one_thread_for_unsafe_stdlib
Only allow one thread for unsafe stdlib
2016-06-12 22:03:07 +01:00
Russ Butler 58d15f3007 Add virtual destructor to classes
Add a virtual destructor to classes which have a virtual lock and
unlock.  Remove the virtual qualifier from functions in
InterruptManager since this class cannot be extended.
2016-06-12 21:33:31 +01:00
Russ Butler d0b7b3b497 Fix duplicate symbols for malloc lock and unlock
When the malloc lock and unlock functions are inside a library they
conflict with the standard libraries weak version of these functions.
This is because of the way weak references are handled by the linker.
This patch renames the lock and unlock functions defined inside RTX
so they do not conflict.  A thunk inside retarget.cpp then calls the
RTX functions.  This problem does not occur with retarget.cpp since
it is always build into an object file rather than a library file.
2016-06-12 18:18:41 +01:00
Russ Butler 3db2c030d2 Only allow one thread on unsafe standard libs
When using a standard library which does not support multi-threading
allow only one thread to be used.  This allows the code to remain
safe.
2016-06-12 18:18:40 +01:00
Sam Grove 4dba251c33 Merge pull request #1896 from geky/align-stack-iar
Added warning about stack alignment limitations on IAR
2016-06-12 17:45:34 +01:00
Sam Grove df0c855df9 Merge pull request #1904 from sg-/iar-lpc-eth-patch
rename section used for eth and usb
2016-06-11 18:25:01 +01:00
Russ Butler b174d6a314 Add virtual lock for thread safe classes
Add a virtual lock for the classes which are thread safe.  This
allows the use of a mutex to be overridden.
2016-06-11 17:33:12 +01:00
Russ Butler e4f6e1b327 Update assert and error to be interrupt safe
Add printf functions intended for errors which are safe to call from
interrupts.  Update assert and error to use this function.
2016-06-11 17:33:10 +01:00
Russ Butler a6f611b706 Add sync level documentation to classes
Document public classes to indicate level of protection provided.
2016-06-11 17:33:09 +01:00
Russ Butler feb60784e9 Make core mbed API thread safe
Make the mbed C++ API thread safe by adding a combination of
mutexes and critical sections.  Stub out all mutexes when the
RTOS is not present.
2016-06-11 17:33:02 +01:00
Sam Grove 50c106f718 rename section used for eth and usb 2016-06-11 07:11:09 -07:00
Sam Grove dc1c716618 Merge pull request #1897 from pan-/fix_nrf51_rtos_ticker
Fix function RTOS ticker of nrf51 port
2016-06-10 17:59:50 +01:00
Alessandro Angelino a076f9a415 K64F: Add call to uvisor_init() in the startup code
This is backwards-compatible with unsupported targets.

If an application is compiled using the K64F target without uVisor
(UVISOR_PRESENT not set or set to 0) then uvisor_init() will just be an
empty function that immediately returns.
2016-06-10 16:56:17 +01:00
Alessandro Angelino 6aeafab6b3 K64F: Add page allocator sections to linker script
These changes are backwards compatible.

Targets that do not use the page allocator heap will have the same stack
and heap sizes available.
2016-06-10 16:56:17 +01:00
Alessandro Angelino eb9d124230 K64F: Add uVisor sections to the linker script
This commit includes all sections that are just added to the linker
script. These changes are backwards-compatible, meaning that they will
not affect the existing code.

Targets that do not support uVisor will leave those sections empty.
2016-06-10 16:56:17 +01:00
Niklas Hauser f81cf5d686 Add default implementation of malloc wrapping
For GCC malloc is always wrapped, but only used for FEATURE_UVISOR.
Otherwise we have to simply forward the wrappers.
2016-06-10 16:56:17 +01:00
Jaeden Amero 5d48984914 Initialize uvisor-lib
uvisor-lib has an init function that must be called before the RTOS kernel
is initialized. Call uvisor_lib_init from software_init_hook to accomplish
this.
2016-06-10 16:56:17 +01:00
Jaeden Amero 43e595aec3 Wrap software_init_hook
Wrap software_init_hook so that it can be used or extended from outside the
RTOS. This is desirable so that code can be added to the software_init_hook
without making the RTOS depend on new features or libraries.
2016-06-10 16:56:17 +01:00
Vincent Coubard 6315f8e486 Fix function is_in_wrapped_range, the function where returning false when
instead of true when begin <= val < end. The documentation was correct but
not the code.
2016-06-10 14:46:11 +01:00
bcostm 6e645e50e8 Add USART force/release Reset at Init phase 2016-06-10 11:56:42 +02:00
bcostm ec36ce72c8 Add force/release reset during Serial init phase 2016-06-10 11:26:15 +02:00
svastm fe2871b8bd [STM32L4XX] rename startup file to .S 2016-06-10 09:48:55 +02:00
svastm a1b9e560e2 [STM32L4XX] Fix heap size for uARM 2016-06-10 09:48:55 +02:00
tomoyuki yamanaka 8f3e72f01c Implement SystemCoreClockUpdate () function 2016-06-10 16:16:06 +09:00
tomoyuki yamanaka 0a9e5fa3d6 Implement SystemCoreClockUpdate () function
We changed to calculare the CPU Clock by the division ratio setting of from FRQCR register.
2016-06-10 16:13:35 +09:00
Christopher Haster 0defc77fb7 Added warning about stack alignment limitations on IAR 2016-06-09 22:03:25 -05:00
Russ Butler 9d7ca3e405 KSDK2 - restore interrupts in InstallIRQHandler
Restore the state of interrupts inside InstallIRQHandler rather than
leaving them enabled.
2016-06-09 18:27:22 +01:00
bcostm 7e486d8d3b Add USART force/release Reset at Init phase 2016-06-09 17:16:06 +02:00
jeromecoutant 6c31f3c110 STM32Cube_FW_F0_V1.6.0
CMSIS v2.2.3 => v2.3.0
STM32F0 HAL v1.3.1 => v1.4.0
2016-06-09 17:14:02 +02:00
Martin Kojtal 24e767c10f Merge pull request #1888 from sg-/feature-label
Feature label
2016-06-09 15:40:46 +01:00
Sam Grove d71f015659 Added features to Target description to support the changed names and build extensions 2016-06-09 15:00:36 +01:00
Rohit Grover 527e305df5 the contents of Driver_Storage.h don't need to be guarded by #if DEVICE_STORAGE 2016-06-09 13:30:54 +01:00
Martin Kojtal 7d583e5541 Merge pull request #1853 from svastm/update_cube_l4
[STM32L4XX] Update HAL_Cube_L4 to 1.5.1
2016-06-09 11:35:35 +01:00
Martin Kojtal bead0173d9 Merge pull request #1881 from mbedmicro/rename_features
Rename "features" to "device_has" in targets.json
2016-06-09 11:32:21 +01:00
Martin Kojtal 2197b87cca Merge pull request #1886 from kjbracey-arm/gpio_no_fsl
Don't pull KSDK FSL libraries into apps
2016-06-09 11:12:09 +01:00
Martin Kojtal f7e6a0f9ca Merge pull request #1879 from sbutcher-arm/mbedtls-entropy-collector
Add entropy collector for K64F to mbed HAL for use in mbed TLS
2016-06-09 11:07:24 +01:00
Kevin Bracey ecff7753fc Don't pull KSDK FSL libraries into apps
Freescale KSDK2 gpio_object.h pulled in Freescale libraries to inline
some GPIO operations.

The resulting namespace pollution (status_t) doesn't seem to be worth
the function call overhead. Hopefully making the base address array
non-automatic will offset that loss.
2016-06-09 10:28:56 +01:00
svastm 92688edc31 [STM32L4XX] Reset UART on init 2016-06-09 11:25:51 +02:00
svastm 2f29b9af2e [STM32L4XX] Fix deinit of SystemCoreClock on ARM toolchain 2016-06-09 11:25:51 +02:00
svastm 32bca79452 [STM32L4XX] Init daylight saving time 2016-06-09 11:25:51 +02:00
svastm a29e15e07c [STM32L4XX] Update HAL_Cube_L4 to 1.5.1 2016-06-09 11:25:51 +02:00
Simon Butcher f450786174 Add entropy collector for K64F to mbed HAL for use in mbed TLS
mbed TLS requires an entropy source, and this provides support for one through
the K64F RNG.
The macro MBEDTLS_ENTROPY_HARDWARE_ALT also added to target.json to enable use
of the entropy collector by mbed TLS.
2016-06-09 00:51:14 +01:00
Bogdan Marinescu 05059a617f Rename "features" to "device_has" in targets.json
"features" will make more sense in the context of the feature support
that we'll introduce later (related to #1878). Plus, "device_has" is
arguably a better description of the actual content of this key.
2016-06-08 18:32:39 +03:00
Martin Kojtal d7a196e89e Merge pull request #1826 from jeromecoutant/PR_UpdateF0_driver_v1_5_0
[STM32F0] update Cube driver to v1.5.0
2016-06-08 14:11:59 +01:00
Martin Kojtal 5c60eb61d0 Merge pull request #1867 from rgrover/master
introduce the CMSIS Storage driver and its implementation for K64F
2016-06-08 13:56:27 +01:00
Martin Kojtal c9a15d0530 Merge pull request #1854 from pan-/nrf51_port
RTOS port for NRF51 targets
2016-06-08 13:52:32 +01:00
Rohit Grover 00feaa02f2 adding STORAGE to the list of device features for K64F 2016-06-08 12:16:00 +01:00
Rohit Grover 93564b6b57 add a missing extern to a global declaration of a status register 2016-06-08 11:23:44 +01:00
Rohit Grover 0986c54b20 guard code within DEVICE_STORAGE
as required by mbedmicro
2016-06-08 11:16:57 +01:00
Rohit Grover 0a9bba4eca rename intermediate folder from "storage-abstraction" to "storage_abstraction" 2016-06-08 11:15:40 +01:00
Bogdan Marinescu b368c4ac48 Add a K64F target with uVisor enabled
Also, remove UVISOR_SUPPORTED from the other targets.
2016-06-08 13:00:41 +03:00
Bogdan Marinescu 6cd41fd314 Add UVISOR_SUPPORTED to the K64F based targets 2016-06-08 12:36:07 +03:00
Mahesh Mahadevan 847d3aa37b Fix for Issue# 1834 (#1871)
Explicitly disable the config for differential conversion

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-06-08 09:39:00 +01:00
Bartosz Szczepanski 5562f9a40a [STM32] Move CAN device.h defines to targets.json
This patch moves all CAN defines, for all STM32 boards with CAN support, to
targets.json file.

Change-Id: Ic3335cd4237e646d849b3554de69a9048846b186
2016-06-08 09:24:46 +02:00
Martin Kojtal 02bb0df4dc Merge pull request #1797 from 0xc0170/dev_k64f_hal_additions
k64f - mac address - fix warnings - get UID via K64F SIM macros
2016-06-07 16:02:40 +01:00
Rohit Grover 4651075403 introduce the CMSIS Storage driver and its implementation for K64F 2016-06-07 13:36:51 +01:00
Russ Butler ec81bccb01 Fix support for InterruptManager on KSDK 2
Add the define NVIC_NUM_VECTORS for KSDK 2 targets so InterruptManager
is supported.
2016-06-07 09:56:15 +01:00
Martin Kojtal 2460907099 Merge pull request #1778 from 0xc0170/dev_hal_doxy
hal - adding doxygen documentation
2016-06-07 09:40:12 +01:00
Martin Kojtal 02ce61d802 Merge pull request #1774 from BartSX/can-devel-l4
[STM32L4xx] CAN development for STM32L4xx family
2016-06-07 07:45:42 +01:00
Martin Kojtal fc9bd4c27a Merge pull request #1858 from BartSX/f103
[NUCLEO_F103RB] Revert and update path for 16-bit timer
2016-06-06 17:39:18 +01:00
Jimmy Brisson 32075c38e4 added extra_labels_add checking to script
and moved a previously missed device.h file to targets.json
2016-06-06 10:33:58 -05:00
Bartosz Szczepanski f2c824cd54 [NUCLEO_F103RB] Revert and update path for 16-bit timer
Due to directory structure change, modification in e93878078 was made wrong
after rebasing the code.

This reverts commit e938780788 and updates path
to the correct file.

Note:
Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Continuation of patch: 07b841b08f

Change-Id: Iab0341847130f86e16500fd85024b6a87525fe14
2016-06-06 16:39:03 +02:00
Bartosz Szczepanski 10cce638a2 [NUCLEO_L476RG] Added CAN support
Added CAN API support for NUCLEO_L476RG target.

"stm32l476xx.h" file was changed to avoid compilation errors.

Change-Id: Ifadf7048f6c72c0311ec915e47ce2190460ede68
2016-06-06 16:20:46 +02:00
Bartosz Szczepanski 155d38ef9e [DISCO_L476VG] Added CAN support
Added CAN API support for DISCO_L476VG target.

*stm32l476xx.h* file was changed to avoid compilation errors.

NOTE: MBED_29 or MBED_30 cannot be tested on this platform because CAN pins are
soldered to USB, GYRO and others.

Change-Id: I2e85bd36dc45872b1ab617f072de98164f2c96f8
2016-06-06 16:19:11 +02:00
Bartosz Szczepanski 7a262f1b2d Added CAN API for STM32L4xx family
* STM32L4xx family have only one CAN bus

Change-Id: I95dcffac2176dba6d89850e24ba9561c11319f00
2016-06-06 16:04:31 +02:00
Martin Kojtal 0d3c83589b Merge pull request #1846 from jamike/fix-issue-1845
[NUCLEO_L476RG, DISCO_L476VG]: GCC_ARM, ARM_STD fix RTOS failed
2016-06-06 14:52:44 +01:00
Martin Kojtal 415521fdbb Merge pull request #1773 from BartSX/can-devel-f7
[STM32F7xx] CAN development for STM32F7xx family
2016-06-06 14:41:52 +01:00
Vincent Coubard 55a35f9b9b Use attributes from toolchain.h instead of compiler specific declaration. 2016-06-06 13:59:17 +01:00
Martin Kojtal cb24e38086 Merge pull request #1856 from 0xc0170/fix_critical_cortexa
Critical section - fix for cortex-a
2016-06-06 13:10:46 +01:00
Bartosz Szczepanski bafd20f561 [DISCO_F746NG] Added CAN support
Added CAN API support for DISCO_F746NG target.

Change-Id: I3b475309ab9b08c2e0ca1e8fe7e10489b8256321
2016-06-06 13:28:00 +02:00
Bartosz Szczepanski 4d22e94156 [NUCLEO_F746ZG] Added CAN support
Added CAN API support for NUCLEO_F746ZG target.

Change-Id: Ib9d416125671e3e1f1ef89e88e6da66f4c457f02
2016-06-06 13:28:00 +02:00
0xc0170 b5c4faf6f6 Critical section - fix for cortex-a
Cortex-A does not contain primask, there's 7th bit in the CPSR register,
that contains this information. Fixes #1851.

Renames primask variables to interrupts_disabled.
2016-06-06 12:17:29 +01:00
Bartosz Szczepanski 19f0c58514 Added CAN API for STM32F7xx family
Change-Id: I0f04f28d0d737e01eff737dfcab375c155d4f704
2016-06-06 13:10:47 +02:00
Bartosz Szczepanski 6e77543313 [NUCLEO_F103RB] Added CAN support
Added CAN API support for NUCLEO_F103RB target.

Change-Id: Ib5dac8023917afef683ba0703d732bbf53efdcd9
2016-06-06 13:00:03 +02:00
Bartosz Szczepanski 8b44c0d54b Added CAN API for STM32F1xx family.
* STM32F1xx family have only one CAN bus

Change-Id: Ie1c82a22e1483fc5d389b958d062f561770f9004
2016-06-06 12:53:51 +02:00
Russ Butler f3b1d45963 Add functions for atomic access
Add core util functions for atomic increment, atomic decrement and
compare and set.
2016-06-06 10:55:55 +01:00
Vincent Coubard e46b659799 Merge branch 'master' of https://github.com/mbedmicro/mbed into nrf51_port 2016-06-05 20:46:42 +01:00
Vincent Coubard c0a6c7c6d4 Better generation of heap section.
With this change, the heap section occupy the whole space from the end of
the bss section to the start of the stack section instead of taking a
fixed size in RAM.

This change allows applications to make a more efficient use of the RAM
available and allows application to be compiled if the space between end
of bss and start of stack is less than 2048 bytes.
2016-06-05 17:56:01 +01:00
Jimmy Brisson 66574aaa9d made features a first class citizen 2016-06-03 16:18:23 -05:00
Jimmy Brisson dbeee2ab69 added device MICRONFCBOARD's provides to targets.json 2016-06-03 14:08:50 -05:00
Jimmy Brisson 9cf326861b HUGE COMMIT WARNING device.h defines -> target.json features
one problem:
[WARNING] device APPNEARME_MICRONFCBOARD did not have an associated entry in targets.json
2016-06-03 14:08:40 -05:00
Jimmy Brisson 76e6c885a2 auto-formatted target.json 2016-06-03 14:03:50 -05:00
Michel Jaouen 4e5fe30bc1 [NUCLEO_L476RG, DISCO_L476VG]: GCC_ARM, ARM_STD fix RTOS failed,
INIT_STACK used to compute RTOS main stack inconsistant with sp set at reset
align heap, stack config with IAR
issue: #1845
2016-06-03 18:49:54 +02:00
Martin Kojtal 986225d2a8 Merge pull request #1838 from egostm/dev_F4_V1.12.0
[STM32F4xx] Update Cube hal to v1.12.0
2016-06-03 15:22:34 +01:00
Martin Kojtal f3d547e909 Merge pull request #1771 from BartSX/can-devel-f4
[STM32F4xx] CAN development for STM32F4xx family
2016-06-03 15:11:32 +01:00
Martin Kojtal 7c294554a2 Merge pull request #1784 from geky/attributes
Add useful attributes supported by supported compilers
2016-06-03 14:56:58 +01:00
Erwan GOURIOU e5a12ea505 [STM32F4][DISCO-F429ZI] LSE not soldered. Use LSI RTC 2016-06-03 15:48:25 +02:00
Erwan GOURIOU 2afce67e5c [STM32F4][V1.12.0] SystemCoreClock update
With ARM and uARM toolchains, SystemCoreClock is reset before UART init by libc.
Fix to perform SystemCoreClock init with UART init out of HAL init.
2016-06-03 15:48:25 +02:00
Erwan GOURIOU a9b27da409 [STM32F4] Update Cube FW to V1.12.0
CMSIS to V2.5.0
HAL to V1.5.0
2016-06-03 15:48:25 +02:00
Erwan GOURIOU 8e15a6cc55 [STM32F4][V1.11.0] Update serial_api.c to support new UART_HandleTypeDef
Following cube update, there has been changes in cube HAL that impact
the serial_api.c layer. The global state has been moved to separate
global/tx and rx states, so we can now differentiate both.
2016-06-03 15:48:25 +02:00
Laurent Meunier 8955b6690d [STM32F4] Update to cube V1.11.0
This cube version includes
 HAL to V1.4.4
 CMSIS to V2.4.3
2016-06-03 15:48:25 +02:00
Laurent Meunier 08733d131d [STM32F4] Update to cube V1.10.0
CMSIS to V2.4.2
HAL to V1.4.3
2016-06-03 15:48:25 +02:00
Bartosz Szczepanski 766b5c29e2 [DISCO_F429ZI] Added CAN support
Added CAN API support for DISCO_F429ZI target.

Change-Id: I54b7d0ed25baf179fd899087297f4b8e76fc040a
2016-06-03 15:13:39 +02:00
Bartosz Szczepanski ce781448b7 [DISCO_F469NI] Added CAN support
Added CAN API support for DISCO_F469NI target.

Change-Id: Icfc52ec532aa71412814f245b41494fa69df4430
2016-06-03 15:13:39 +02:00
Bartosz Szczepanski 96787cd79e [NUCLEO_F446RE] Added CAN support
Added CAN API support for NUCLEO_F446RE target.

Change-Id: I6e585fd5ef9e5395c1dc5b9c31d09427927a0021
2016-06-03 14:48:20 +02:00
tomoyuki yamanaka 1e2e14e11d Implement SystemcoreClock
We implemented SystemcoreClock which is defined in CMSIS.
2016-06-03 18:36:28 +09:00
Vincent Coubard 000e04d768 RTOS port for nrf51.
The NRF51 doesn't have a systick. When the MCU doesn't have a systick, the
HAL has to export several functions which will be use by the kernel to
manage the tick:

  * os_tick_init provides the initialization function for the alternative
    hardware timer.
  * os_tick_val returns the current value of the alternative hardware timer.
  * os_tick_ovf returns the overflow flag of the alternative hardware timer.
  * os_tick_irqack is an interrupt acknowledge function that is called to
    confirm the alternative hardware timer interrupt.

The HAL should also call OS_Tick_Handler needs to be called as the
hardware timer interrupt function.

In the case of the NRF51, two RTCs are available:
  * RTC0: reserved for soft device
  * RTC1: used by us_ticker.

RTC1 is a 4 channels timers, channel 0 is used for us_ticker, and
in this port channel 1 is used for tick generation.

Implementation notes:
  * RTC1_IRQHandler: has to be written in assembly otherwise a stack
    overflow will occur because the function OS_Tick_Handler never
    returns. This function is called when RTC1 channel IRQ is triggered.
  * tick generation has been optimised for a tick with a duration of
    1000us.
  * us_ticker can still be compiled and used without RTX enabled.

More information about alternative timer as RTX Kernel Timer:
https://www.keil.com/pack/doc/CMSIS/RTX/html/_timer_tick.html
2016-06-03 10:13:10 +01:00
Martin Kojtal bddce7ce7e Merge pull request #1847 from svastm/pr_1743_continuation
[STM32L0XX] SlaveCounter type correction
2016-06-03 10:09:43 +01:00
svastm d3c14f6bde [STM32L0XX] SlaveCounter type correction 2016-06-03 11:03:53 +02:00
Martin Kojtal 57645936ba Merge pull request #1811 from lindvalla/lpc4088_misc_fixes
Misc fixes for LPC4088/LPC4088DM:
2016-06-03 09:22:38 +01:00
0xc0170 2a19ddc9d1 Add lpc821 cocorico target
Added by @ElektorLabs PR #1840, squashed manually.
2016-06-03 09:20:30 +01:00
Martin Kojtal ff7d7aa337 Merge pull request #1776 from adamgreen/i2cRepeatedStartFix
Fix NXP LPCxxxx i2c_start() handling of repeated start
2016-06-03 08:18:28 +01:00
Martin Kojtal 5ac648f866 Merge pull request #1762 from BartSX/can-devel-f3
[STM32F3xx] CAN development for STM32F3xx family
2016-06-03 07:59:19 +01:00
Christopher Haster 5cdb151193 Changed MBED_PACKED to a macro
Supports both __packed and __attribute__((packed)) styles of attriubtes

MBED_PACKED(struct) foo {
    blablabla
};
2016-06-01 16:10:19 -05:00
geky a08d04c751 Fixed typo in FORCEINLINE definition on IAR
per @c1728p9
2016-06-01 15:27:26 -05:00
geky b7bcb931a8 Fix backwards compatibility for WEAK/PACKED attributes 2016-06-01 15:27:26 -05:00
Christopher Haster 4c7a4de673 Added MBED prefix to attributes 2016-06-01 15:27:26 -05:00
Christopher Haster 3f7fbe696d Added useful attributes supported by supported compilers
Merges compiler-polyfill into hal/api/toolchain.h following the existing
mbed conventions.

tested on:
- GCC
- Clang
- ARMCC (online compiler)
- IAR

attributes:
- PACK
- ALIGN
- UNUSED
- WEAK
- PURE
- FORCEINLINE
- NORETURN
- UNREACHABLE
- DEPRECATED
2016-06-01 15:27:26 -05:00
Russ Butler bd216c37cb Make the IAR standard library thread safe
Add the locks and flags necessary to make the IAR standard library
thread safe.  These changes consist of:
-Add compiler flag "--guard_calls" to ensure C++ function-static
    variables with dynamic initializers are initialized in a
    thread safe manner
-Add the linker flag "--threaded_lib" so the thread safe version of
    the standard library is used
-Implement mutex functions required for IAR thread safety
-Create a set of stub functions in retarget.c for when the rtos is not present
2016-05-31 14:41:21 -05:00
Martin Kojtal 974ecf731c Merge pull request #1829 from mbedmicro/fix_critical_assert
Critical - use mbed assert
2016-05-31 17:45:13 +01:00
Russ Butler c730c63f1d Update K64F memory map for for larger static data
The KSDK2 update restricts static data to the first 64K of RAM.
This breaks some applications which require more than 64K of
static data.  This patch moves the static data sections
(bss and data) into the second ram region which is 192K.

Changes taken from similar patches here:
https://github.com/ARMmbed/target-kinetis-k64-gcc/pull/5
https://github.com/ARMmbed/target-kinetis-k64-gcc/pull/6

Previous layout
---------------
0x1FFF0000 m_data   .interrupts_ram
0x1FFF0400          data, bss
0x1FFFFFFF          end of bss
0x20000000 m_data_2 start of heap, end of stack
0x2002ffff          end of heap, start of stack

New layout
----------
0x1FFF0000 m_data   .interrupts_ram
0x1FFF0400          start of unused ram
0x1FFFFFFF          end of unused ram
0x20000000 m_data_2 data, bss
0x200XXXXX          end of bss
0x200XXXXX+1        start of heap, end of stack
0x2002ffff          end of heap, start of stack
2016-05-31 10:45:46 -05:00
Martin Kojtal a8d2fa619d Merge pull request #1827 from mbedmicro/fix_progen_efm32
targets - fix progen names (use - instead of _)
2016-05-31 16:24:48 +01:00
Martin Kojtal 64edea6717 Merge pull request #1817 from c1728p9/ksdk2_fixes
KSDK2 fixes
2016-05-31 16:22:25 +01:00
Russ Butler 6815ce6343 KSDK2 - fix SPI
When the function spi_master_write is called a transfer will occur
and set the end of queue flag.  This disables further SPI transfers
which causes the next SPI transfer to hang forever.

This patch clears the end of queue flag so SPI does not hang after
the first transfer.
2016-05-31 10:05:14 -05:00
Martin Kojtal 34ea175b95 Merge pull request #1810 from adustm/fixserial_f3
[STM32F3] Use USART3_BASE instead of UART3_BASE
2016-05-31 15:23:15 +01:00
Martin Kojtal 486d7e88d5 Merge pull request #1812 from bcostm/fix_f091rc_hsi_clock
[NUCLEO_F091RC] Fix HSI clock configuration issue.
2016-05-31 15:22:16 +01:00
0xc0170 5e62c37f17 Critical - use mbed assert
uARM complained about assert:
```
Error: L6218E: Undefined symbol __aeabi_assert (referred from critical.o).
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: L6218E: Undefined symbol __aeabi_assert (referred from critical.o).
Finished: 0 information, 0 warning and 1 error messages.
```
2016-05-31 15:07:36 +01:00
svastm 6ebb2e6c6c [STM32L1XX] Reset UART on init 2016-05-31 14:46:06 +02:00
svastm 3243b38f5b [STM32L1XX] Fix deinit of SystemCoreClock on ARM toolchain 2016-05-31 14:46:06 +02:00
svastm 84e65c7ee3 [STM32L1XX] Init daylight saving time 2016-05-31 14:46:06 +02:00
svastm b6fe6638f1 [STM32L1XX] Update HAL_Cube_L1 to 1.5 2016-05-31 14:46:06 +02:00
0xc0170 795963c75f targets - fix progen names (use - instead of _)
efm32 targets were wrongly named, we follow now progendef names
(efm32gg-stk, ..).
2016-05-31 13:27:55 +01:00
Russ Butler 88ac7d89d1 KSDK2 - Fix IIC address
Address passed into the mbed I2C API are expected to be 8 bit and
include the read/write flag.  KSDK2 expects a 7 bit address without
this flag.  This patch shifts the address passed into the KSDK by 1
so it is in the correct format.
2016-05-30 23:08:56 -05:00
Russ Butler bee1570a7f KSDK2 - Fix repeated starts
On repeated starts the flag to indicate this is not being set
properly.  Because of this the transfer fails.  This patch
keeps track of the last transfer to determine if a repeated
start should be sent and sets the KSDK flags appropriately.
2016-05-30 23:08:55 -05:00
Jerome COUTANT 7f88761b55 [STM32F0] Init daylight saving time 2016-05-30 17:31:47 +02:00
Jerome COUTANT f327de0682 STM32Cube_FW_F0_V1.5.0 2016-05-30 17:31:18 +02:00
adustm 955b92804d Add UART_3 define for compilation 2016-05-30 11:38:52 +02:00
bcostm aef000ddbf [NUCLEO_F091RC] Fix HSI clock configuration issue. The clock was 96MHz instead of 48MHz. 2016-05-30 11:29:53 +02:00
adustm d2e7eda82e Add UART_3 define for compilation fix 2016-05-30 11:27:35 +02:00
Anders Lindvall d8935bb837 Misc fixes for LPC4088/LPC4088DM:
- Resetting in LPCXpresso IDE did not reset the LCD controller which
  sometimes could cause strange behaviour
- The ROM_LAT bit in the MATRIXARB register must be set in order to
  prevent a HardFault when debugging
- The change of compiler in LPCXpresso IDE to ARM launchpad GCC5 was
  causing build errors due to multiply defined timeval symbol.
- The exporters for LPCXpresso IDE did not set the FPU_PRESENT define
  for assembler, only for c/c++. This caused very strange behaviour
  in the RTOS code (e.g. timeouts no longer working, context switches
  failing etc.)
2016-05-30 10:50:17 +02:00
adustm 86fe75cb9b [STM32F3] Use USART3_BASE instead of UART3_BASE
This change allows the use of UART3 instance.
This change fixes the following issue :
https://developer.mbed.org/questions/4937/Serial-problem-no-Tx-to-PB_10
It's been validated on NUCLEO_F302RB, for PB_9 and PB_10 pins
2016-05-30 10:14:35 +02:00
Sam Grove b2f2075fc2 correct indentation from tab to space 2016-05-28 19:03:22 +08:00
Sam Grove 284bd081b4 Remove __enable and __disable irq calls from mbed hal common code 2016-05-28 17:19:55 +08:00
Sam Grove d2fd820e13 Merge pull request #1806 from c1728p9/dev_critical_use
Use critical section helper in HAL
2016-05-28 13:39:28 +08:00
Russ Butler 3055b2881c Merge pull request #1805 from sg-/move-target-json
move target description from tools into hal where the target code lives
2016-05-28 00:17:25 -05:00
Kevin Bracey 4422884c16 Use critical section helper in HAL
Routines using __disable_irq and __enable_irq had the effect of
enabling interrupts if called with interrupts disabled.

Some versions of __disable_irq do not return old status to restore it.

Change to use the critical section helper functions instead.
2016-05-28 00:04:20 -05:00
Sam Grove d94627e042 move target description from tools into hal where the target code lives 2016-05-28 12:46:08 +08:00
Anna Bridge 462c917ad0 Add a c based re-entrant critical section API
This includes a generic critical section implementation.  This
implementation also allow a user to start a critical section while
interrupts are already disabled.
2016-05-27 23:27:52 -05:00
Sam Grove 60c862c206 Merge pull request #1795 from 0xc0170/dev_mbedos_additions
Small changes (docs plus assert)
2016-05-28 09:02:04 +08:00
Russ Butler 48fd7d7480 Compatibility changes
Make changes to improve compatibility:
-Include toolchain.h inside mbed.h
-define EXTERN
2016-05-27 10:34:19 -05:00
Jimmy Brisson e690ec0fc5 moved event_callback_t for compatibility with many drivers 2016-05-27 10:28:46 -05:00
Christopher Haster fbbda73faa Update Callback to fix fault in serial interrupts
per @c1728p9

Update the Callback class to handle a NULL thunk by returning 0
rather than trying to call the thunk.  This fixes a crash that occurs
on some targets when the TX uart handler is not attached.

Background:
The K64F HAL uart implementation calls the TX interrupt handler
every time a uart interrupt occurs while the TX register is empty.
It does not check to see if the TX interrupt has been enabled.
This means that the TX interrupt can and typically does get
run on RX events.  This causes a crash with the newer callback
code which did not (prior to this patch) support a NULL thunk.
2016-05-27 10:28:46 -05:00
Christopher Haster a7f4262858 Adopt Callback class in hal 2016-05-27 10:28:46 -05:00
Christopher Haster 2e112f535a Add backward compatiblity for FunctionPointer class using Callback
effectively:
typedef Callback<R(A)> FunctionPointerArg1<R,A>
typedef Callback<R()> FunctionPointerArg1<R,void>
typedef Callback<R()> FunctionPointer
typedef Callback<R()> event_callback_t
2016-05-27 10:28:45 -05:00
Christopher Haster 15db3951df Add Callback, an improved FunctionPointer class
- Adopt C++11 style template arguments, requires rename to Callback
- Add constructor for C style callback functions
- Add constructor for Callbacks
- Add static function for passing to C style callbacks
2016-05-27 10:28:45 -05:00
0xc0170 04e4c6a880 k64f - mac address - fix warnings - get UID via K64F SIM macros 2016-05-27 15:00:39 +01:00
0xc0170 709f479093 hal - adding doxygen documentation
The most doxygen docs are taken from ARMmbed/mbed-hal module.
2016-05-27 13:08:45 +01:00
0xc0170 985255dbb5 assert - use fprintf (if serial=1) and mbed_die 2016-05-26 15:36:32 +01:00
0xc0170 d898c11e42 api - doxygen improvements, unused parameters fixes
This patch is taken from mbed-drivers master.
2016-05-26 15:07:57 +01:00
0xc0170 ea72444c96 mbed lib revision - 121 2016-05-25 09:57:29 +01:00
0xc0170 f7b629664d HAL - nordic Lib folder back
It was removed with hal/rtos rearrangement.
2016-05-25 09:57:26 +01:00
Adam Green 61e2296037 Fix NXP LPCxxxx i2c_start() handling of repeated start
In repeating start scenarios, there was a bug in the I2C driver for
various NXP LPCxxxx parts which could allow an extra I/O from the
previous operation to leak through. The scenario I encountered which
triggered this bug went like so:
* The higher level application code would first do an I2C write that
  doesn't send a stop bit (use repeating start instead.)
* The higher level application code would then issues an I2C read
  operation which begin with a call to i2c_start().
* i2c_start() would clear the SI bit (interrupt flag) at the top of
  its implementation.
* i2C_start() would then get interrupted right after clearing the SI
  bit.
  * While the CPU is off running the ISR code, the I2C peripheral
    repeats the last byte written to I2CDAT and then sets the SI bit to
    indicate that the write has completed.
  * The ISR returns to allow the i2c_start() to continue execution.
* i2c_start() would then set the STA bit but it is too late.
* i2c_start() waits for the SI bit to be set but it is already set
  because of the completed byte write and not because of the repeated
  start as expected.

For me this bug would cause strange interactions between my ISRs and
the code using I2C to read from the MPU-6050 IMU. I would be getting
valid orientation data and then all of a sudden I would start receiving
what looked like random values but I think it was just reading from the
incorrect offset in the device's FIFO.

It appears that atleast one other person has seen this before but it
was never root caused since it required specific timing to reproduce:
  https://developer.mbed.org/forum/bugs-suggestions/topic/4254/

This bug can be found in most of the NXP I2C drivers and this commit
contains a fix for them all. I however only have the LPC1768 and
LPC11U24 for testing.

My fix does the following:
* No longer clears the SI bit in the i2c_conclr() call near the
  beginning of the i2c_start() function. It was this clear that
  previously caused the problem as described above.
* The second part of the fix was to instead clear the SI bit after
  the STA (start) bit has been set with the i2c_conset() call.
* The clearing of the SI bit should be skipped if there isn't an
  active interrupt when first entering i2c_start(). If you clear
  the SI bit when there isn't an active interrupt then the code
  is likely to skip over the interrupt for the start bit which was
  just sent and then allow the I2C peripheral to start sending the
  slave address before it has even been loaded into the I2CDAT
  register.
2016-05-25 00:20:06 -07:00
0xc0170 b32f7a9aaf Merge branch 'TomoYamanaka-master_branch2' 2016-05-24 13:27:32 +01:00
0xc0170 935111ff6c Merge branch 'master_branch2' of https://github.com/TomoYamanaka/mbed into TomoYamanaka-master_branch2 2016-05-24 11:30:26 +01:00
Martin Kojtal 24136afd3f Merge pull request #1763 from BartSX/timer-fxxx-#816
Fix timer #816 issue for STM32F0 and STM32F1
2016-05-24 11:26:43 +01:00
0xc0170 39fa25d77e Merge branch 'ksitko-master' 2016-05-23 15:48:12 +01:00
Martin Kojtal 045d99bbaa Merge pull request #1764 from BartSX/can-devel-f0
[STM32F0xx] Move CAN API to new directory structure
2016-05-23 15:40:52 +01:00
Bartosz Szczepanski aa2ecad0b2 [STM32F0xx] Move CAN API to new directory structure
We need to remove *can_api.c* file accordingly to new directory structure.
Without that we can't compile any CAN mBed test.

Change-Id: I3d4f798ad75ec1b4c4a1d7ed877e71b7db6bf60f
2016-05-23 16:30:25 +02:00
0xc0170 62eda4dd6d Merge branch 'master' of https://github.com/ksitko/mbed into ksitko-master 2016-05-23 15:22:23 +01:00
0xc0170 9c525e2f71 Merge branch 'master' of https://github.com/toyowata/mbed into toyowata-master 2016-05-23 15:06:09 +01:00
Bartosz Szczepanski 01ff0b9ab7 [NUCLEO_F030R8] 16-bit timer register update
This path fixes issue #816.

Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Change-Id: I8e2ec02ce7539a4c044c7e3dfe6bedc9fcdf7736
2016-05-23 16:02:25 +02:00
Bartosz Szczepanski 82d82d0b2a [NUCLEO_F070RB] 16-bit timer register update
This path fixes issue #816.

Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Change-Id: Iaaf7b9eb33aa8d8992e9354ca5e21bf01ec2413d
2016-05-23 16:02:25 +02:00
Rafal Kula e938780788 [NUCLEO_F103RB] 16-bit timer register update
This path fixes issue #816.

Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Change-Id: Ie7a9bfce76990f85caa84264450d053604af33e5
2016-05-23 16:02:25 +02:00
Rafal Kula 07b841b08f [STM32Fxxx] Fix issue #816
Both STM32F0xx and STM32F1xx are using a 16-bit timer as a internal ticker
but the mBed ticker needs a 32-bit timer implementation, so the upper part
of that 32-bit timer is being calculated in software.

Software bug has been fixed where continous HIGH/LOW voltage levels
could be observerd for 65ms due to 16-bit timer overflow.

Now current value of TIM_MST->CNT is stored in cnt_val and is
updated in interrupt context only. This avoids master timer
overflow without SlaveCounter update.

This fix is only for platforms which already implements a 16-bit timer:
F103RB, F070RB, F030R8

Change-Id: I205c70ce155b373c6593ead93ade9ec38993f7f9
2016-05-23 16:02:25 +02:00
Bartosz Szczepanski f1c42bfc69 [NUCLEO_F302R8] Added CAN support
Added CAN API support for NUCLEO_F302R8 target.

*stm32f302x8.h* file was changed to avoid compilation errors.

Change-Id: Ia4ee8a90fe3f0ad6955dde21e78ea4a6c05e4fcd
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 347a5e629d [NUCLEO_F303K8] Added CAN support
Added CAN API support for NUCLEO_F303K8 target.

*stm32f303x8.h* file was changed to avoid compilation errors.

Change-Id: If093c84f19c5a5ef68938af4653a25271c1108ba
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 9a78b010a0 [NUCLEO_F303RE] Added CAN support
Added CAN API support for NUCLEO_F303RE target.

*stm32f303xe.h* file was changed to avoid compilation errors.

Change-Id: Ia6519c982261d43165dbce73cab7cfc0617474e2
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 656d1953d9 [NUCLEO_F334R8] Added CAN support
Added CAN API support for NUCLEO_F334R8 target.

*stm32f334x8.h* file was changed to avoid compilation errors.

Change-Id: Ic7b3273ffe24940ecdc189d2566a6a7f66825ce6
2016-05-23 15:55:00 +02:00
0xc0170 ee6f510ade Merge branch 'fix_f4_serial' of https://github.com/bcostm/mbed into bcostm-fix_f4_serial 2016-05-23 14:08:19 +01:00
0xc0170 2b44bfbcc6 Merge branch 'timer-l0-#816' of https://github.com/BartSX/mbed into BartSX-timer-l0-#816 2016-05-23 13:59:40 +01:00
Bartosz Szczepanski 78767491f7 Added CAN API for STM32F3xx family
* STM32F3xx family have only one CAN bus

Change-Id: Icaed8ff8ca4a68ebbf2c124655e7368423fb71cd
2016-05-23 14:39:51 +02:00
0xc0170 c70aedc044 Merge branch 'can-devel-f0' of https://github.com/BartSX/mbed into BartSX-can-devel-f0 2016-05-23 10:37:22 +01:00
0xc0170 f3e11eb36e semihost - fix inline __semihost for IAR (add static)
This was causing errors at my machine (for programs like MBED_10, RTOS_1):

Error[Li005]: no definition for "__semihost" [referenced from
          semihost_api.o(mbed.a)]
[ERROR] Error[Li005]: no definition for "__semihost" [referenced from
          semihost_api.o(mbed.a)]
2016-05-23 09:50:20 +01:00
Mihail Stoyanov ec8512aaab Removed mbed-drivers/mbed.h which breaks compatibility with binary releases due to difference in the inclusion path 2016-05-23 09:14:06 +01:00
Mihail Stoyanov d9734e5a32 Simplify layout:
* /libraries/mbed -> /hal
* /libraries/rtos -> /rtos
2016-05-23 09:13:59 +01:00