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
Both mbed-cli and nBlocksStudio are based on Python.
Python --version pip --version
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
arm-none-eabi-gcc --version git --version hg --version python --version pip --version
pip install mbed-cli
mbed --version
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).
mbed import https://developer.mbed.org/users/chalikias/code/frequency_counter/
mbed compile -S
mbed compile -m LPC1768 -t GCC_ARM
References: 10)
mbed new project1
mbed new project2 --mbedlib
mbed new .
I had issues with the import method described above. This Alternative method works.Tested for Target LPC11U35_401 [20 May 2020]
Export
Toolchain
ZIP archive (with repositories)
mbed new project_name --mbedlib
mbed compile -t GCC_ARM -m LPC11U35_401
cd mbed-os
mbed releases
update mbed-os-5.7.7
mbed releases
pip install panda3d pip install pywin32 pip install pyuserinput
hg clone https://nimbus_it@bitbucket.org/nblocksstudio/prj_nblocksstudio
hg update
...\mbed_code> mbed new . --mbedlib
...\mbed_code> mbed new .
...\mbed_code> mbed deploy
....\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
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! } }