Commit Graph

186 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

Author SHA1 Message Date
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00
Steven Cooreman 55c6dade3d Apply changes corresponding to #7817
QSPI standard pin names were changed after the QSPI feature PR.
2018-08-27 10:10:18 +02:00
Steven e0d033bdd1 Allow unaligned input/output for QSPI
The code is written such that access to the data input/output happens word-by-word, and that means unaligned access is fine (though with a performance loss) on Cortex-M3/M4 devices.
2018-08-27 10:03:08 +02:00
Steven 845a5beb30 Initial commit of Silicon Labs QSPI HAL implementation
* For EFM32GG11, since that is the only Silicon Labs target with QSPI per today
* Verified working using the on-board flash and tests-mbed_hal-qspi
2018-08-27 10:03:08 +02:00
Russ Butler 22ebf69dea Revert "EFM32: Use SECURE_ACCESS to access the ROM table"
This reverts commit 1b0922e97b.
2018-08-25 20:40:35 -05:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
Cruz Monrreal bb7b97cadc
Merge pull request #7491 from evva-sfw/feature/EFM32_make_PeripheralPins_overridable
EFM32: fix weak PeripheralPins configuration
2018-07-20 08:01:39 -05:00
PHST 804edd578e Place "MBED_WEAK" for IAR-Toolchain before the type. 2018-07-17 08:12:41 +02:00
PHST de266d827e Added missing include. 2018-07-16 19:28:54 +02:00
PHST 1658349965 Replace __attribute__((weak)) with MBED_WEAK 2018-07-16 15:38:25 +02:00
PHST a8dcf52971 Make PeripheralPins.c configuration tables weakly defined to be overridable for target EFM32GG11. 2018-07-16 12:35:44 +02:00
PHST 95d78df962 EFM32 Make PeripheralPins.c configuration tables weakly defined to be overridable.
See issue "https://github.com/ARMmbed/mbed-os/issues/7424#issuecomment-404233377"
2018-07-16 11:48:53 +02:00
Steven Cooreman 86491627bf Add implementation for CRC API 2018-07-16 11:08:45 +02:00
Steven Cooreman 001844231b Add EFM32GG11_STK3701 support 2018-07-11 10:45:38 +02:00
Cruz Monrreal 513960f17d
Merge pull request #7386 from evva-sfw/feature/make_clock_src_changeable
Make clock source changeable over mbed_app.json for EFM32-Targets
2018-07-05 10:39:11 -05:00
PHST 9d9db81841 Make clock source changeable over mbed_app.json
By adding the missing include the clock source for EFM32-Targets is changeable over mbed_app.json.
2018-07-02 10:04:05 +02:00
Cruz Monrreal 42b3ef7bd5
Merge pull request #6991 from amq/efm32-universal-rtx
EFM32: make mbed_rtx.h depend of families instead of targets
2018-05-29 10:39:27 -05:00
Cruz Monrreal 88d863aaeb
Merge pull request #6984 from stevew817/'efm32_irq_bugfix'
EFM32 IRQ handling fix
2018-05-29 10:38:55 -05:00
Cruz Monrreal 1a0c2d0600
Merge pull request #6970 from stevew817/efm32_flash_bugfix
Fixes to EFM32 port
2018-05-29 10:38:30 -05:00
Cruz Monrreal fe43377939
Merge pull request #6947 from evva-sfw/hotfix/EFM32PG12_STK3402_Expansion_Header
EFM32PG12_STK3402 - Correct wrong Expansion-Header pin namings
2018-05-29 10:36:31 -05:00
Bartek Szatkowski a305d849a8 Rename LOWPOWERTIMER to LPTICKER 2018-05-25 13:06:56 -05:00
Martin Kojtal 73de4e6e48 efm32: remove unused undefined function from rtc 2018-05-25 13:04:23 -05:00
Steven Cooreman 81e6c96014 Code style fixes requested by @0xc0170
Tests still passing
2018-05-25 12:59:19 -05:00
Steven Cooreman 4b3bde1082 Re-implement RTC for Silicon Labs targets
mbed RTC specifications now dictate that the RTC needs to retain and keep on counting through reset. On Silicon Labs parts, this means the RTC API can not be backed by the Silicon Labs RTC peripheral, since that doesn't provide retention functionality.
Therefore:
* On EFM32GG, EFM32WG, EFM32LG: mbed RTC API is now backed by BURTC.
* On EFM32PG, EFR32MG, EFM32PG12, EFR32MG12: mbed RTC API is now backed by RTCC.
* On EFM32ZG, EFM32HG: mbed RTC API is sadly no longer supported, since these chips don't have retained memory.
2018-05-25 12:57:30 -05:00
Steven Cooreman 1448f81620 Re-implement us_ticker and lp_ticker for Silicon Labs targets
Re-implemented both us_ticker and lp_ticker to match the new API and specifications.
Details:
* On EFM32GG, EFM32WG, EFM32LG, EFM32HG, EFM32ZG: Use the RTC peripheral to back lp_ticker, and a TIMER to back us_ticker.
* On EFM32PG, EFR32MG, EFM32PG12, EFR32MG12: Use the RTCC peripheral to back lp_ticker (dual-purpose, also used to back RTC), and a TIMER to back us_ticker.
2018-05-25 12:20:10 -05:00
Steven Cooreman 5590f2b495 Re-implement RTC for Silicon Labs targets
mbed RTC specifications now dictate that the RTC needs to retain and keep on counting through reset. On Silicon Labs parts, this means the RTC API can not be backed by the Silicon Labs RTC peripheral, since that doesn't provide retention functionality.
Therefore:
* On EFM32GG, EFM32WG, EFM32LG: mbed RTC API is now backed by BURTC.
* On EFM32PG, EFR32MG, EFM32PG12, EFR32MG12: mbed RTC API is now backed by RTCC.
* On EFM32ZG, EFM32HG: mbed RTC API is sadly no longer supported, since these chips don't have retained memory.

# Conflicts:
#	targets/TARGET_Silicon_Labs/TARGET_EFM32/lp_ticker.c
#	targets/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c
#	targets/targets.json
2018-05-25 12:20:10 -05:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
amq d9fcbc7605 EFM32: make mbed_rtx.h depend of families instead of targets 2018-05-23 15:56:38 +00:00
Steven c2bc20ef74 Fix to flash API on EFM32
* Since mbed does not overwrite itself, make the flashing routines run out of flash by default
* Report a writeable size of 4 bytes (previously erroneously reported a full eraseable page as the minimum write size)
2018-05-22 22:55:49 +02:00
Steven 30db7fd441 Update pinout of TB_SENSE_12 to production revision
* Updated pinout of EXP header from pre-production to production
* Move assignment of PF7 to SPI_2 to be compatible with the new SPI flash routing
2018-05-22 22:54:24 +02:00
Steven b011e2b8c7 EFM32 IRQ handling fix
* IRQ handling got updated previously to a non-functional state when both callbacks were registered (it'd fire a fall callback for both rise and fall events). With this update, that faulty behaviour is corrected. Due to delays between the detection of the edge and the handling of the interrupt (and the fact that information about which edge you received on the pin is not stored anywhere), there is no way to be absolutely sure which edge got triggered on the pin. Therefore, we make a best-guess effort by looking at the pin state at the time of IRQ handling, and fire a callback as if that was the end state of the event. This will usually work out fine, except in cases were the signal is toggling faster than the IRQ handler's response time. In that case, a user won't get both callbacks (as expected for a pulse), but only the last event.
* Stripped some dead code.
2018-05-22 22:43:43 +02:00
PHST 69207457a0 EFM32PG12_STK3402 - Correct wrong Expansion header Pin naming
Referencing to "UG257: EFM32 Pearl Gecko PG12 Starter Kit User's Guide - Chapter 4" (https://www.silabs.com/documents/public/user-guides/ug257-stk3402-usersguide.pdf) it should be like in this commit.
2018-05-18 08:39:14 +02:00
Steven Cooreman 780c4c537a Revert file permissions to non-executable 2018-04-23 08:21:20 -05:00
Steven Cooreman c0ee42a6e7 Update to EFR32 15.4 driver
* Updates driver library to v2.3.1 (2018q1) for bugfixes and convenience functions
* Provides library in correct format (2-byte wchar_t flag) for compiling with ARMCC (#6695 uncovered by #6577)
* Reverts to using a statically-allocated packet buffer since malloc is not thread-safe (and the asserts have been turned on)
2018-04-22 23:23:02 -05:00
Steven Cooreman e487043c11 Set up the ISR stack pointer in the right location on ARMCC
EFR32MG1, EFR32MG12 and EFM32PG12 didn't have a fixed ARMCC linker script yet.
2018-03-27 23:03:49 +02:00
amq 82ecf7e81a Make gpio interrupts faster by offloading expected state check to user 2018-03-09 16:10:10 +01:00
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
Marcus Chang 954ae4a52a itm_api.c implementation for Silicon Labs EFM32 series
SWO frequency: 875 kHz
2018-02-16 08:24:42 -08:00
amq fdc2274720 EFM32: make peripherals conditional
* MCUs within a family like EFM32GG can omit some peripherals, e.g. EFM32GG230 doesn't have UART
* This commit adds a check to make them compilable, relevant mainly for custom boards
2018-01-31 17:35:26 +00:00
PHST 7719c25a99 Add missing EFM32 HAL flash init/deinit function calls 2018-01-24 08:20:38 +01:00
Cruz Monrreal 3cb9728ae7
Merge pull request #5854 from SiliconLabs/bugfix/rtc_overflow
Fix for Silicon Labs RTC
2018-01-16 16:07:43 -06:00
Steven Cooreman 5d6c5dd81d Fix for #5840
This commit fixes #5840. Fix verified by running mbed_hal-lp_ticker test suite with preloaded RTC counter such that it wrapped in the middle of the suite.
Also removes explicit sleep blocking from the us_ticker implementation, since sleep blocking for us tickers is done at mbed HAL level now. This was causing one of the lp_ticker tests to fail.
2018-01-15 21:21:53 +01:00
Steven Cooreman 18c973f132 Allow overriding of DCDC settings per target
Allow custom targets to override the DCDC settings by defining EMU_DCDCINIT_STK_DEFAULT to target-specific initialization values.
2018-01-15 16:36:23 +01:00
Steven Cooreman 813216306c Remove custom Silicon Labs sleep management
Standardize on the mbed sleep manager by removing the sleepmodes API, and statically redirecting hal_sleep to EM1 and hal_deepsleep to EM2.
2017-12-01 12:13:06 +01:00
Martin Kojtal 118c1bb2b4
Merge pull request #5579 from SiliconLabs/feature/rail-2.1
Upgrade Silicon Labs radio driver to v2.1.1
2017-11-30 18:10:46 +00:00
Martin Kojtal 2b84a1742f
Merge pull request #5584 from SiliconLabs/feature/emlib-5.3.3
Upgrade to Silicon Labs HAL
2017-11-30 18:09:04 +00:00
Alessandro Angelino 1b0922e97b 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.
2017-11-30 11:08:11 +01:00
Steven Cooreman c95728f6fc Fix issue with timer timebase on EFR32
Timer code was written based on integer multiple HF clock frequencies. EFR32 doesn't conform to that (38.4), and so the timestamp ticks were off by 1%. Enough to trip up some CI tests on TB_SENSE_12 (#5496)
2017-11-25 11:23:41 +01:00
Steven Cooreman e900d5a04d Squash warnings by defining 'NC' as unsigned type 2017-11-24 16:14:56 +01:00
Steven Cooreman 73bd5ff5fb Remove deprecated em_int 2017-11-24 16:01:00 +01:00
Steven Cooreman 6c6e762c49 Support USARTs up to USART5 in SPI 2017-11-24 15:53:44 +01:00
Steven Cooreman 53f88b5e26 Support USARTs up to USART5 in serial 2017-11-24 15:53:09 +01:00
Steven Cooreman 3d4cae84d5 Upgrade to emlib 5.3.3 2017-11-24 15:52:20 +01:00
Steven Cooreman 76fd28c825 Upgrade RAIL to v2.1.1 2017-11-24 12:57:43 +01:00
Jimmy Brisson 2f25744b07 Merge pull request #5223 from seppestas/master
Fix analogin scaling for EFM32 target
2017-10-13 09:22:22 -05:00
Seppe Stas 81cc5a4960 Fix analogin scaling for EFM32 target
Fixes #5115.

`analogin_read_u16` returns a value in the range `0x0000 - 0xFFF0`
since the resolution of the ADC is 12 bits. However, in
`analogin_read` this value gets divided by `0xFFFF` assuming the range
is `0x0000-0xFFFF`. This causes a small error in the value returned by
`AnalogIn::read` for the EFM32 target.
2017-09-29 16:07:33 +02:00
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 88cbc7e335 Merge pull request #4473 from c1728p9/workshop_rebase_4041
[Silicon Labs] Enable dynamic heap with ARMCC
2017-06-08 15:58:28 -05: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 d5eaa1505c [Silicon Labs] Enable dynamic heap with ARMCC
When using ARM Compiler 5, the RTX config hard-coded the heap and stack
sizes to specific values. This prevented the RTX HAL from dynamically
allocating unused memory as heap space.

Specifically, the HEAP_START define prevents this logic in RTX_CM_lib.h
from activating. The rest of the defines are also set in that header,
and should be removed from here.
2017-06-06 16:21:55 -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 85cc9c8381 Remove deprecated RTX4 config options 2017-05-30 18:55:55 +01:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01: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 59dc6da5c4 Update to Gecko SDK 5.1.2
Update RAIL library to 1.5.1
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