Commit Graph

6058 Commits (51c10165ca4218c98f4103426a0eef42b85e66b3)

Author SHA1 Message Date
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
Laurent Meunier 05baf365dc Synchronize host and target for nc serial auto test
We're ensuring target and host start-up sync here in 2 ways:
1) adding a delay on host side to make sure the serial
initialization can happen before sending a character is sent to target
2) in case of serial_nc_rx_auto.py test, we're sending a
first character S which will trigger the move from rx+tx
to NC+rx.

This should  avoid any crossing case due to HSOT being faster than target or vice-versa
2016-06-03 09:32:13 +02:00
Laurent Meunier c35a6f65f2 Modify serial nc tests init part
During initialization phase of the 2 NC serial tests,
there is a character being sent from host to target,
based on MBED_HOSTTEST_START. The problem is that
the target firmware then creates a "new" serial on the
same serial interface. the new or should, or at least may,
induce a reset of the IP, so that the character sent by host
would be lost. So we're moving the new earlier.

the real testing part happens later, to check the next
character is not received or sent.
2016-06-03 09:32:13 +02: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
Martin Kojtal f68cdcb695 Merge pull request #1802 from theotherjimmy/callback-rtos
Adopt Callback class in rtos Threads
2016-06-02 17:08:59 +01:00
Martin Kojtal 7643399c1d Merge pull request #1835 from stevew817/feature/rtos_support_efm32
[Silicon Labs] Disable RTOS support for EFM32ZG
2016-06-02 11:51:00 +01:00
Steven Cooreman d14fc7f744 Forgot to remove ZG RTOS from the automated build... 2016-06-02 11:56:09 +02:00
Steven Cooreman 0015943bd9 Remove RTOS support for EFM32 Zero Gecko because of too little RAM 2016-06-02 10:06:26 +02:00
Martin Kojtal 5df96fbec3 Merge pull request #1815 from stevew817/feature/rtos_support_efm32
[Silicon Labs] Provide RTOS support for EFM32 targets
2016-06-02 08:08:20 +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
Christopher Haster e079c2e0e9 Added support for Callback to Thread lifetime 2016-06-01 12:11:05 -05:00
Martin Kojtal 02b0267143 Merge pull request #1765 from c1728p9/thread_safe
Thread safe
2016-06-01 18:01:18 +01:00
Steven Cooreman b1accd3b07 Fix stack size on EFM32 RTOS tests to avoid heap overflow 2016-06-01 14:53:48 +02:00
Martin Kojtal 2db84dadcb Merge pull request #1785 from geky/thread-lifetime
Add lifetime management to threads
2016-06-01 11:42:28 +01:00
Anders Lindvall 617caf6d98 Added all symbols to assembler (not just FPU_PRESENT=1). Removed unused c
compiler argument.
2016-06-01 09:22:40 +02:00
Christopher Haster 0180125293 Adopt Callback class in rtos Threads 2016-05-31 20:39:39 -05:00
Russ Butler 5b23d9b268 Remove assembler directives
Remove the assembler directives from the inline assembly in
RTX_CM_lib.h since these can have unintended side effects in
the surrounding C code.
2016-05-31 16:17:50 -05:00
Russ Butler 793f9c566a Add partial thread safety to GCC
Add lock functions so that malloc and environment variable access are
thread safe.  Add the compiler option "-o thread-safe" to use the full
version of newlib which is thread safe.

Note that this patch does NOT make file access thread safe.
2016-05-31 16:16:59 -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
Martin Kojtal cb6300e3f4 Merge pull request #1818 from c1728p9/k64f_memory_map
Update K64F memory map for for larger static data
2016-05-31 17:37:30 +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
Martin Kojtal c40581c148 Merge pull request #1792 from svastm/update_cube_l1
STM32Cube_L1 update
2016-05-31 14:22:20 +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
Steven Cooreman cc34a7bada Provide initial RTOS support for EFM32 targets 2016-05-30 14:14:36 +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