Commit Graph

171 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

Author SHA1 Message Date
Martin Kojtal 29988933aa EFM32: fix fire interrupt (set flags)
There's overflow counter that needs to be 0, and
CC0 flag set.

Fixes #5051
2017-09-22 14:45:30 +01:00
Jimmy Brisson fb53eb65d4 Correct Silabs NVIC selection
Again, the culprit was that the discriminant did not include armc6
2017-09-11 13:20:32 -05:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
Jimmy Brisson c7d6bbe295 Upcase all assembler file extensions 2017-06-20 14:50:08 -05:00
Jimmy Brisson 113ee13505 Merge pull request #4472 from c1728p9/workshop_rebase_4037
Silicon Labs: Add flash API support
2017-06-09 16:18:41 -05:00
Martin Kojtal 89b66983b8 Merge pull request #4477 from c1728p9/workshop_rebase_4054
Silicon Labs: Fix bug with SPI MISO and CS handling
2017-06-09 15:05:33 +01:00
Martin Kojtal 8998a55bc7 Merge pull request #4475 from c1728p9/workshop_rebase_4043
Silicon Labs: Add bootloader support
2017-06-09 15:04:55 +01:00
Aksel Skauge Mellbye 0d1bd37746 [Silicon Labs] Add flash API support 2017-06-09 11:51:28 +01:00
Sam Grove 8a6f28dd52 Merge pull request #4482 from kegilbert/bugfix/efm32-bootloader-s1-rebase
[Silicon Labs] Bugfix for bootloader on Pearl and Mighty Gecko - Rebase
2017-06-08 15:54:57 -05:00
Sam Grove c136c1330f Merge pull request #4471 from c1728p9/workshop_rebase_4042
[Silicon Labs] Fix compile warnings and ticker test failure
2017-06-08 15:53:55 -05:00
Steven Cooreman 59b3bfa0ce Add behavior to throw away collected entropy on occurrence of a noise alarm. 2017-06-07 17:22:26 -05:00
Steven Cooreman 97ef051eba Remove internal test functions 2017-06-07 17:22:06 -05:00
Steven Cooreman 94450374e7 Update to 4 spaces/tab 2017-06-07 17:21:49 -05:00
Steven Cooreman 66862785c5 Remove leftover comment about mbedTLS plugin 2017-06-07 17:21:28 -05:00
Steven Cooreman 466d4eab22 [Silicon Labs] Add TRNG support
Adding support for the TRNG peripheral present on Series 1 Configuration 2 devices.
2017-06-07 17:20:24 -05:00
Aksel Skauge Mellbye b30e665fc7 [Silicon Labs] Bugfixes to using bootloader with Series 1 devices. 2017-06-06 17:11:18 -05:00
Aksel Skauge Mellbye 9e999bd43b [Silicon Labs] Fix bug with SPI MISO and CS handling 2017-06-06 16:36:15 -05:00
Aksel Skauge Mellbye 5d906a74e6 [Silicon Labs] Add bootloader support
* Make memory sections configurable in linker files
* Dynamically determine vector location in flash for NVIC relocation
* Advertise bootloader support in targets.json
2017-06-06 16:26:11 -05:00
Aksel Skauge Mellbye 29bef6fd05 [Silicon Labs] Fix compile warnings and ticker test failure
* Using PinName as bitfield doesn't work without warnings, since NC
  needs all 32 bits to be represented.
* lp_ticker should not be freed when interrupt is disabled, since this
  will kill the timebase.
2017-06-06 16:14:19 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Bartek Szatkowski b97ffe8fdc CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation 2017-05-30 18:55:51 +01:00
Christopher Haster c1de19e49e spi: Added default spi_master_block_write implementation to all targets
There is an easy default implementation of spi_master_block_write that
just calls spi_master_write in a loop, so the default implementation
of spi_master_block_write has been added to all targets.
2017-05-25 12:04:58 -05:00
Kevin Gilbert 83a510751b Added mapping to BTN-labelled switches 2017-04-28 11:31:48 -05:00
Sam Grove 01767268cd Merge pull request #4142 from productize/master
EFM32: Fixed `pwmout_all_inactive` being inversed
2017-04-19 02:27:19 -05:00
Seppe Stas d396306a10 EFM32: Fixed `pwmout_all_inactive` being inversed
If one of the CC channel pins is enabled, `pwmout_all_inactive` it
means a channel is active so it should return `true`.

