Design and more design…

Mechanical design

Image is from USB side of The Mystery Box. It’s my designed SDR radio. Other end has SMA for antenna. PCB’s are ordered with assembly service. Them should be ready on next week and arrive to me about three working days later from that.

I intentionally selected round connectors for USB and antenna. It should be easy to drill holes for them altough case is aluminum. Possibly even easier when case ends are connected to center piece. USB connector hole size is 12.7 mm but it can be round to 14 mm so that I can use standard drill bit. SMA connector hole size is 6.5 mm which is already standard size.

Software design – Mbed OS and Tiny IIO Daemon

After massive amount of research I think I can at least try to set up Arm Mbed operating system and Tiny IIO Daemon to The Mystery Box device. Mbed OS consumes about 55kB of flash memory. The onboard STM32L476RG MCU has 1MB of flash memory so there is plenty of room for custom program.

Guide to porting Mbed OS to new device is there:
https://os.mbed.com/docs/mbed-os/v6.9/porting/porting-custom-boards.html

Porting process is even easier because The Mystery Box is designed on top of Nucleo development board which is already supported by Mbed OS. Some minor configuration might be only thing that must be done before it is possible to use Mbed Studio to program and upload programs to the device.

There is only one code example for Tiny IIO Daemon on the Internet:
https://github.com/analogdevicesinc/libtinyiiod/blob/master/example.c

However it is enough. Running Tiny IIO Daemon continuously is very easy and program is quite simple. This is taken from above link:

int32_t main(void) {
	struct tinyiiod *iiod = tinyiiod_create(&ops);

	set_handler(SIGHUP, &quit_all);
	set_handler(SIGPIPE, &quit_all);
	set_handler(SIGINT, &quit_all);
	set_handler(SIGSEGV, &quit_all);
	set_handler(SIGTERM, &quit_all);

	while (!stop)
		tinyiiod_read_command(iiod);

	tinyiiod_destroy(iiod);

	return 0;
}

I have an idea how IIO daemon could work. I will test it as soon as I receive The Mystery Boxes from prototype manufacturer. Idea is that receiver and transmitter are turned off by default. Only when data is requested receiver is turned on momentarily and when data is about to send transmitter is turned on momentarily. Only parameter is frequency.

Frequency is controlled with local oscillator through SPI port. I haven’t found yet any example about how to control SPI with IIO daemon. In theory it is possible with GNURadio from Linux computer when IIO daemon is running.