Commit Graph

558 Commits (1da259af3b78a318023271169bb2bef1162b7ba0)

Author SHA1 Message Date
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