This commit also contains some cleanup in `pwm_init`.
2017-04-10 11:59:44 +02:00
Steven Cooreman ce843e4859 Update pinmap of EFM32PG12 as well 2017-04-06 19:35:10 +02:00
Steven Cooreman 680feb439e Support SPI CPP objects with different pinouts sharing the same peripheral 2017-04-06 19:35:09 +02:00
Steven Cooreman 632586e940 [Silicon Labs] Update TB Sense 2
* Update i2c driver to tackle multiple I2C object instances on different pins
* Update pinmap to enable the extra peripherals of EFx32xG12 over EFx32xG1
2017-03-30 02:57:20 +02:00
Steven Cooreman 0c20f33d2b [Silicon Labs] Rename targets
Due to limitation in the mbed website backend (board names need to be <= 19 characters), we are shortening the CLI target names from THUNDERBOARD to TB.
@screamerbg
2017-03-28 20:14:16 +02:00
Steven Cooreman d2173574d0 Stop using device_has for non-mbed options
As asked by @0xc0170 in PR #3934, we won't be using device_has for indicating RF/Crypto features any longer. RF config options moved to the SL_RAIL lib.json, crypto config options will come with mbedTLS integration.
2017-03-21 16:23:52 +01:00
Steven Cooreman d710ec4e12 Bugfix for EFM32PG12 and EFR32MG12
* Off by one error in the linker scripts reserved one word too little for the vector table
* Re-apply uvisor changes to emlib. To allow uvisor to run, we should make accesses to the romtable through uvisor's secure read gateway
* Copypasta in target name (EFM32PG12, not EFR32PG12)
* Copypasta in the pin definitions (thanks @akselsm)
* Forgot to update PortName for extra ports on MG/PG12
2017-03-21 16:19:46 +01:00
Steven Cooreman 8067bf629f Update clock calibration structs to match latest Gecko SDK 2017-03-20 16:34:12 +01:00
Steven Cooreman 8b6451c74d Add new target EFM32PG12 2017-03-20 16:34:12 +01:00
Steven Cooreman ca91e7c2d5 Update to Gecko SDK 5.1.2
Updating CMSIS device headers
2017-03-20 16:34:12 +01:00
Steven Cooreman 1a8c460378 Update to Gecko SDK 5.1.2
Updating emlib
2017-03-20 16:34:12 +01:00
Steven Cooreman 0e098678b5 First pass on TB Sense (and EFR32MG12) support 2017-03-20 16:34:12 +01:00
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
Jaeden Amero 378655f40c uVisor: Standardize available legacy heap and stack
With the RTOS, the STACK_SIZE specified here is unrelated to the stack
size available for the main thread (that runs pre_main). Save memory by
reducing the stack size to a more reasonable amount.

On uVisor, HEAP_SIZE is both a minimum available and maximum available
heap size. The heap can't grow beyond the end of the heap into the
neighboring stack. On all uVisor-supported platforms, guarantee at least
0x6000 bytes of heap space. This increases the portability of uVisor
applications as the memory available for legacy heap allocations is
guaranteed. This helps to avoid out of memory errors on platforms that
were previously guaranteeing less memory.
2017-02-07 16:46:38 +00:00
Martin Kojtal ade6722707 Merge pull request #3607 from ARMmbed/feature_hal_sleep
Platform: Add sleep/deepsleep user facing functions
2017-01-26 13:55:33 +02:00
Jaeden Amero 95e5fec8d0 EFM32GG: Fix GCC_ARM linker script
A copy paste error snuck into the uVisor related updates to the EFM32GG
linker script. Fix the error by replacing "m_data" with "RAM".

