Commit Graph

4711 Commits (24ebe1790e7ea002a5876e2d2a5e717a4a9e87fa)

Author SHA1 Message Date
tomoyuki yamanaka bb4d569cfd Add RZ_A1H in RPC. 2015-08-07 16:20:22 +09:00
Kevin Gillespie e3482229e0 Simplifying pwm search. Reordering PinMap_PWM. 2015-08-05 12:57:07 -05: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
sarahmarshy dc1e3be0a0 Added requirements.txt file 'pip install -r requirements.txt' will install all the needed python packages 2015-08-04 14:24:45 -05:00
unknown be49cca1a1 Change DELTA_DFCM_NNN40 ram size to 32KB config 2015-08-04 15:08:53 +08:00
modtronix-com 25144420ab Changed External oscillator to 16MHz, moved defined to device.h
For NZ32-SC151 fixed External oscillator frquency to 16MHz, and, moved
defined to device.h
2015-08-04 12:35:23 +10:00
Martin Simpson 99d009db00 Delete circle.yml 2015-08-03 15:56:33 +01: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
Mikko Polojarvi 511b46de83 SiL USB: Disable LEM in Happy with ISOC endpoints
Happy Gecko's USB Low Energy Mode does not work properly with
isochronous endpoints.

Note that Happy Gecko errata USB_E112 states:

  Do not use the SUSPEND mode of LEMOSCCTRL in USB_CTRL.

  In rare cases with high data throughput, a transmission can
  fail when this mode is enabled.

  Use the GATED mode of LEMOSCCTRL for the best energy
  efficiency. The NONE mode can be used to disable energy
  savings

However, even using GATE mode causes problems for high-frequency
isochronous transfers. The primary effect for OUT endpoints is that
the first read will succeed, and the following one (targetting the
next frame) will fail with zero bytes incoming data, and PKTDRPSTS
is set in the related interrupt status register.

Disabling LEMOSCCTRL (set to NONE) solves the problem. Since this
will cause increased energy usage, do this only when an ISOC endpoint
is added.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 549d2b9e21 SiL USB: Fix endpoint definitions for Happy Gecko
Happy only has 3 endpoints, so flag out the rest.
2015-07-28 17:22:53 +03:00
amveeq 1620432608 Update USBEndpoints.h
No USB in Zero Gecko so removed also from here for the sake of clarity.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 088e451b7a SiL USB: Correctly handle ep0 reset on Happy
Use correct function when resetting endpoint 0 (on stall etc)
on Happy Gecko.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 1eb719bc17 SiL USB: Remove incorrect Zero Gecko flagging
Zero Gecko has no USB support, so don't even try to compile for it.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 3eaef2e095 SiL USB: Update copyrights and licence boilerplate
Everything should be copyrighted to SiLabs, and licensed
under Apache 2.0.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 957d7bd942 Silicon Labs USB device support - Wonder, Leopard, Happy
USB device support for Wonder, Leopard and Happy Gecko. See
details on configuration etc on the previous commit.

Known issue: USBAudio does not work reliably on Happy Gecko.
2015-07-28 17:22:53 +03:00
Mikko Polojarvi 8054366915 Silicon Labs USB device support
** Overview

This commit provides USB device-mode drivers for Silicon Labs chips.
The code is based on the SiLabs USB driver that is part of the
Simplicity dev environment.

Because Mbed USBDevice class wants to control the USB transactions
itself, large parts of the higher level code originally present in the
driver have been stripped out. An attempt has been made to keep Mbed
code separate enough that patches can be applied with minor effort, if
needed.

** Use of dynamic memory

Due to requirements imposed by the USB hardware, the driver needs read
and write buffers for every enabled endpoint. Since information on
what EPs will be used is only available during runtime, dynamic memory
allocation is used to minimize memory usage.

If needed, dynamic memory use can be disabled via a flag in
usbconfig.h. In this case, please read the documentation to see what
limitations this imposes. Static memory usage can also be reduced by
limiting the maximum number of active endpoints - see configuration in
usbconfig.h and USBEndpoints_EFM32.h.

** Power management

Driver supports the new SiLabs functionality in Mbed sleep(). Normal
sleep (EM1) is always available, and deep sleep (EM2) is available
when USB is either disconnected or suspended. How and when different
sleep modes are made possible can be configured in usbconfig.h

** Supported hardware

Current release officially supports, and has only been tested on Giant
Gecko. Upcoming releases will add support for other SiLabs platforms
on Mbed.
2015-07-28 17:22:53 +03:00
Martin Simpson 23c932ce3d Create circle.yml 2015-07-28 14:52:06 +01:00
bcostm 277b2d033f [DISCO_L476VG] Add platform in python files 2015-07-28 10:30:26 +02:00
bcostm 835e33d453 [DISCO_L476VG] Add uvision4 template files 2015-07-28 10:24:11 +02:00
bcostm 0f35f53699 [DISCO_L476VG] Add hal specific files 2015-07-28 10:23:26 +02:00
bcostm 151fe14452 [STM32L4] Add hal common files 2015-07-28 10:22:50 +02:00
bcostm e2ffa3f481 [STM32L4]Add hal common files 2015-07-28 10:22:02 +02: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
bcostm 33384ea5a5 [DISCO_L476VG] Add cmsis files 2015-07-27 15:57:47 +02:00
bcostm df5d0a124e [STM32L4] Add STM32Cube L4 HAL driver V1.0.0 2015-07-27 15:56:29 +02:00
Martin Simpson bbfd190206 Update pwmout_api.c
Line 244 changed PclkFreq*2 to PcklFreq
Line 246 changed PclkFreq to PclkFreq*2

This is proposed as the current pwmout_api.c gives the wrong period/frequency when using e.g."mypwm.period_ms(1);"
For PWM1 1ms gave 500Hz and PWM2,3 and 4 gave 2KHz

Applied to source as above and re-compiled this gave 1KHz outputs for all PWM's selected
Tried on NUCLEO STM32F401RE will effect other NUCLEO-STM32F4 as above

HAL Clocks are as follows for the F401RE Board:  PCLK1=42000000 PCLK2=84000000 HCLK=84000000

Kind Regards

Martin
2015-07-27 12:16:45 +01: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