Use the C0-microSD in your Next Low SWaP System Design

Manufacturing/Robotics

Manufacturing/Robotics

The Signaloid C0-microSD card is a low-power Field-Programmable Gate Array (FPGA) System-on-Module (SoM) in the form factor of a microSD card. The module implements proprietary logic that provides an SD block storage device interface to a host system (e.g., Linux, macOS, or some embedded operating system): When plugged into a host computer, the C0-microSD will present itself as an unformatted block storage device. A host system can perform block I/O operations to the C0-microSD to exchange data with it, just as it would to a microSD storage card. A host can in this way use the block I/O interface to load new FPGA bitstreams to the C0-microSD, or can use the block I/O interface to interact with an instance of a RISC-V SoC that the C0-microSD can be made to load at power-up. The built-in Signaloid SoC soft-processor can execute your custom applications compiled for the RISC-V (RV32I) instruction set architecture (ISA) and supports a subset of Signaloid's UxHw technology. The C0-microSD supports both the full SD interface and SD-over-SPI, making it easy to deploy it in systems ranging from microprocessor-based host platforms with a full operating system and filesystem, to microcontroller-based systems with a basic runtime and SPI support.

Figure 1: The C0-microSD is a low-power System-on-Module (SoM) in the form factor of a microSD card and which can be used as either an accelerator implementing Signaloid's UxHw technology, or can be used as a general-purpose FPGA module.

Why It Matters

Many existing embedded platforms such as industrial programmable logic controllers (PLCs) and microcontroller-based embedded computing platforms contain unused microSD or full-size SD slots. Because it presents itself as a regular microSD block storage device when plugged into a system, the Signaloid C0-microSD system-on-module provides an easy mechanism for designers of such systems to extend their system's capabilities with a removable and hot-pluggable hardware acceleration module. The C0-microSD can be used to implement either custom logic circuits using its built in FPGA, or can be used to run software that takes advantage of Signaloid's UxHw technology for real-time analysis of the uncertainty of the outputs of computational models.

The Technical Details

The Signaloid C0-microSD can run in three different modes:

  1. In its Bootloader Mode, the C0-microSD presents itself as a SD block storage device and I/O to a specified set of block offsets allows a host system to load either FPGA bitstreams or RISC-V program binaries into the on-board 128 Mbit non-volatile flash memory

  2. When in FPGA Mode, the C0-microSD is completely taken over by a developer's FPGA bitstream, previously loaded into the flash memory using the bootloader mode. While conceptually easier to think of it as a separate mode, the FPGA Mode is functionally the same as the Bootloader Mode and is activated when in Bootloader Mode if no SD protocol host controller is detected initialising the SD interface.

  3. In the Signaloid SoC Mode, the C0-microSD loads a RISC-V binary previously loaded into the flash memory using the bootloader mode and runs that program using the Signaloid SoC. Like the bootloader, the Signaloid SoC allows a host platform into which the C0-microSD is plugged to communicate over the SD interface, and in this mode such communication is to a set of pre-define SD block I/O addresses. These addresses correspond to one command register, one status register, one 4KiB MOSI (Manager Out Subordinate In) buffer, and one 4KiB MISO (Manager In Subordinate Out) buffer. The Signaloid SoC has access to these registers and buffers as memory-mapped I/O.

Figure 2: You can use the C0-microSD in the microSD slots of many existing embedded systems, accessing it just as you would a standard microSD storage device, using block I/O transactions.

The Signaloid C0-microSD supports communication with a host platform using either the 4-bit SD interface that is most commonly used in full-featured host platforms, as well as the the SD-over-SPI interface that is most commonly used by microcontroller-based host systems. For both of these types of hosts, the C0-microSD appears as an unformatted SD block storage. Because some microcontroller-ecosystem libraries for communicating with SD cards (e.g., ESPIDF, Arduino, etc.) make assumptions that the cards they are interfacing with are formatted with FAT16 or FAT32 filesystems, developers hoping to reuse such libraries on microcontroller hosts may need to modify their SD interface functions to not check for an existing filesystem. As an alternative to microcontroller libraries targeted at SD cards formatted with FAT16 or FAT32 filesystems, we have developed a CircuitPython library that developers can use for communicating directly with the C0-microSD. The library provides several convenience features to ease interfacing with the C0-microSD, such as definitions for the correct offset addresses for configuring the Signaloid C0-microSD and communicating with the Signaloid SoC, and so on.

