docs:blox:firmware-blox-firmware

This is an old revision of the document!


5.1 BLOX Firmware

BLOX provides a simple, block-based programming interface that allows users to quickly get started with electronics and coding without needing extensive knowledge. The Developer Toolbox runs entirely in your web browser and you can design your firmware, compile it and flash directly to a BLOX from within the browser - no other software needed

5.1.1 Requirements

5.1.2 Overview

The main workspace consists of

  • TOOLBOX: This is the area where you can locate the various “blocks” to piece together to build your own custom firmware
  • BLOX BLOCK: This default Block contains your program blocks. Initialize section is used to setup and initialize accessories, the Run block is executed as a loop. Drag the blocks into this main block to build your firmware
  • VIEW CONTROLS: Zoom in / Zoom out and Recenter view buttons allows you to control the view of the workspace
  • TRASH: Drag unwanted blocks to the trashcan to delete them (Or select the block, and right-click > delete; or select the block and press DEL on the keyboard). You can restore a deleted block from the trash as well
  • ACTION BUTTONS: Used to Save your firmware configuration to your Project, compile the firmware, flash it to a BLOX device, as well as for connecting to a BLOX to view the Serial Logs

You would typically follow the workflow

EDIT FIRMWARE COMPILE FLASH TESTING AND LOGS
Create Firmware using BLOX Compile Firmware Flash to BLOX Connect to view logs if needed

5.1.3 Toolbox

The toolbox contains BLOX Blocks categorised for convenience. Open the toolbox and select a block you need. Drag your block to the workspace, and plug it into the BLOX block

5.1.4 BLOX Block

The BLOX Block is the most important block in your workspace. This block is the container into which all your other development is contained. Only blocks plugged into the BLOX will be included in your firmware

The most important concept is the Initialize vs Run inputs.

Initialization Blocks

This is used to initialize settings and configurations that need to be set up once when the BLOX starts running.

It runs once at the beginning of the program, right after the BLOX is powered on or reset.

Typically used for

  • Connecting to a Wifi Network
  • Setting up Timesync
  • Configuring Stepper Motor's Axis type, Calibration, Current Setting, etc
  • Configure initialization and pin assignments for displays/sensors/modules

Run Blocks

This section contains the blocks that will run repeatedly, allowing your program to perform tasks or respond to inputs continuously.

It runs in a loop after Initialization completes, and it will keep running over and over until the BLOX is powered off or reset.

5.1.5 Add Initialization Blocks to Workspace

For example, here we dragged the Wifi Setup block into the BLOX Block's Initialization field:

Customize the settings according to your network.

When the device boots up with the firmware, it will connect to the configured Wifi network during the Initialization process

5.1.6 Add Run Blocks to Workspace

For example, here we dragged the If Wifi is Connected block into the BLOX Block's Run field:

In this example we're using it to track the status of the Wifi connection, and change the onboard LEDs on the BLOX to indicate the connection status

5.1.7 Compile Firmware

Once all your blocks are setup the way you want them, click the Compile Firmware button

Our cloud based compile service will build the firmware binary for you.

When its done, it will ask you to place the BLOX into Bootloader mode, and to select the correct port to connect to for flashing the firmware

5.1.8 Flashing Firmware

Click on the Select OpenBuilds BLOX USB Port to continue button, and in the pop up select the COM/Serial/TTY port that belong to the BLOX you connected to the computer, then click Connect.

Click on INSTALL <Your project title here> FIRMWARE

Confirm you want to proceed, and click INSTALL

Wait for the device to complete flashing. If it fails, you can try again, possibly forgot to place it in bootloader mode as instructed onscreen

Once flashing is complete, it will show Installation complete! Click Next and Close the Flashing tool.

Press the RESET button on your BLOX to let it boot up with your new firmware.

Test that it works as intended, otherwise return and update your program accordingly.

5.1.9 Debug Logs

You can use the Logs and Console option to view the live serial log coming from the BLOX

This will show the boot log and help you troubleshoot issues. In this example, you can see I don't have an SD card plugged in, which is fine, my current example program here doesn't need an SD Card so we can ignore that error. We can see we successfully connected to Wifi and recieved an IP address from DHCP

docs/blox/firmware-blox-firmware.1723744665.txt.gz · Last modified: 2024/08/15 17:57 by admin