-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards/cpu: add support form EFM32 and starter kits #4722
Conversation
@@ -0,0 +1,75 @@ | |||
/* | |||
* Copyright (C) 2015 Freie Universität Berlin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
freie universität berlin?
Would it be possible to split up this PR? This PR adds >1200 files, which is not manageable for decent reviewing... I would propose you add each board (and their corresponding CPU) as separate PR, this should reduce the number of files at least to some extend... |
Yeah sure, I will do that. I think I will do that tomorrow. |
Thanks! |
I wasn't able to fix this last weekend, sorry. I found a few bugs while working on a Si7021 driver, which I want to fix first. |
sure, take your time! |
I will close this one in favor of #4824. Let's start with one CPU/Board and see where that goes :-) |
This PR adds initial support for the EFM32 and EZR32 MCUs by Silicon Labs. It refers to issue #1123.
The first commit adds the targets, the second commit adds the boards. It uses the existing flash scripts and Cortex architecture. It does not modify any other files.
Overview
The EFM32 and EZR32 MCUs are supported, including the new EFM32 Gemstone MCUs. All peripherals, except random number generator, are supported.
An overview1,2:
It targets the following boards2:
Features
LOW_POWER_ENABLED=0
, disables USB UART on STK3200, because it is connected to LEUART0).AEM_ENABLED=0
)RTT_AS_RTC=1
.Documentation
I have prepared wiki pages for the boards here.
Testing
I have a STK3200, SLSTK3401A and STK3600. The STK3700 and STK3800 are identical to the STK3600.
The applicable peripheral tests compile and work, with a few exceptions:
periph_rtc
fails on STK3200 (problems with timer).periph_uart
exceeds RAM on STK3200.periph_spi
compiles and works, but I haven't found a way to actually verify what is send on the pins.I noticed two odds:
periph_spi
hardcodes PULLUP for output pins. This is not supported by the GPIO peripheral of EFM32.perip_rtc
behaviour depends on implementation (time_t
wrapper vs dedicated peripheral).TODO
Long term (probably not in this PR):
Conclusion
I know this PR is using vendor libraries. As mentioned in #1123, it is not a board support package. I also know that RIOT-OS targets as efficient code as possible. That said, emlib (the vendor library) does increase the code size, but adds flexibility. I have reported this before, but I expected a constant increase. To verify/research this, I conducted several benchmarks with different compile options and a few boards. The results of approximately 2200 compilations can be found here (large file!)3,4. I see an increase of 3-4 kb compared to other boards5.
I fully understand that the above may influence the decision not to include this PR in RIOT-OS. But #1123 is open for quite some time, and this could serve as a starting point for optimization. The targeted MCUs have variants with enough flash and ram. Furthermore, It did not stop me from learning about RIOT-OS, EFM32, embedded and coding in general, so no hard feelings. I will probably still use it for my personal projects.
Footnotes
1 EZR32 Wonder Gecko is missing, but is already included in RIOT-OS. There is no compatibility or overlap.
2 SLWSTK6220A is missing, but is already included in RIOT-OS. There is no compatibility or overlap.
3 Parallel builds using
make -jN
forN > 1
failed in many cases with 'malformed archives'. Therefore a larger number of build failed. Manually cleaning and recompiling the same code forN = 1
succeeded, however.4 Click the numbers in the TEXT, DATA or BSS column for more information.
5 My code is verbose: I explicitly reset peripherals, and initialize all parameters. Furthermore, clock setup and frequency calculation is also responsible for a big part of code (but used by multiple peripherals).