In Signaloid SoC Mode, the C0-microSD can run software that takes advantage of Signaloid's UxHw technology for real-time analysis of the uncertainty of the outputs of computational models. This allows system developers to obtain, for example, real-time information on how much confidence they can have in the outputs of in situ data analysis. For example, Figure 3 shows the output of a calculation of power used by an embedded system, measured using a current sensor. For the example, the current sensor measures a potential drop of 300 mV with 10 uV accuracy, across a sense resistor with nominal resistance of 1 mOhm and a 1% tolerance. The plot in Figure 3 shows how, as a result of the uncertainty in the voltage measurement and resistance value, the current measurand could be anywhere from 294 mA to 306 mA with a standard deviation of approximately 3 mA. The C0-microSD can provide distributions such as the one Figure 3 shows, in real time, allowing developers to create safer or more appropriately-specified systems.

To allow developers to better understand how they might build applications such as the one described above, we provide pre-compiled examples of applications that are able to track uncertainty in their data and run on the Signaloid SoC. One such example, the Signaloid C0-microSD Demo Calculator application, allows you to do basic arithmetic operations between two random variables that follow a uniform distribution. As host platform and to enable developers to see a working demo without needing to write any code, the Signaloid C0-microSD Demo Calculator example uses the M5Stack Cardputer, a popular ESP32 based embedded platform with a built-in OLED screen, a compact keyboard, and a built-in a microSD slot.

Figure 3: Example uncertainty in sensor output for a current sensor which can be calculated in real-time by the C0-microSD. For a current sensor measuring a potential drop of 300 mV with 10 uV accuracy across a sense resistor with nominal resistance of 1 mOhm and a 1% tolerance, the current measurand could be anywhere from 294 mA to 306 mA, with a standard deviation of approximately 3 mA.

Relevant Code Example

The following is an example application running on the Signaloid C0-microSD, which sums 128 floating point values from the MOSI buffer, and stores the result is the first four bytes of the MISO buffer.

#include <stdint.h>
#include "C0microSDConstants.h"

enum {
	kCalculateNoCommand	= 0,
	kCalculateSum		= 1,
	kCalculationSize	= 128,
};

int
main(void)
{
	volatile SignaloidSoCStatus *	mmioStatus = (SignaloidSoCStatus *) kSignaloidSoCDeviceConstantsStatusAddress;
	volatile uint32_t *			mmioCommand = (uint32_t *) kSignaloidSoCDeviceConstantsCommandAddress;
	volatile float *			mmioWriteBuf = (float *) kSignaloidSoCDeviceConstantsMISOBufferAddress;
	volatile float *			mmioReadBuf = (float *) kSignaloidSoCDeviceConstantsMOSIBufferAddress;
	float						result; 

	while (1) {
		*mmioStatus = kSignaloidSoCStatusWaitingForCommand;
		while (*mmioCommand == kCalculateNoCommand) {}
		*mmioStatus = kSignaloidSoCStatusCalculating;

		switch (*mmioCommand) {
			case kCalculateSum:
				result = 0;
				for(size_t i; i<kCalculationSize; i++) {
					result += MOSIBuffer[i];
				}
				MISOBuffer[0] = result;
				break;
			default:
				*mmioStatus = kSignaloidSoCStatusInvalidCommand;
				break;
		}

		*mmioStatus = kSignaloidSoCStatusDone;
		while (*mmioCommand != kCalculateNoCommand){}
	}
}
The Takeaway

The C0-microSD is a versatile tool for engineers who want to extend the capabilities of their existing embedded platform with either additional computational power, or the capability of running uncertainty-tracking applications. You can learn more details about the C0-microSD at the official documentation page.

Gallery
Schedule a Demo Call
Request Whitepaper
Schedule a Demo Call
Request Whitepaper
Schedule a Demo Call
Request Whitepaper