Fixes: 89641bc7e0 "uVisor: Update K64F and EFM32GG linker scripts"
2017-01-19 17:13:40 +00:00
Bartek Szatkowski 6a045a49a9 Platform: Add sleep/deepsleep user facing functions
Add sleep/deepsleep functions to platform layer which are replacing HAL
functions with the same name, rename existing symbols in HAL layer
to hal_sleep/hal_deepsleep. This way sleep functions
are always available, even if target doesn't implement them, which makes
the code using sleep clearer. It also enables us to make decision on in
which builds (debug/release) the sleep will be enabled.
2017-01-19 09:39:29 +00:00
Alessandro Angelino 89641bc7e0 uVisor: Update K64F and EFM32GG linker scripts
This commit improves consistency between different platforms' linker
scripts. In particular, we use "__UVISOR_SRAM_START" instead of
"__UVISOR_BSS_START" as the uVisor BSS sections might be outside of the
SRAM (for example, when using a tightly-coupled memory).
2017-01-10 13:15:54 +00:00
Steven Cooreman 245e2e2e2d Revert "[EFR32] Adding hardware acceleration for mbed TLS"
This reverts commit c0301b15d2.
2016-11-18 11:05:36 +01:00
Steven Cooreman ef690f734f Fix broken file 2016-11-18 11:03:38 +01:00
Steven Cooreman ed905b7cc8 Revert "[EFR32] Move the mbedTLS hardware acceleration code to EFR32 family"
This reverts commit a0f62b1e4f.
2016-11-18 11:00:57 +01:00
Steven Cooreman dc71c664db [EFR32] Fix linker script for ARMCC
Updated available RAM size and increased reserved heap to 4K
2016-11-08 18:32:09 +01:00
Steven Cooreman a0f62b1e4f [EFR32] Move the mbedTLS hardware acceleration code to EFR32 family 2016-10-28 11:11:58 -07:00
Steven Cooreman c0301b15d2 [EFR32] Adding hardware acceleration for mbed TLS
Initial check-in of hardware acceleration support on EFR32 for mbed TLS (AES, SHA and ECC).
2016-10-27 23:28:25 -07:00
Steven Cooreman 035c08dcfd [EFR32] Add initial support for EFR32
Adding target definitions and the HAL implementation for EFR32 Mighty Gecko
2016-10-27 23:26:27 -07:00
Steven Cooreman 214d1be2a9 [EFM32] Move board controller pin setting to config system 2016-10-27 23:22:11 -07:00
Steven Cooreman 5a885137f0 [EFM32] Move board controller pin setting to config system 2016-10-27 23:21:39 -07:00
Steven Cooreman a9fe108266 [EFM32] NVIC virtualization was not committed for CM0
This is a workaround to fix the breaking build until someone adds NVIC virtualization to the CM0plus CMSIS header
2016-10-25 09:51:25 -07:00
Steven Cooreman 220363b099 This one slipped through 2016-10-24 18:30:03 +02:00
Alessandro Angelino eb86d12aee EFM32: Add support for uVisor 2016-10-24 18:29:51 +02:00
Alessandro Angelino 371d652a04 EFM32: Use SECURE_ACCESS to access the ROM table
To allow enabling of uVisor on EFM32, the ROM table must be accessed
through the CMSIS-provided SECURE_ACCESS macro.
2016-10-24 18:29:37 +02:00
Steven Cooreman 0b6ed71626 [EFM32] Move clock configuration to target settings
Moving the per-board clock configuration (which oscillators are available on the board, their frequencies, and which ones to use) as config options to the target database. This way, they're more easily overridable when third parties start creating boards with EFM32 MCUs
2016-10-24 18:29:25 +02:00
Steven Cooreman 758d160384 [EFM32] Collapse NVIC relocation handling
Gecko SDK 5.0.0 provides a convenient define for the amount of vectors wired on the chip, so we can use that to collapse the cmsis_nvic.h header
2016-10-24 18:29:00 +02:00
Steven Cooreman 3c450f1b37 [EFM32] Update emlib to version 5.0.0 in preparation for new targets
* Updated cmsis headers to match emlib 5.0.0
* Updated GPIO handling to match new header guards in use
* Updated linker scripts to match emlib 5.0.0
2016-10-24 18:26:02 +02:00
Steven Cooreman bb03e8c9e4 [EFM32] More condensation 2016-10-24 18:25:21 +02:00
Steven Cooreman 6315147faf [EFM32] Use serial configuration from platform
mbed added configuration options for default serial baud rate and stdio baud rate, so we can get rid of the workaround in the HAL
2016-10-24 18:25:11 +02:00
Steven Cooreman 1f3003fb22 [EFM32] Small fixes
* Use mbed_error
* Include cmsis headers by default when grabbing device.h
* Get rid of enum to uint casting in pinmap
2016-10-24 18:24:59 +02:00
Steven Cooreman 4df6986100 [EFM32] Use targets.json to improve directory structure
Now that we have targets.json, we get target inheritance and can use it to clean up the EFM32 folder structure.
* In the top-level EFM32 folder, there are now folders per MCU family (Giant, Leopard, ...)
* Those family folders contain the CMSIS headers in the 'device' subfolder, as well as global family headers (i.e. mapping of pins to peripherals)
* Inside of the family folder, there is a per-target folder containing target settings. In the future, we'll want to get rid of those by using the config system provided by targets.json
2016-10-24 18:24:49 +02:00
Steven Cooreman 6574f4d0a4 [EFM32] Clean up per-target Modules.h
Removed deprecated defines MODULES_SIZE_* and moved the setting for the SPI asynch transfer queue size to targets.json, where it apparently belongs
2016-10-24 18:24:33 +02:00
Steven Cooreman b766c48744 [EFM32] Condense common header files
First wave of squashing header files in order to get to a more sensible folder tree.
* Moved header files with 100% similarity to common folder
* Created a CommonPinNames.h header containing the base pin names P[A-F][0-15] and NC
2016-10-24 18:23:51 +02:00
Alessandro Angelino f818aa17a2 EFM32: Add support for uVisor 2016-10-10 11:43:56 +01:00
Alessandro Angelino b01b7c5019 EFM32: Use SECURE_ACCESS to access the ROM table
To allow enabling of uVisor on EFM32, the ROM table must be accessed
through the CMSIS-provided SECURE_ACCESS macro.
2016-10-10 11:43:56 +01:00
Alessandro Angelino d1ad26f7ea EFM32: Make NVIC functions virtualizable
With CMSIS 5, the NVIC functions are virtualizable. Rename the EFM32
NVIC functions to support being virtualized.
2016-10-10 11:43:56 +01:00
Christopher Haster 26ced98734 restructure - Restructured cmsis directory
targets/cmsis -> cmsis
targets/cmsis/TARGET_* -> targets/TARGET_*/device
targets/cmsis/TARGET_*/mbed_rtx.h -> targets/TARGET_*/mbed_rtx.h
2016-10-04 17:51:44 -05:00
Christopher Haster 0bad622a16 restructure - Moved targets out to top level
hal/targets -> targets
hal/targets.json -> targets/targets.json
2016-09-30 19:18:09 -05:00