Commit Graph

4542 Commits (cc42528dbc9e424b85cde3c829dd608df7a57def)

Author SHA1 Message Date
Martin Kojtal cc42528dbc Merge pull request #1281 from jpbrucker/fix_us_ticker
Nordic: handle unwanted RTC interrupts
2015-08-13 10:21:57 +01:00
Martin Kojtal 99877b836d Merge pull request #1276 from jpbrucker/nrf51_clock_fallback
Nordic: fallback to the internal LF clock in case Xtal doesn't start
2015-08-13 10:17:26 +01:00
Martin Kojtal ab6a668ec1 Merge pull request #1227 from neilt6/master
FATFileSystem - Updated FatFs to R0.11
2015-08-13 10:09:43 +01:00
Martin Kojtal e91a34240e Merge pull request #1292 from PrzemekWirkus/bugfix_missing_verbose_flag2
Tools: Added verbose mode to mbed library build when using singletest.py
2015-08-13 10:06:22 +01:00
Martin Kojtal d5794135d2 Merge pull request #1293 from jrjang/master
Fix compilation warning
2015-08-13 08:46:01 +01:00
Jun-Ru Chang 680a647d0d Fix compilation warning
The warning message is shown as below.

Compile: Thread.cpp
[Warning] Thread.cpp@45: In constructor 'rtos::Thread::Thread(void (*)(const void*), void*, osPriority, uint32_t, unsigned char*)':
  comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Jun-Ru Chang <jrjang@gmail.com>
2015-08-13 00:07:29 +08:00
Przemek Wirkus cefba29822 Added verbose mode to mbed library build when using singletest.py -v (verbose) switch 2015-08-12 09:43:43 +01:00
0xc0170 020975119c mbed lib revision - 104 2015-08-05 14:19:47 +01:00
Przemek Wirkus 0c7ec777f9 Added fix for duplicate -D compiler symbols 2015-08-05 12:28:47 +01:00
Jean-Philippe Brucker 15019ef882 Nordic: fallback to the internal LF clock in case Xtal doesn't start
Since some Nordic platforms don't use an external clock source, they
need to be built with the TARGET_NRF_LFCLK_RC flag. If they don't,
SystemInit will wait indefinitely for an external clock to start.

This patch adds a 1s timeout to the external oscillator initialisation,
and falls back to using the internal RC one if no LFCLKSTARTED event was
received in this interval.

For most applications, this won't matter. When building for the wrong
Nordic target, pin numbers will be mixed up as well and the application
will break later on.
But on targets that can only be updated using FOTA and don't have an
interface chip, this patch avoid ending up with a bricked device after a
slight mistake. Indeed, BLE DFU service is portable across all boards
and will run even with a mixed-up target setup, allowing the user to
re-install the right application.

An example scenario is transferring an application on a standalone
NRF51 chip, after spending some time prototyping on an mKIT, which tends
to happen a bit too often...

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
2015-08-05 10:57:57 +01:00
Jean-Philippe Brucker 1c90449f35 Nordic: handle unwanted RTC interrupts
This patch clears the EVENT_COMPARE register even when we're not
expecting to get a COMPARE interrupt.

Here is a scenario where we get an unwelcome interrupt, and where it
currently results in a deadlock:

* A Ticker T1 runs at 500ms
* Its handler registers a Timeout T2 at 20µs. Since LF clock runs at
  32.768kHz, this will be rounded up to a multiple of 30.5µs (actually
  61µs, to ensure we're in the next tick window)

           T1  T2                                T1' T2'
    -------|---|---------------------------------|---|--------->
           :   :                                 :
           <---> n * 30.5µs                      :
           <--------------- 500ms --------------->

* When the ticker API handles T1, it calls us_ticker_set_interrupt a
  first time for T1', and then for registering T2.
* Since T2 period is less than one RTC tick (30.5µs), there is a high
  chance it will go past *while* we're still in this first handler.
* So ticker_irq_handler also handles T2 as well, and removes it from the
  queue.
* us_ticker_set_interrupt is called for T1' before returning from
  ticker_irq_handler

The problem resides in the fact that us_ticker_set_interrupt takes more
than 2 RTC ticks to execute: while inside the handler, T2 interrupt will
fire.

* Because of this pending interrupt, RTC1_IRQHandler will be called
  right away, but since we removed T2 from the queue, the handler is
  waiting for T1' instead, and will not clear EVENT_COMPARE until we
  reach the T1' tick, in about 500ms.
* This results in a lock and main isn't executed anymore.

With this patch, we avoid being stuck in RTC1_IRQHandler while waiting
for T1'.

Note: even when T2 isn't handled in the same loop as T1, we may get a
spurious interrupt, because us_ticker_set_interrupt will be called twice
for T2... and will register T2+m the second time, while T2 interrupt is
fired in the background.
That case isn't as harmful, since RTC1_IRQHandler will be waiting for
T2+m, which is only one or two ticks further, and then it won't be
called again before T1'.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
2015-08-05 10:39:29 +01:00
Martin Kojtal 24cc331f12 Merge pull request #1278 from marcusChiou/master
Change DELTA_DFCM_NNN40 ram size to 32KB config
2015-08-05 07:52:11 +01:00
unknown be49cca1a1 Change DELTA_DFCM_NNN40 ram size to 32KB config 2015-08-04 15:08:53 +08:00
Martin Kojtal 9d276ebad7 Merge pull request #1265 from Wiznet/mbed_dev4
Wiznet - I2c -> gpio
2015-07-31 14:52:52 +01:00
Martin Kojtal e4cd8bbd3e Merge pull request #1266 from alexbeer2048/master
Enable LPC8xx usart when configuring it
2015-07-31 14:12:58 +01:00
Martin Kojtal 5b1dc60c03 Merge pull request #1271 from kgills/pwm_fix
MAXWSNENV, MAX32600MBED - Fixing pwm array search.
2015-07-31 13:57:26 +01:00
dbestm 2075adfd80 [DISCO_L053C8] enhance python file for uvision exporter 2015-07-31 13:54:23 +01:00
Martin Kojtal cc29b78880 Merge pull request #1274 from robojay/master
Removed PB6 debug toggling
2015-07-31 13:45:27 +01:00
Jay Francis 2cb58075f7 Removed PB6 debug toggling 2015-07-29 11:42:58 -04:00
Martin Kojtal e87fec7b35 Merge pull request #1267 from jamesadevine/microbit-pr04
Microbit addition
2015-07-29 09:37:34 +01:00
Kevin Gillespie db8697c321 [MAXWSNENV, MAX32600MBED] Fixing pwm array search. 2015-07-28 13:55:22 -05:00
hjjeon0608 20888331af Deleted not used variable.
Deleted else if and using GPIO offset address.
Added GPIO out enable set/clear functions.
2015-07-28 11:19:08 +09:00
James Devine 633b57e209 Nordic: Enabled the invocation of twi_master.h functions from a cpp context
In a previous commit, the content of twi_master.h did not allow the invocation
of the c functions specified by the file from a cpp context. This commit wraps
the contents of the header file with the appropriate ifdefs.
2015-07-27 11:31:49 +01:00
James Devine 50fca30a2f microbit: Added NRF51_MICROBIT_B to build_release.py
Added NRF51_MICROBIT_B to build_release.py so this platform
can be built for release.
2015-07-27 11:31:49 +01:00
Jonathan Austin c285f2e1d3 Nordic: refactor the way we select the LFCLKSRC
Rather than indefinitely adding platforms to a #define list that use
the internal RC oscillator instead of an external crystal, let platforms
define this and the 'core code' can be platform agnostic.

Note, that this also allows people to use this symbol in libraries.
There's one notable example in the BLE_API that can now be refactored to
the same method, hopefully saving someone some unpleasant debugging
when their platform doesn't work because of a missing platform dependent
define in the high level API.

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
2015-07-27 11:31:49 +01:00
Jonathan Austin 0ee410d831 Move HRM and DELTA targets to use LFCLK define
After this change it will no longer be necessary to list all
the platforms that require the LFCKL to be the internal RC oscillator,
instead we specify it as a property of the platform.

Applications and libraries can use the TARGET_NRF_LFCLK_RC symbol to
filter for platforms that don't have an external crystal.

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
2015-07-27 11:31:49 +01:00
Jonathan Austin 382f7334fb Nordic: added the s110 scatter files
This commit adds the ability for a compile flag to be set from targets.py
which changes the soft device to s110.

The compile flag is: MCU_NRF51_16K_S110. In order to avoid duplication
of the startup file, for the 16K parts we introduce an S110 or S130
scatter file. This means all 16K platforms must define
MCU_NRF51_16K
and ONE of
MCU_NRF51_16K_S110 or MCU_NRF51_16K_S130

Based on an earlier commit by Mihail but modified to avoid copy/paste
of the startup code for S110/S130

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
2015-07-27 11:31:48 +01:00
Mihail Stoyanov ee4c83b34f Nordic:
Support multiple SoftDevices for NRF51822 based platforms
Move microbit S110 to Nordic default SoftDevice location
Remove obsolete S110 bootloader
2015-07-27 11:08:03 +01:00
James Devine 585fe6245f Add BBC microbit platform: NRF51_MICROBIT
This adds the BBC micro:bit platform, based on NRF51822

Initially, add the platform to use whatever version of softdevice is the
default for the NRF51822-based platforms.

Originally written by James, modified for new target inheritance by
Jonathan Austin:

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
2015-07-27 11:07:53 +01:00
James Devine 668644c604 Nordic: fix for Nordic PAN56 - reset twi master
This commit is based on Nordic's fix for an abnormality in some releases
of the nrf51822 silicon.

Without this fix, the I2C bus locks up and doesn't reset properly. The
fix resets the TWI master on powerup.

For more information see
https://www.nordicsemi.com/eng/nordic/download_resource/24634/6/47696154

Nordic Product Anomaly ID 56.
2015-07-27 11:02:20 +01:00
James Devine e50305122d Wallbot: update wallbot to use standard I2C definitions
Unlike other Nordic platforms, the wallbot doesn't use numbered I2C
ports. This makes it difficult to refer to a platforms's I2C pins from
common code.

This fix leaves the original wallbot definitions, but adds the more
'standard' ones too.

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
2015-07-27 11:02:20 +01:00
Alexander Beer 37a478b88c Enable LPC8xx usart when configuring it 2015-07-27 11:45:47 +02:00
Martin Kojtal 9b9bab51e5 Merge pull request #1229 from Wiznet/mbed_dev2
Change us_ticker - one dual timer + one pwm timer
2015-07-27 09:38:55 +01:00
Martin Kojtal bfd1ddeee4 Merge pull request #1250 from dbestm/master
DISCO_F746NG - add pwm12 clock
2015-07-27 09:26:46 +01:00
Martin Kojtal 23cdadc405 Merge pull request #1253 from bcostm/master
DISCO_F746NG - Add IAR exporter
2015-07-27 09:25:33 +01:00
hjjeon0608 641ecd065a Add Repeated read/write functions. 2015-07-27 11:22:04 +09:00
hjjeon0608 74cdab3021 Change I2C using GPIO. 2015-07-27 10:02:03 +09:00
Martin Kojtal cda27fddc9 Merge pull request #1254 from bridadan/remove-gcc-arm-for-arm-mps
Removes GCC_ARM as a supported compiler for the ARM_MPS targets
2015-07-24 15:19:18 +02:00
Martin Kojtal 591781b445 Merge pull request #1257 from yoonghm/yoonghm-Export_GCC_ARM_TEENSY3_1
Yoonghm-Export-gcc_arm_teensy3 1
2015-07-24 15:17:31 +02:00
Martin Kojtal e6e5c975d4 Merge pull request #1261 from screamerbg/master
Redesign Nordic nRF51 MCU and derivative platforms
2015-07-24 15:15:13 +02:00
hjjeon0608 226d534d85 I have rectified typos
DULA -> DUAL
2015-07-24 14:31:48 +09:00
Mihail Stoyanov e9ccab9fb8 Redesign Nordic nRF51 MCU and derivative platforms to use class inheritance:
* add class to support both versions - 16K and 32K
* add class to support 2 modes - BOOT and (F)OTA
* change all classes to use the corresponding parent class
2015-07-23 15:28:52 +03:00
Martin Kojtal 58bac00e25 Merge pull request #1260 from screamerbg/master
Add travis test whether the testsuite is usable
2015-07-23 11:24:57 +02:00
Mihail Stoyanov 482941ab0e Add travis test whether the testsuite is usable 2015-07-23 12:12:06 +03:00
Martin Kojtal c5a4d1068e Merge pull request #1256 from screamerbg/master
Add bootloader versioning based on the softdevice being used for all …
2015-07-23 10:02:50 +02:00
Martin Kojtal 67a3069560 Merge pull request #1259 from bridadan/remove-mbedls-dependency
Remove mbed-ls dependency from test framework
2015-07-23 08:09:40 +02:00
Brian Daniels b5191580fd Removed mbed-ls dependency from test framework 2015-07-22 16:40:42 -05:00
YoongHM 4a7d6beaea Add GCC_ARM export for TEENSY3_1
To reflect support for GCC_ARM export for TEENSY3_1
2015-07-22 20:29:37 +08:00
YoongHM 8e04c1f2a7 Add gcc_arm_teensy3_1.tmpl
Add Jinja2 template to support export of Teensy 3.1 project for GCC ARM toolchain.
2015-07-22 20:25:23 +08:00
YoongHM b1534cf994 Feature: Export GCC_ARM for TEENSY3_1
Support project export in GCC_ARM for Teensy 3.1.
2015-07-22 20:20:58 +08:00