When STMicroelectronics joined mbed, they were very interested in code quality, shield form factor components and cross target compatibility. This lined up quite well with the development of the mbed automated test suite and our component database initiative - one solid library and example program for all platforms being developed by groups of people all around the world with similar interests.
In fact, ST was the first to pioneer the use of the mbed automated test suite for platform support development on mbed and through it set a quality acceptance criteria for a target support in the mbed SDK.
Some months later, together with the ST team, we are happy to announce that 20 shields are now fully supported and tested across 10 ST Nucleo platforms on mbed. Here is a picture of the hardware used:
While working our way to support these, we noticed that some of the existing libraries have static pin definitions, supposedly from the original hardware they were developed on. Others contain leftover code from a non-mbed software kits/platforms that they were ported from. Also not all of them were well documented and some would have no documentation at all.
We tracked how many of the existing component libraries are regularly maintained and what's the average time for a pull requests to be accepted for component libraries hosted under user (non-team) accounts. We have noticed that in some cases it would take weeks for a pull request to be accepted if the component library author is not around and this makes it hard to contribute and collaborate.
On the hardware side, a small number of shields use a dedicated 6 pin SPI connector, which is not implemented on most of the platforms on mbed and these shields require bridging between the 6 pin SPI connector and D10-D13. Also other shields require similar bridging for PWM connectivity. Once identified these incompatibilities should be explained on the component pages, so everyone can implement the provided workaround (if any).
This lead us to believe we have to set some ground rules to make it work for everyone:
- References - component libraries should contain no static peripheral code/references
- Routines - libraries should use the mbed SDK library methods/routines whenever possible
- Defines - hardware specific defines should be reduced to minimum and parameters should be used instead
- Documentation - a well documented code is mandatory, not optional
- Pin naming - example programs should refer to pins using the Arduino pin naming standard, e.g. A0-A5, D0-D15
- Teams - the code should be published in teams, not in user accounts, so team of developers would manage and accept new contributions
- Workarounds - any deviation from the shield connectivity standard should be documented on the component page and a workaround provided
To enable a team-managed collaboration workflow, we forked the component libraries and examples into two new teams that everyone can join in - components and shields teams. The components team is focused around any component libraries - either in shield or non-shield form factor, grove, etc. The shields team contains only example programs for shield components and does not contain/support any libraries.
Here's a list of all shields with cross-platform support on mbed:
|Shield name||Shield type||Product page||Support status|
|mbed Application Shield||Display, Sensors||Click to view||Supported|
|Freetronics 16x2 LCD||Display||Click to view||Supported|
|Seeed 2.8" TFT Touch V2||Display||Click to view||Supported|
|Seeed SDCard V4b||Storage||Click to view||Supported|
|W5200 Ethernet||Connectivity||Click to view||Supported|
|Seeed Wifi||Connectivity||Click to view||Supported|
|Seeed Bluetooth||Connectivity||Click to view||Supported|
|Seeed NFC V2||Connectivity||Click to view||Supported|
|Seeed XBee V2||Connectivity||Click to view||Supported|
|Seeed GPRS V2||Connectivity||Click to view||Supported|
|Ciseco SRF||Connectivity||Click to view||Supported|
|Sparkfun GPS||Sensors||Click to view||Supported|
|Freescale Multi-Sensor||Sensors||Click to view||Supported|
|Seeed Motor V2||Drivers||Click to view||Supported|
|Seeed Bot||Drivers||Click to view||Supported|
|Seeed EL||Drivers||Click to view||Supported|
|Seeed Relay V2||Actuators||Click to view||Supported|
|Seeed Energy||Power supply||Click to view||Supported|
|Seeed Charger V2||Power supply||Click to view||Supported|
|Seeed Grove V2||Hook-up||Click to view||Supported|