Table of Contents

nBlocksStudio1.0 Installation

nBlocksStudio1.0 is using mbed-cli infrastructure including GCC compiler, for the microprocessor code compilation.
The Graphical interface is written in Python and is accessing the n-Blocks.net server when it starts, to get the definition of the Nodes



Install Python

Both mbed-cli and nBlocksStudio are based on Python.

Both should work from any directory
If pip version is later than 9.0.3 mbed-cli might not work 1), so change to 9.0.3:

 pip install -U pip==9.0.3 




Install mbed-cli manually

References: 2) 3) 4)



mbed tips

mbed online compiler how to use OS2 or OS5

References: 9)

 To make sure you are using the desired library delete the mbed library from your project in the online compiler and then 
  import either the mbed-dev (if you would like to use mbed OS 2) or the mbed-os (if you prefer mbed OS 5). 

How to import an existing program from mbed online compiler to mbed-cli and compile it

How to create new mbed-cli project for OS2 or OS5

References: 10)

Alternative method to import OS2 program from mbed online compiler

I had issues with the import method described above. This Alternative method works.Tested for Target LPC11U35_401 [20 May 2020]

Update mbed OS to a specific version







Install n-Blocks Studio




Use n-Blocks Studio


....\Studio\Launch.cmd
 from tkinter import TclError

to

from Tkinter import TclError 
 pip install enum 
 pip install pywinusb
 pip install requests

When exporting, save into the file main.cpp inside folder mbed_code, and build with:

C:....\mbed_code> mbed compile -t GCC_ARM -m LPC1768

Above creates a [.bin] file. (at …\mbed_code\BUILD\LPC1768\GCC_ARM)
To automate the build process and use a different target n-Block/processor, call one of the [tested] batch files




4 bit binary counter example with n-Blocks Studio


This example diagram (a 4 bit binary counter) creates the main.cpp below:

/* ================================================================ *
 *       Automatically generated by n-Blocks Studio Designer        *
 *                                                                  *
 *                         www.n-blocks.net                         *
 * ================================================================ */
#include "nblocks.h"
 
 
// -*-*- List of node objects -*-*-
nBlock_Ticker                 nb_nBlockNode0_Ticker;
nBlock_FlipFlop               nb_nBlockNode13_FlipFlop;
nBlock_FlipFlop               nb_nBlockNode3_FlipFlop;
nBlock_GPO                    nb_nBlockNode12_GPO;
nBlock_FlipFlop               nb_nBlockNode14_FlipFlop;
nBlock_FlipFlop               nb_nBlockNode15_FlipFlop;
 
// -*-*- List of connection objects -*-*-
nBlockConnection         n_conn0(&nb_nBlockNode0_Ticker, 0, &nb_nBlockNode3_FlipFlop, 0);
nBlockConnection         n_conn1(&nb_nBlockNode3_FlipFlop, 0, &nb_nBlockNode12_GPO, 0);
nBlockConnection         n_conn2(&nb_nBlockNode3_FlipFlop, 0, &nb_nBlockNode13_FlipFlop, 0);
nBlockConnection         n_conn3(&nb_nBlockNode13_FlipFlop, 0, &nb_nBlockNode12_GPO, 1);
nBlockConnection         n_conn4(&nb_nBlockNode13_FlipFlop, 0, &nb_nBlockNode14_FlipFlop, 0);
nBlockConnection         n_conn5(&nb_nBlockNode14_FlipFlop, 0, &nb_nBlockNode12_GPO, 2);
nBlockConnection         n_conn6(&nb_nBlockNode14_FlipFlop, 0, &nb_nBlockNode15_FlipFlop, 0);
nBlockConnection         n_conn7(&nb_nBlockNode15_FlipFlop, 0, &nb_nBlockNode12_GPO, 3);
 
 
// -*-*- Main function -*-*-
int main(void) {
    SetupWorkbench();
    while(1) {
        // Your custom code here!
    }
}




References