Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silicon Labs] Add support for EFM32 Pearl Gecko #1500

Closed
wants to merge 107 commits into from

Conversation

stevew817
Copy link
Contributor

New release of the Silicon Labs HAL for mbed.
Changelog:

  • Added HAL support for the new EFM32 Pearl Gecko kit
  • Updated PWM implementation to be more in line with the expectations regarding how a PWM waveform should look
  • Pulled up the included version of emlib to the latest (4.2.1)
  • Code cleanup throughout the entire HAL
  • Updated linker scripts to reflect the correct sizes for interrupt tables

mpolojar and others added 30 commits December 2, 2015 17:23
Leopard Gecko used as baseline.

TODO

 - Peripheral/GPIO pin mappings etc for Pearl are marked "Pearl ok",
   rest are wrong

 - Missing new (4.1.0+) emlib
New version with support for Pearl & co.
PWM pin mappings. Since the pins can be freely chosen (unlike
in previous HW), there should be no need to use the other channels.

Also corrected frequency for HFXO in ref devices.
Pearl GPIO block does not support DOUTSET/DOUTCLR,
so use read+DOUTTGL instead.
Use RTCC API for lp_ticker on Pearl. Basic adaptation, but more
work is required.

Now frees RTC when ticker is not used (detected through interrupt
disable), so that sleep modes below EM2 do not remain
permanently blocked.
Removed DAC/AnalogOut, I2C1, UART0/1, LEUART1, USART2,
GPIO Drive support and GPIO port E.
ADC pinmap updated, PinMap_DAC removed, since DEVICE_ANALOGOUT not supported
Mbed needs to have interrupt vectors in RAM so reserve space at
the beginning of memory, and export the relevant symbols.
Normal UARTs not present, use USART.
Use new ROUTEPEN/ROUTELOC0 registers for selecting I2C pins.
Conditionals for including em_rtc.h and em_rtcc.h.
Use the correct interrupt name in RTCC code.
LDMA support for the dma_api module
analogin_api.c changed to make it compile.

Compilation error will be generated if _ADC_SINGLECTRL_POSSEL_MASK ||
_ADC_SINGLECTRL_INPUTSEL_MASK is not defined. This is because NEGATIVE
voltage measurement is not supported by MBED API.
Serial pin routing for Pearl. Note that this currently requires
the pins to be in the same "location", even though this is not
needed by the Pearl HW.
LDMA support for serial HAL. Adds callback support for emlib LDMA
code so that most of the old serial code can be reused.

Note: Serial shows some signs of life on the bus, but DMA mode
is completely untested.
Channel selection shifted to right place. Now It seems to work
at least with channel PC11. Weird thing is, that floating pin gives
result 0.4. Should be 0.0.
Any channel can be used. It is possible to have 4 pwm outputs
active at a same time, if PinMap_PWM configuration is done properly.

Future improvement proposal: dynamic channel selection!
LDMA now functional for both RX/TX.

One hack remains - need to check if TXC interrupt check can be
removed from older platforms, or if flagging is necessary.
GPIO pins were uninitialized. Fixed and tested.
Correct routing for SPI pins on Pearl
SPI dma forced to compile. Continuing improvements...
Number of interrupt slots reported by different files before this commit:

            giant  happy  leopard  pearl  wonder  zero
spec        39     21     39       34     39      17
nvic        39     21     39       34     40      19
startup.s   39     21     40       34     40      19
gcc link    40     21     41       34     40      19
arm link    40     22     40       -      40      16
reserved    0      0      1        0      0       2

  spec - reference manual
  nvic.h - cmsis_nvic.h
  startup.s - assembler startup files
  gcc link - efm32*.ld linker script for GCC
  arm link - efm32*.sct linker script for ARM (RVCT)
  reserved - number of 'reserved' slots at the end of irq table in startup.s files

Fixed amounts to reflect those in the startup files, including reserved
slots:

Giant
    Reduce amount in GCC and ARM linker files to 39

Happy
    Fix comment in GCC linker file
    Reduce amount in ARM linker file to 21

Leopard
    Increase amount to 40 in cmsis_nvic.h
    Reduce amount to 40 in GCC linker file (this bug caused by
    emlib 4.1.0 port commit 1923e8b4)

Wonder
    No changes, but note that ref. manual does not list FPUEH
    interrupt that is included in startup files at index 39

Zero
    Increase amount to 19 in ARM linker file
Read as not returning correct values, because RTCC (or RTC in other
Gecko's) was not initiated. This was a problem in every Gecko.

If RTCC is initiated for lptimer it is done without binding it to
irqhandler (since irq not needed). Also implementation for geckos
using RTC added.

Tested with pearl and happy geckos
stevew817 and others added 25 commits January 5, 2016 13:45
* Remove DAC reference
* Assign part of the pins to each PWM CC channel
* Add APORT4X pins to the ADC map
* Implement _free
* Make sure the pin is set to disabled
…rals, but rather allocate resources depending on how many peripherals the chip actually has. Should help with memory usage and clarity, also gets rid of a random badly-named #define in objects.
* Added PD9 back in (for some reason it was at some point removed from the pinmap, not sure why because it is a usable pin when you remove the on-board sensor or use the Pearl chip standalone)
* Fixed PWM locations to match the pin-CC channel combinations.
* Setting the PWM period now correctly updates all other channels to keep their duty cycle
* No longer keep values in RAM that can be read directly from a register
* Setting the PWM duty cycle to 100% no longer makes the signal glitch on every period
* Code condensation
…ansfer means the transaction is finished already, and its handling is thus less time-sensitive than being in the middle of an interrupt-driven Serial or SPI transaction.
Emlib should now match the standard SiLabs release. Required extensions
have been moved to dma_api and marked with LDMAx_ prefix.
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 12, 2016

Can you please resolve the conflict (=rebase) ?

I'll look at this during this week

@stevew817
Copy link
Contributor Author

New pull request opened (#1501) for the rebased branch, closing this one.

@stevew817 stevew817 closed this Jan 12, 2016
deepakvenugopal added a commit to deepakvenugopal/mbed-os that referenced this pull request Feb 9, 2018
…changes from c9bf20f..43c7ec2

43c7ec2 Merge branch 'release_internal' into release_external
ed76459 Merge pull request ARMmbed#1558 from ARMmbed/IOTTHD-2195
8d3bcb7 Add new function to unit tests
56f66a4 Review correction
8b7d018 Move indirect queue size public API to net_interface
d877c9e Review corrections
c25e476 Remove Eclipse project files for external release
d51f442 Merge branch 'release_internal' into release_external
135c48d Increase Thread SED buffer size for big packets
70931a7 Fix indirect queue packet ordering
10e51a4 API for changing Thread SED parent buffer size
6122d24 dereference null value issue fixed. (ARMmbed#1557)
d1378dc Clear IPv6 neighbor cache in partition change (ARMmbed#1554)
7610e91 Child neighbor entry updates (ARMmbed#1550)
c727295 cleared neighbours with child address that are not ours (ARMmbed#1549)
80b4d72 Thread partition merge mode TLV change (ARMmbed#1546)
edd7599 RLOC was updated before clearing child info (ARMmbed#1547)
a666056 router short address set to 0xfffe for non routers (ARMmbed#1543)
759ab05 delete route set and link set entries for a router ID (ARMmbed#1540)
23a1265 REED advertisement handling (Thread spec 5.16.3): (ARMmbed#1535)
0a32cb4 added active and pending timestamps to child update response (ARMmbed#1533)
d0eec80 Fix error case memory leak (ARMmbed#1537)
da9860f Pending set after link sync (ARMmbed#1526)
ffa1569 Thread router network data update after link sync (ARMmbed#1530)
3b46d8d Fix defects found by coverity (ARMmbed#1529)
3a57101 Fix compiler warnings and update traces (ARMmbed#1523)
c288227 Add extension check for partition weight drop in parent selection (ARMmbed#1521)
d8dea28 network data cleared after router forms new partition (ARMmbed#1525)
44a85e5 removed router flagging for thread_management_server file (ARMmbed#1524)
1cbced9 Merge pull request ARMmbed#1520 from ARMmbed/IOTTHD-2105_2
3d07365 Review corrections to network data clearing
22a0375 Clear network data from lost children
ffd8517 added a new thread management function (ARMmbed#1519)
80af9cb Thread BR network data clearing (ARMmbed#1518)
5a6f6b5 thread nvm valgrind uninitialized data fix (ARMmbed#1517)
d5e2198 Add API for partition weighting set (ARMmbed#1513)
8811d6f multicast forwarding scope changed and address registration updated. (ARMmbed#1516)
c277384 printf to tr_info (ARMmbed#1515)
bb21264 Thread combined nvm test (ARMmbed#1507)
76f7725 Primary BBR fixes from interop (ARMmbed#1512)
12ed5ab FHSS unit test: fixed fhss mac interface test (cherry picked from commit 805eb42e4416b00cc018dc32dceb353d0b6c8bb6)
dd21ea9 Remvoed unnecessary trace print's.
cb6e78b FHSS unit test: fixed fhss beacon tasklet test (cherry picked from commit abe6d671b058f4f069741eab24d51e4d62d550b0)
237b3d4 Fhss info print (ARMmbed#1486)
0f39a47 FHSS: Do not update synch monitor right after superframe change (cherry picked from commit 99d50ad9d7f8dad80f10c2a4303f4e75ab31a3c2)
c9a098f Fixed Timeoout force which actually never generate timeout.
957c7fb Pana server and client update:
ae230e5 FHSS: Update Beacon synch info in critical state
84bd8a4 FHSS: Synchronization must be done in critical state
fb1b163 Pan coordinator blacklist update
39fe6ba Added missing HAVE_RPL compiler flag
16a1bc5 MLE bootsrap and message timeout update
eeb2d39 enable BBR to support multicast registration in non   commercial networks (ARMmbed#1509)
4ea2bf8 uri modified. (ARMmbed#1510)
f443853 timeout corrected for neighbour entry (ARMmbed#1508)
ea93c1f Thread dev conf taken use (ARMmbed#1503)
5d5b239 bug fix in bbr start (ARMmbed#1505)
8dbd521 commented a trace. (ARMmbed#1504)
145dbdf device conf copy fix (ARMmbed#1502)
f60268f eid&random mac moved to device conf struct (ARMmbed#1497)
df18635 Let MAC choose address when mesh forwarding
42f916b fixed BBR stop to remove network data and routing information (ARMmbed#1500)
e058c2a pbbr changes (ARMmbed#1499)
1ece307 Merge pull request ARMmbed#1485 from ARMmbed/merge_release_back
dda8164 thread address handling updated. (ARMmbed#1496)
1dc21a1 thread extension fixes. (ARMmbed#1495)
543fe98 Merge branch 'release_internal'
bade70e Dua req changes (ARMmbed#1494)
1979df8 added status to MLR response and implemeted BMLR.ntf multicast. (ARMmbed#1492)
1807c01 mle class initialisation (ARMmbed#1488)
d809831 Merge pull request ARMmbed#1479 from ARMmbed/merge_release_to_master
bce812d Update license to Thread test file (ARMmbed#1483)
aaa4b1f Revert eclipse file removal

git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack
git-subtree-split: 43c7ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants