-
Qt 5.9.3
Download from qt.io.
For Linux, use package "Qt 5.9.3 for Linux 64-bit".
For Windows, use package "Qt 5.9.3 for Windows 32-bit"
-
J-Link SDK 6.32f
Download from SEGGER, not publicly available.
Other versions can probably be used, but the qmake file for the J-Link plugin must be changed accordingly.
The build uses 3 mandatory directories and 1 optional directory:
- source code directory (git checkout)
- build directory
- release directory
- J-Link SDK Linux directory (optional)
We will refer to these directories in the rest of this documentation as {SRCDIR}, {BUILDDIR}, {RELEASEDIR} and {JLINKSDKDIR}. {RELEASEDIR} and {JLINKSDKDIR} must be absolute paths.
The Qt installation directory will be referred to as {QTDIR}.
SAM-BA can be built either using command-line commands or using Qt Creator.
-
Clone/checkout the source in {SRCDIR}
git clone https://github.com/atmelcorp/sam-ba {SRCDIR}
-
Create directory {BUILDDIR}
mkdir -p {BULDDIR}
-
Set an empty EXTRA_QMAKE_OPTIONS variable
EXTRA_QMAKE_OPTIONS=""
-
(optional) Append the JLINKSDKPATH option into the EXTRA_QMAKE_OPTIONS variable
EXTRA_QMAKE_OPTIONS="$EXTRA_QMAKE_OPTIONS JLINKSDKPATH={JLINKSDKDIR}"
-
Go in directory {BUILDDIR} and run
{QTDIR}/5.9.3/gcc_64/bin/qmake $EXTRA_QMAKE_OPTIONS -r {SRCDIR}/sam-ba.pro
. This will generate the makefiles in {BUILDDIR} from the qmake templates in the source tree. -
Go in directory {BUILDDIR} and run
make INSTALL_ROOT={RELEASEDIR} install
-
The release material should now be present in {RELEASEDIR} directory.
-
Clone/Checkout the source in {SRCDIR}
-
Create directory {BUILDDIR}
mkdir {BUILDDIR}
-
Set EXTRA_QMAKE_OPTIONS variable to a ' ' (single space)
set "EXTRA_QMAKE_OPTIONS= "
-
(optional) Append the JLINKSDKPATH option into the EXTRA_QMAKE_OPTIONS variable
set "EXTRA_QMAKE_OPTIONS=%EXTRA_QMAKE_OPTIONS% JLINKSDKPATH='{JLINKSDKDIR}'"
-
Go in directory {BUILDDIR} and run:
{QTDIR}\5.9.3\mingw53_32\bin\qmake %EXTRA_QMAKE_OPTIONS% -r {SRCDIR}\sam-ba.pro
. This will generate the makefiles in {BUILDDIR} from the qmake templates in the source tree. -
Add MingW32 directory to path:
set path=%path%;{QTDIR}\Tools\mingw530_32\bin
-
Go in directory {BUILDDIR} and run:
mingw32-make INSTALL_ROOT={RELEASEDIR} install
-
The release material should now be present in {RELEASEDIR} directory.
-
Start Qt Creator
-
Load
sam-ba.pro
from {SRCDIR} -
Select kit "Desktop Qt 5.9.3 GCC 64bit" and click "Configure Project"
-
(optional) In the bottom of the left toolbar, click on the "sam-ba Release" or " sam-ba Debug" icon to select the desired build configuration.
-
Click on the "Projects" icon in the left toolbar
-
Select "Build" from the "Build | Run" selector below the kit name
-
Set the "Build directory:" field to {BUILDDIR}
-
(optional) In the "Build Steps" section, click on the "Details" button of the "qmake" step to expand its detailed options. Then set the "Additional arguments:" field to
JLINKSDKPATH={JLINKSDKDIR}
-
Select "Run" from the "Build | Run" selector below the kit name
-
In "Deployment", click "Add Deploy Step" and select "Make"
-
In "Make arguments:" fields, type:
INSTALL_ROOT={RELEASEDIR} install
-
In the "Build" menu, click "Build All"
-
Click "4 Compile Output" at the bottom of the screen to see the build progress
-
Once the build is complete, in the "Build" menu, click "Deploy All"
-
The release material should now be present in {RELEASEDIR} directory.
-
Start Qt Creator
-
Load
sam-ba.pro
from {SRCDIR} -
Select kit "Desktop Qt 5.9.3 MingW 32 bit" and click "Configure Project"
-
(optional) In the bottom of the left toolbar, click on the "sam-ba Release" or " sam-ba Debug" icon to select the desired build configuration.
-
Click on the "Projects" icon in the left toolbar
-
Select "Build" from the "Build | Run" selector below the kit name
-
Set the "Build directory:" field to {BUILDDIR}
-
(optional) In the "Build Steps" section, click on the "Details" button of the "qmake" step to expand its detailed options. Then set the "Additional arguments:" field to
"JLINKSDKPATH='{JLINKSDKDIR}'"
-
Select "Run" from the "Build | Run" selector below the kit name
-
In "Deployment", click "Add Deploy Step" and select "Make"
-
In "Make arguments:" fields, type:
INSTALL_ROOT={RELEASEDIR} install
-
In the "Build" menu, click "Build All"
-
Click "4 Compile Output" at the bottom of the screen to see the build progress
-
Once the build is complete, in the "Build" menu, click "Deploy All"
-
The release material should now be present in {RELEASEDIR} directory.