Fast Embedded Software Development with 4 small batch files for file transfer, remote compile, receive of compiler messages by network. no installation efforts, using a portable open source command line tool for Windows and Linux.
Embedded Software Development usually means:
- source editing is done under Windows,
as many specialized tools for
development exist only there.
- compile for many different platforms, or toolchains (arm8, arm9, i686 ...).
- compile for many different target devices.
- compile on a Linux build server, as all toolchains and libraries
are configured only there, with complex build scripts
developed over years.
Overview: Embedded Development
Sync sources, Compile, Send binaries - Step by Step
No matter what version control system you use, there must be a repository folder
on your local disk containing many checked-out projects, like:
Furthermore, there must be an identical repository folder on the build server,
in your user's home folder. so normally you upload changed source files,
then compile manually on the build server.
Example project: compile and run "m5player" instantly
You changed the source code, and now you want to:
- compile project m5player
- compile it for arm8 architecture
- then run it on a target with IP .188
In the Windows command line, go into C:\repos, then type:
xmake.bat m5 arm8 188
The xmake batch will:
- expand short parameters like "m5" to "m5player"
- upload changed source files from m5player to the build server.
- xmakeserv.sh running on the build server, in your repos folder.
- sfk for Windows binary on your Windows PC.
- sfk for Linux (i686) binary on the Linux build server.
- upload a small batch file xmakerem.sh
to the build server,
which contains commands
to call the build system.
xmakerem.sh is located primarily on your Windows PC
so you can edit it easily anytime.
- run xmakerem.sh on the build server.
Any text outputs from the compile, especially error messages, are sent back to your PC.
You can display them:
If xmakerem.sh sucessfully creates a binary,
- this is then sent to target 192.168.1.188 as a file like binary.new,
The firmware on .188 may send trace outputs via network to some trace tool
written by your company.
Ideally this trace tool contains an option to forward text
as plain UDP to any other port,
so you can read the firmware traces also
directly in Depeche View by
- xmaketarg.sh running on your target
- sfk for Linux/ARM binary on the target
- capability of your firmware running on .188
to rename binary.new
to it's own binary name and then to restart itself.
Appendix: SFK/XMake batch files
xmake.bat: called manually on the command line, or by a script from DView Pro
IF NOT "%TOOLCHAIN%"=="" GOTO haveparms
echo "usage : xmake product architecture targetip [clean]"
echo "example: xmake m3 bbb 192.168.1.100"
echo " xmake m5 a13 192.168.1.200 clean"
set FTPOPT=-nohead -quiet -noprog
set TONETLOG=sfk filt "-! files of*sent" -lshigh cyan "<*" +tonetlog
IF "%PRODUCT%"=="m3" (set PRODUCT=m3player)
IF "%PRODUCT%"=="m5" (set PRODUCT=m5player)
sfk -quiet strlen "%TARGET%"
IF %ERRORLEVEL% LEQ 3 (set TARGET=%TARGET_NET%.%TARGET%)
sfk echo "[green]=== xmake: %PRODUCT% %TOOLCHAIN% for %TARGET% [def]" +tolog
IF "%CLEAN%"=="clean" ( SET CLEAN="1" ) ELSE ( SET CLEAN="0" )
sfk -quiet=2 remcr xmakerem.sh
sfk select xmakerem.sh +sft %FTPOPT% %BUILD_SERVER% cput -yes | %TONETLOG%
sfk select -dir %PRODUCT% -file !.bak !.tmp +sft %FTPOPT%
%BUILD_SERVER% cput -yes | %TONETLOG%
sfk sft %FTPOPT% %BUILD_SERVER% run "bash xmakerem.sh %PRODUCT% %TOOLCHAIN%
%TARGET% %CLEAN% %LOG_TARGET% >xmakerem.log 2>&1" -yes | %TONETLOG%
sfk sft %FTPOPT% %BUILD_SERVER% get xmakerem.log
sfk echo "[green]=== xmake done. ===[def]" +tolog
All batch files for direct reading:
All batch files in one .zip package:
sfk command line tool sources and binaries for all platforms:
DView Pro example script to call xmake.bat by a click or hotkey:
first.echo "compile remote"
first.runback "xmake.bat" $1 $2 $3 $shift