A memory device programmer (Flash/EPROM/E2PROM) board and software, connected to PC by USB port.
Here are instructions on how to build the project.
- GNU/Linux©
- Microsoft Windows©
- Requirements
- Install Git
- Install CMake
- Install Qt and MinGW
- Install Doxygen [Optional]
- Install GraphViz [Optional]
- Install Visual Studio Code [Optional]
- Install Inno Setup Compiler [Optional]
- Update Environment Variables
- Build
- Generate Installation Package [Optional]
- Generate Doxygen Documentation [Optional]
- GNU/Linux (tested with Ubuntu Linux 22.04 LTS);
- Git (Git 1:2.34.1-1ubuntu1.2);
- CMake (CMake 3.22.1-1ubuntu1);
- Qt (Qt 5.15.3-1);
- GNU C/C++ Compiler (GCC 4:11.2.0-1ubuntu1);
- Doxygen [Optional] (Doxygen 1.9.1-2ubuntu2);
- GraphViz [Optional] (GraphViz 2.42.2-6);
- RPM [Optional] (RPM 4.17.0+dfsg1-4build1);
- Visual Studio Code [Optional] (code_1.67.2-1652812855_amd64.deb, ~78.9MB)
- Run the following commands:
sudo apt update
sudo apt install git cmake doxygen graphviz build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev
sudo apt --no-install-recommends install libqt*5-dev qt*5-dev libqt5waylandcompositor5-dev
The purpose of this tutorial is to configure the popular cross-platform IDE Visual Studio Code, free and provided by Microsoft, to edit and compile the project. However, you can use another IDE instead (like Eclipse, for example), or even not use any IDE.
To install Visual Studio Code:
-
Download the latest version from the Visual Studio Code Site. The version installed at the time of writing this tutorial was code_1.67.2-1652812855_amd64.deb.
-
Run the following command:
sudo dpkg -i code_1.67.2-1652812855_amd64.deb
- After installation, open Visual Studio Code and in the "Extensions tab", install the following extensions:
- CMake
- CMake Tools
- C/C++
- Qt tools
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cd build
cmake ..
make -j$(nproc)
Note: If there is more than one version of the gcc/g++ compiler installed on the system, you can explicitly specify to CMake which compiler to use with the following command:
cmake -DCMAKE_CXX_COMPILER=<full_path_of_compiler>/g++ ..
# e.g.: cmake -DCMAKE_CXX_COMPILER=/opt/gcc/8.1.0/bin/g++ ..
- To run the program:
./ufprog
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTEST_BUILD=ON .
cmake --build build --config Debug
cd build
ctest -C Debug
Note: This step requires lcov
, which can be installed with the following commands:
sudo apt update
sudo apt install lcov
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTEST_BUILD=ON .
cmake --build build --config Debug
cd build
ctest -C Debug
cd ..
lcov --directory ./build/ --capture --output-file ./build/coverage.info --rc lcov_branch_coverage=1 --exclude \/usr\/include\/\* --exclude \/usr\/local\/include\/\* --exclude .\/build\/\* --exclude .\/test\/\*
genhtml ./build/coverage.info --output-directory <output_dir>
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cp -Rf "scripts/deb" "build/"
mkdir -p "build/deb/ufprog/opt/ufprog"
cp -f "build/ufprog" "build/deb/ufprog/opt/ufprog/"
cp -Rf "resources/linux/usr" "build/deb/ufprog/"
chmod 775 build/deb/ufprog/DEBIAN/*
chmod +x build/deb/ufprog/opt/ufprog/ufprog
cd build/deb
dpkg -b ufprog
mv ufprog.deb "../ufprog-`cat "../../VERSION"`-0-x86_64.deb"
- The generated package will be
software/usbflashprog/build/ufprog-<version>-<architecture>.deb
.
Note: This step requires rpm
, which can be installed with the following commands:
sudo apt update
sudo apt install rpm
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cp -Rf "scripts/rpm" "build/"
mkdir -p "build/rpm/ufprog/{BUILD,BUILDROOT,RPMS,SRPMS,SOURCES}"
mkdir -p "build/rpm/ufprog/SOURCES/opt/ufprog"
cp -f "build/ufprog" "build/rpm/ufprog/SOURCES/opt/ufprog/"
cp -Rf "resources/linux/usr" "build/rpm/ufprog/SOURCES/"
chmod 775 build/rpm/ufprog/SOURCES/*
chmod +x build/rpm/ufprog/SOURCES/opt/ufprog/ufprog
cd build/rpm/ufprog
sed -i "/^[[:space:]]*Version:/ s/:.*/: `cat "../../../VERSION"`/" SPECS/ufprog.spec
rpmbuild -bb SPECS/ufprog.spec
mv RPMS/x86_64/ufprog*.rpm ../../
- The generated package will be
software/usbflashprog/build/ufprog-<version>.<architecture>.rpm
.
Note: This step requires doxygen
, which can be installed with the following commands:
sudo apt update
sudo apt install doxygen graphviz
- Clone the project from the repository:
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
doxygen
The documentation is generated under usbflashprog/docs/software/html
directory.
- Microsoft Windows© 10 or above;
- Git (Git-2.31.1-64-bit.exe, ~47.5MB);
- CMake (cmake-3.23.2-windows-x86_64.msi, ~27.9MB);
- Qt and MinGW (qt-opensource-windows-x86-5.12.12.exe, ~3.7GB);
- Doxygen [Optional] (doxygen-1.9.4-setup.exe, ~44.4MB);
- GraphViz [Optional] (stable_windows_10_cmake_Release_x64_graphviz-install-2.47.1-win64.exe, ~4.5MB);
- Visual Studio Code [Optional] (VSCodeSetup-x64-1.55.1.exe, ~68.9MB)
- Inno Setup Compiler [Optional] (innosetup-6.2.1.exe, ~4.7MB)
Git makes downloading the code a lot easier, and the Windows version comes with Git Bash, which is a very useful shell that makes the Microsoft Windows command line a little more effective, like GNU/Linux. It is even possible to change the default terminal from VS Code to Git Bash, making it more powerful and similar to GNU/Linux.
-
Download the latest Git SCM installer for Microsoft Windows from the Git for Windows Downloads Page. In this tutorial the Git-2.31.1-64-bit.exe version was used.
-
Run the installer. Use all default options.
-
When you get to the screen asking you to "choose a default editor", feel free to choose whatever you want. A good option is Notepad++, and if you don't have it installed, you can select Notepad (Windows default), if you don't want to use an editor in console mode.
-
After installation, open the Git Bash and run the commands:
echo "alias make=mingw32-make.exe" >> ~/.profile
source ~/.profile
This will configure the command make
to call, via Git Bash, the utility provided in the Qt/MinGW package.
CMake is a build utility, which helps to automate the process of building programs. Unlike Make, it does not call the compiler/linker tools, but generates (platform dependent) file and directory structures needed to run Make.
-
Download the latest version of CMake from the official website: CMake Downloads Page. The version used in this tutorial was cmake-3.23.2-windows-x86_64.msi.
-
Run the installer and accept the user license.
-
Under "Install Options", select "Add CMake to the system PATH for all users".
-
In "Destination Folder", write a short and easy path, for example
c:\cmake
.
MinGW (short for Minimalist GNU for Windows) is a collection of open source compilers and linkers, which allow you to build native applications (written in languages such as C and C++) for Microsoft Windows.
Qt is a C++ framework based on libraries and tools that enables the development of powerful, interactive, cross-platform applications and devices.
The installation of both tools is performed at once, through the following procedure:
- Download the latest version of Qt5 from the official website: Qt Downloads Page. The version used in this tutorial was qt-opensource-windows-x86-5.12.12.exe.
Note: Qt 6 is currently not supported by this project.
-
Run the installer.
-
Log in into your Qt account or create a new free account.
-
Accept the user license.
-
In "Destination Folder", write a short and easy path, for example
C:\Qt\5.12.12
. -
In "Select Components", check the following:
- "Qt " / "MinGW 64-bit" (to build 64-bit binaries)
- "Qt " / "MinGW 32-bit" (to build 32-bit binaries)
- "Developer and Designer Tools" / "Qt Creator "
- "Developer and Designer Tools" / "MinGW 64-bit" (to build both 64-bit binaries)
- "Developer and Designer Tools" / "MinGW 32-bit" (to build only 32-bit binaries)
-
Accept the user license, and other default options from installer.
-
To use the tools, it will be necessary to follow procedure Update Environment Variables.
Doxygen is a tool designated for creating documentation (HTML, LATEX, Unix Man Pages, RTF or PostScript) from comments annotated in source code. Supports multiple languages including C and C++.
Doxygen is not required to compile the binaries, but it can be useful if you want to generate the project's API documentation.
To install Doxygen:
-
Download the latest version for Windows from the Doxygen Downloads Page. The version used in this tutorial was doxygen-1.9.4-setup.exe.
-
Run the installer. When prompted, change the install location to a simple and easy path, such as
c:\doxygen
. -
Install all components.
GraphViz is a software package capable of generating graphs from a programming API in languages such as C/C++, Python, C#, Ruby. It's used by Doxygen to generate class diagrams, dependency between packages, etc.
GraphViz is not needed to compile binaries, and it only makes sense to install it if Doxygen is also installed.
To install GraphViz:
-
Download the latest version for Windows from the GraphViz Downloads Page. The version used in this tutorial was stable_windows_10_cmake_Release_x64_graphviz-install-2.47.1-win64.exe.
-
When running the installer, under "Install Options", select the "Add Graphviz to the system PATH for all users" option.
-
When prompted, enter the installation location ("Destination Folder") for a short, easy path such as
c:\graphviz
.
The purpose of this tutorial is to configure the popular cross-platform IDE Visual Studio Code, free and provided by Microsoft, to edit and compile the project. However, you can use another IDE instead (like Eclipse, for example), or even not use any IDE.
To install Visual Studio Code:
-
Download the latest version from the Visual Studio Code Site. The version installed at the time of writing this tutorial was VSCodeSetup-x64-1.55.1.exe.
-
Visual Studio Code can be installed with all default options.
-
After installation, open Visual Studio Code and in the "Extensions tab", install the following extensions:
- CMake
- CMake Tools
- C/C++
- Qt tools
The "CMake Tools extension" must be configured to generate files for MinGW.
To do this:
-
Go to the CMake Tools extension settings, "Extension settings".
-
Find "CMake: Generator" field, and enter the value "MinGW Makefiles".
The purpose of this tutorial is to configure the Inno Setup Compiler to generate a project installation package for Microsoft Windows©.
To install Inno Setup:
-
Download the latest version from the Inno Setup Download Site. The version installed at the time of writing this tutorial was innosetup-6.2.1.exe.
-
When prompted, enter the installation location ("Destination Folder") for a short, easy path such as
c:\is
.
Some of the installed tools automatically update the Windows environment variables (specifically, the PATH). However, some do not. Either way, this section helps you identify all the necessary variables.
To check and change environment variables, search the "Windows Search Bar" for the word "env". Choose the option "Edit system environment variables", and click on "Environment variables...".
The following variables and inputs are required:
PATH
C:\Qt\5.12.12\5.12.12\mingw73_64\bin
C:\Qt\5.12.12\Tools\mingw730_64\bin
C:\cmake\bin
C:\Program Files\Git\cmd
C:\doxygen\bin
(if Doxygen was installed)C:\graphviz\bin
(if GraphViz was installed)C:\Program Files\Microsoft VS Code\bin
(if Visual Studio Code was installed)C:\is
(if Inno Setup was installed)
Qt5_DIR
C:\Qt\5.12.12\5.12.12\mingw73_64\lib\cmake\Qt5
- Clone the project from the repository (using the Git Bash Shell):
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
mkdir build
cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release
# or, for a debug version:
# cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)
Note: If there is more than one version of the MinGW compiler installed on the system, you can explicitly specify to CMake which compiler to use with the following command:
cmake -G "MinGW Makefiles" -DCMAKE_CXX_COMPILER=<full_path_of_compiler>/g++.exe ..
# e.g.: cmake -G "MinGW Makefiles" -DCMAKE_CXX_COMPILER=/c/Qt/5.12.12/Tools/mingw730_64/bin/g++.exe ..
Note: If there is more than one version of the Qt installed on the system, you can explicitly specify to CMake which version to use with the following command:
cmake -G "MinGW Makefiles" -DQt5_DIR=<path_of_qt_lib_cmake_qt5> ..
# e.g.: cmake -G "MinGW Makefiles" -DQt5_DIR=/c/Qt/5.12.12/5.12.12/mingw73_64/lib/cmake/Qt5 ..
- To run the program:
./ufprog.exe
- Clone the project from the repository (using the Git Bash Shell):
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog/scripts
directory:
cd usbflashprog/software/usbflashprog/scripts
- Run the following commands:
iscc.exe ufprog.iss
Note: To create a package for 32-bit OS, run the following command instead:
iscc.exe //Darch=win32 ufprog.iss
The install package is generated under software/usbflashprog/build
subdirectory.
Note: The Qt executables and the compiler libraries are found with use of the Qt5_DIR variable. To change this, run the following command instead:
iscc.exe //DQT_PATH=<path_of_qt> //DMINGW_PATH=<path_of_mingw> ufprog.iss
# e.g.: iscc.exe //DQT_PATH="d:\\Qt\\5.12.12\\5.12.12\\mingw73_32" //DMINGW_PATH="d:\\mingw73_32" ufprog.iss
- Clone the project from the repository (using the Git Bash Shell):
git clone https://github.com/robsonsmartins/usbflashprog.git
- Change to
software/usbflashprog
directory:
cd usbflashprog/software/usbflashprog
- Run the following commands:
doxygen
The documentation is generated under usbflashprog/docs/software/html
directory.