Stratify Toolbox

by Stratify Labs, Inc.

A printf()-ing awesome flash & debug tool

View all updates Apr 28, 2021

Prototype Headed to Crowd Supply Soon!

by Tyler G

I am getting ready to send a prototype to Crowd Supply. This is an exciting step! Crowd Supply requires all projects to send them a prototype before they launch. This gives them a chance to kick the tires and ensure backers will get what they pledge for. While writing up a how-to guide for the prototype, it occurred to me that I might as well share it with all of you. So here you go!

The Setup

I will be sending:

  • One Stratify Toolbox
  • One SD Card (inserted in the Toolbox SD Card slot)
  • One STM32F401 development board (will be used as the target)
  • One 10-pin ribbon cable
  • Two USB cables to provide power to the Toolbox and dev board
  • Two USB Power adapters (or just use a powered USB hub)
  • Breadboard prototype wire in case you need to reset the device

And here’s what that looks like:

First Things First

The first step will be to connect the USB cable to the Toolbox and power it using one of the supplied adapters (or a powered USB hub). Because of a hardware bug, the battery will definitely be dead by the time you receive the package. Upon applying power, the Toolbox will start-up to the battery status screen. You need to wait until the battery voltage is above 3.5 V to continue. If you try to do anything while the voltage is less than 3.5 V, the Toolbox will display a dialog that prevents you from doing so.

The embedded web server will start and try to connect to the Wi-Fi. It won’t be able to, so it will ask you if you want to configure it. You will definitely want to do that. The following video shows a quick walkthrough of the process.

Incidentally, I hope you like the jingle in that video because I used it in all four of them. (But don’t worry, I won’t be offended if you decide to mute it.)

Next Things Next

Without using a computer at all, you can connect the Toolbox to a target board and verify that the SWD and trace output are working correctly. This next video shows how to connect the STM32F401 development board to the Toolbox and then use the touch display to flash a binary and view the trace output. This is a great way to make sure that everything’s working before you dive into serious development.

Please note: the wire coming off the development board is connected to the UART TX line of the STM32F401. It connects to pin 4 on the Toolbox (as shown in the Pinout)

On to the Web Application

The Toolbox serves a web application when you are at the startup screen. You can always get there by pushing the red "X" in the top right until you see the IP address of the device pop up (and the "X" goes away). While the server is running, you just point your browser to http://<ip address>. The web application loads as a single file and then performs HTTP REST API requests as necessary. You will see the loading bar on the Toolbox display when you load the app. If it completes the load and stays blank, just try reloading the page.

Before you can flash binaries using the web application, you need to download the binaries from the Toolbox. You do that using the "Files" section. After you download the slow.bin and fast.bin demo binaries, you can drag and drop them in the "Flash" section to program the target. The "Trace" section lets you view real-time trace output. You’ll want to ignore the "Debug" section for now.

You will also notice the documentation is built right into the web application, so there is no need to go searching around. Everything you need to know about how to use the Toolbox is available right there.

Where the Rubber Meets the Road

The touch display and web application provide a layer of convenience when you’re getting started or if you just want to take a quick look at something. But the real work is done using the command line. This is where you can integrate the Toolbox right into your build system and use it when iterating on your code.

In the video, I am using a zsh shell. First, to make things a little easier, I create a shell variable for the http address:

export tbox=http://<ip address>

Then you can download the slow.bin and fast.bin files using:

curl $tbox/fs/home/user/slow.bin > slow.bin
curl $tbox/fs/home/user/fast.bin > fast.bin

Then to flash the target:

curl -X PUT --data-binary @slow.bin $tbox/flash/program/type/bin/start/0x08000000
curl -X PUT --data-binary @fast.bin $tbox/flash/program/type/bin/start/0x08000000

I don’t show it in the video, but you can view the Trace output using:

curl $tbox/trace/stream

Just hit <ctrl-c> when you’re done with the stream.

If you want to tinker, you can use the following commands to see what requests are available:

curl $tbox/flash/help
curl $tbox/trace/help
curl $tbox/fs/help

Troubleshooting

No prototype demo would be complete without some never-before-seen failures, so let me give you a few tips in case things are not working as expected:

  • Try resetting. Use the breadboard wire I sent to hit the reset button through the pin-hole on the side of the Toolbox next to the USB.
  • Make sure the SD card is inserted properly (then do a reset). You can do this by pushing the SD card in and allowing it to pop out then reinserting it.
  • Your nuclear option is to let the battery die, ensure the SD card is in correctly, then re-attach the USB power cable.
  • If you see the Stratify Labs logo on the display, let the device charge for 15 minutes, then try resetting it.

Have fun!

About the Author

Tyler G

StratifyLabs  ·  StratifyLabs  ·   HIGHLAND, UT


This project is launching soon.

Coming Soon
8
updates

Credits

Stratify Labs, Inc.

Stratify Labs builds tools that help developers bring IoT products to life including Stratify OS. Stratify OS is a microcontroller operating system built specifically to handle the growing complexity demanded by IoT devices. It features complete kernel/application separation (in both the build and execution), filesystem and hardware abstraction, automatic updates, as well as built-in networking and security. We also are building the Toolbox (powered by Stratify OS), but you already knew that.


Tyler Gilbert

See Also

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: