1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
4 ;;; Copyright © 2016 David Craven <david@craven.ch>
5 ;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
8 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
10 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
11 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages embedded)
29 #:use-module (guix utils)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix svn-download)
33 #:use-module (guix git-download)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system python)
38 #:use-module (guix build-system trivial)
39 #:use-module ((guix build utils) #:select (alist-replace delete-file-recursively))
40 #:use-module (gnu packages)
41 #:use-module (gnu packages admin)
42 #:use-module (gnu packages autotools)
43 #:use-module ((gnu packages base) #:prefix base:)
44 #:use-module (gnu packages bison)
45 #:use-module (gnu packages boost)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages cross-base)
48 #:use-module (gnu packages dejagnu)
49 #:use-module (gnu packages flex)
50 #:use-module (gnu packages gcc)
51 #:use-module (gnu packages gdb)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages libftdi)
54 #:use-module (gnu packages libusb)
55 #:use-module (gnu packages messaging)
56 #:use-module (gnu packages perl)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-crypto)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages swig)
62 #:use-module (gnu packages texinfo)
63 #:use-module (gnu packages xorg)
64 #:use-module (srfi srfi-1))
66 ;; We must not use the released GCC sources here, because the cross-compiler
67 ;; does not produce working binaries. Instead we take the very same SVN
68 ;; revision from the branch that is used for a release of the "GCC ARM
69 ;; embedded" project on launchpad.
70 ;; See https://launchpadlibrarian.net/218827644/release.txt
71 (define-public gcc-arm-none-eabi-4.9
72 (let ((xgcc (cross-gcc "arm-none-eabi"
74 #:xbinutils (cross-binutils "arm-none-eabi")))
76 (svn-revision 227977))
77 (package (inherit xgcc)
78 (version (string-append (package-version xgcc) "-"
79 revision "." (number->string svn-revision)))
84 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch/")
85 (revision svn-revision)))
86 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
89 "113r98kygy8rrjfv2pd3z6zlfzbj543pq7xyq8bgh72c608mmsbr"))
91 ;; Remove the one patch that doesn't apply to this 4.9 snapshot (the
92 ;; patch is for 4.9.4 and later but this svn snapshot is older).
93 (patches (remove (lambda (patch)
94 (string=? (basename patch)
95 "gcc-arm-bug-71399.patch"))
96 (origin-patches (package-source xgcc))))))
100 ,@(package-native-inputs xgcc)))
102 (substitute-keyword-arguments (package-arguments xgcc)
104 `(modify-phases ,phases
105 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
106 (lambda* (#:key inputs #:allow-other-keys)
107 (let ((gcc (assoc-ref inputs "gcc")))
108 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
109 ;; prevent header conflict with the GCC from native-inputs.
110 (setenv "CPLUS_INCLUDE_PATH"
112 (delete (string-append gcc "/include/c++")
113 (string-split (getenv "CPLUS_INCLUDE_PATH")
117 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
118 (getenv "CPLUS_INCLUDE_PATH"))
120 (add-after 'unpack 'fix-genmultilib
122 (substitute* "gcc/genmultilib"
123 (("#!/bin/sh") (string-append "#!" (which "sh"))))
125 ((#:configure-flags flags)
126 ;; The configure flags are largely identical to the flags used by the
127 ;; "GCC ARM embedded" project.
128 `(append (list "--enable-multilib"
130 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
131 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
133 "--disable-decimal-float"
136 "--disable-libmudflap"
137 "--disable-libquadmath"
139 "--disable-libstdcxx-pch"
144 (delete "--disable-multilib" ,flags)))))
146 (list (search-path-specification
147 (variable "CROSS_C_INCLUDE_PATH")
148 (files '("arm-none-eabi/include")))
149 (search-path-specification
150 (variable "CROSS_CPLUS_INCLUDE_PATH")
151 (files '("arm-none-eabi/include"
152 "arm-none-eabi/include/c++"
153 "arm-none-eabi/include/c++/arm-none-eabi")))
154 (search-path-specification
155 (variable "CROSS_LIBRARY_PATH")
156 (files '("arm-none-eabi/lib"))))))))
158 (define-public gcc-arm-none-eabi-6
160 (inherit gcc-arm-none-eabi-4.9)
161 (version (package-version gcc-6))
162 (source (origin (inherit (package-source gcc-6))
165 (origin-patches (package-source gcc-6))
166 (search-patches "gcc-6-cross-environment-variables.patch"
167 "gcc-6-arm-none-eabi-multilib.patch")))))))
169 (define-public newlib-arm-none-eabi
175 (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
179 "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
180 (build-system gnu-build-system)
182 `(#:out-of-source? #t
183 ;; The configure flags are identical to the flags used by the "GCC ARM
184 ;; embedded" project.
185 #:configure-flags '("--target=arm-none-eabi"
186 "--enable-newlib-io-long-long"
187 "--enable-newlib-register-fini"
188 "--disable-newlib-supplied-syscalls"
191 (modify-phases %standard-phases
192 (add-after 'unpack 'fix-references-to-/bin/sh
194 (substitute* '("libgloss/arm/cpu-init/Makefile.in"
195 "libgloss/arm/Makefile.in"
196 "libgloss/libnosys/Makefile.in"
197 "libgloss/Makefile.in")
198 (("/bin/sh") (which "sh")))
201 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
202 ("xgcc" ,gcc-arm-none-eabi-4.9)
203 ("texinfo" ,texinfo)))
204 (home-page "https://www.sourceware.org/newlib/")
205 (synopsis "C library for use on embedded systems")
206 (description "Newlib is a C library intended for use on embedded
207 systems. It is a conglomeration of several library parts that are easily
208 usable on embedded products.")
209 (license (license:non-copyleft
210 "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
212 (define-public newlib-nano-arm-none-eabi
213 (package (inherit newlib-arm-none-eabi)
216 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
217 ;; The configure flags are identical to the flags used by the "GCC ARM
218 ;; embedded" project. They optimize newlib for use on small embedded
219 ;; systems with limited memory.
220 ((#:configure-flags flags)
221 ''("--target=arm-none-eabi"
223 "--disable-newlib-supplied-syscalls"
224 "--enable-newlib-reent-small"
225 "--disable-newlib-fvwrite-in-streamio"
226 "--disable-newlib-fseek-optimization"
227 "--disable-newlib-wide-orient"
228 "--enable-newlib-nano-malloc"
229 "--disable-newlib-unbuf-stream-opt"
231 "--enable-newlib-global-atexit"
232 "--enable-newlib-nano-formatted-io"
235 `(modify-phases ,phases
236 ;; XXX: Most arm toolchains offer both *.a and *_nano.a as newlib
237 ;; and newlib-nano respectively. The headers are usually
238 ;; arm-none-eabi/include/newlib.h for newlib and
239 ;; arm-none-eabi/include/newlib-nano/newlib.h for newlib-nano. We
240 ;; have two different toolchain packages for each which works but
241 ;; is a little strange.
242 (add-after 'install 'hardlink-newlib
243 (lambda* (#:key outputs #:allow-other-keys)
244 (let ((out (assoc-ref outputs "out")))
245 ;; The nano.specs file says that newlib-nano files should end
246 ;; in "_nano.a" instead of just ".a". Note that this applies
247 ;; to all the multilib folders too.
252 ;; Strip ".a" off the end
253 (substring file 0 (- (string-length file) 2))
254 ;; Add "_nano.a" onto the end
258 "^(libc.a|libg.a|librdimon.a|libstdc\\+\\+.a|libsupc\\+\\+.a)$"))
260 ;; newlib.h is usually in this location instead so both
261 ;; newlib and newlib-nano can be in the toolchain at the same
263 (mkdir (string-append out "/arm-none-eabi/include/newlib-nano"))
266 (string-append out "/arm-none-eabi/include/newlib-nano/newlib.h"))
268 (synopsis "Newlib variant for small systems with limited memory")))
271 ;;; The following definitions are for the "7-2018-q2-update" variant of the
272 ;;; ARM cross toolchain as offered on https://developer.arm.com
273 (define-public gcc-arm-none-eabi-7-2018-q2-update
274 (let ((xgcc (cross-gcc "arm-none-eabi"
276 #:xbinutils (cross-binutils "arm-none-eabi")))
278 (svn-revision 261907))
279 (package (inherit xgcc)
280 (version (string-append "7-2018-q2-update-"
281 revision "." (number->string svn-revision)))
286 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
287 (revision svn-revision)))
288 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
291 "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
294 (origin-patches (package-source gcc-7))
295 (search-patches "gcc-7-cross-environment-variables.patch")))))
299 ,@(alist-delete "isl" (package-native-inputs xgcc))))
301 (substitute-keyword-arguments (package-arguments xgcc)
303 `(modify-phases ,phases
304 (add-after 'unpack 'expand-version-string
306 (make-file-writable "gcc/DEV-PHASE")
307 (with-output-to-file "gcc/DEV-PHASE"
309 (display "7-2018-q2-update")))
311 (add-after 'unpack 'fix-genmultilib
313 (substitute* "gcc/genmultilib"
314 (("#!/bin/sh") (string-append "#!" (which "sh"))))
316 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
317 (lambda* (#:key inputs #:allow-other-keys)
318 (let ((gcc (assoc-ref inputs "gcc")))
319 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
320 ;; prevent header conflict with the GCC from native-inputs.
321 (setenv "CPLUS_INCLUDE_PATH"
323 (delete (string-append gcc "/include/c++")
324 (string-split (getenv "CPLUS_INCLUDE_PATH")
328 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
329 (getenv "CPLUS_INCLUDE_PATH"))
331 ((#:configure-flags flags)
332 ;; The configure flags are largely identical to the flags used by the
333 ;; "GCC ARM embedded" project.
334 `(append (list "--enable-multilib"
336 "--with-multilib-list=rmprofile"
337 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
339 "--disable-decimal-float"
342 "--disable-libmudflap"
343 "--disable-libquadmath"
345 "--disable-libstdcxx-pch"
350 (delete "--disable-multilib" ,flags)))))
352 (list (search-path-specification
353 (variable "CROSS_C_INCLUDE_PATH")
354 (files '("arm-none-eabi/include")))
355 (search-path-specification
356 (variable "CROSS_CPLUS_INCLUDE_PATH")
357 (files '("arm-none-eabi/include"
358 "arm-none-eabi/include/c++"
359 "arm-none-eabi/include/c++/arm-none-eabi")))
360 (search-path-specification
361 (variable "CROSS_LIBRARY_PATH")
362 (files '("arm-none-eabi/lib"))))))))
364 (define-public newlib-arm-none-eabi-7-2018-q2-update
365 ;; This is the same commit as used for the 7-2018-q2-update release
366 ;; according to the release.txt.
367 (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4")
370 (inherit newlib-arm-none-eabi)
371 (version (git-version "3.0.0" revision commit))
376 (url "http://sourceware.org/git/newlib-cygwin.git")
378 (file-name (git-file-name "newlib" commit))
381 "1dq23fqrk75g1a4v7569fvnnw5q440zawbxi3w0g05n8jlqsmvcy"))))
383 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
384 ;; The configure flags are identical to the flags used by the "GCC ARM
385 ;; embedded" project.
386 ((#:configure-flags flags)
387 `(cons* "--enable-newlib-io-c99-formats"
388 "--enable-newlib-retargetable-locking"
392 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
393 ("xgcc" ,gcc-arm-none-eabi-7-2018-q2-update)
394 ("texinfo" ,texinfo))))))
396 (define-public newlib-nano-arm-none-eabi-7-2018-q2-update
397 (package (inherit newlib-arm-none-eabi-7-2018-q2-update)
400 (package-arguments newlib-nano-arm-none-eabi))
401 (synopsis "Newlib variant for small systems with limited memory")))
404 (define (make-libstdc++-arm-none-eabi xgcc newlib)
405 (let ((libstdc++ (make-libstdc++ xgcc)))
406 (package (inherit libstdc++)
407 (name "libstdc++-arm-none-eabi")
409 (substitute-keyword-arguments (package-arguments libstdc++)
410 ((#:configure-flags flags)
411 ``("--target=arm-none-eabi"
412 "--host=arm-none-eabi"
413 "--disable-libstdcxx-pch"
415 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
420 ,(string-append "--with-gxx-include-dir="
421 (assoc-ref %outputs "out")
422 "/arm-none-eabi/include/c++")))))
426 ,@(package-native-inputs libstdc++))))))
428 (define (arm-none-eabi-toolchain xgcc newlib)
429 "Produce a cross-compiler toolchain package with the compiler XGCC and the C
430 library variant NEWLIB."
431 (let ((newlib-with-xgcc (package (inherit newlib)
433 (alist-replace "xgcc" (list xgcc)
434 (package-native-inputs newlib))))))
436 (name (string-append "arm-none-eabi"
437 (if (string=? (package-name newlib-with-xgcc)
441 (version (package-version xgcc))
443 (build-system trivial-build-system)
445 '(#:modules ((guix build union))
448 (use-modules (ice-9 match)
451 (((names . directories) ...)
452 (union-build (assoc-ref %outputs "out")
456 `(("binutils" ,(cross-binutils "arm-none-eabi"))
457 ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc))
459 ("newlib" ,newlib-with-xgcc)))
460 (synopsis "Complete GCC tool chain for ARM bare metal development")
461 (description "This package provides a complete GCC tool chain for ARM
462 bare metal development. This includes the GCC arm-none-eabi cross compiler
463 and newlib (or newlib-nano) as the C library. The supported programming
464 languages are C and C++.")
465 (home-page (package-home-page xgcc))
466 (license (package-license xgcc)))))
468 (define-public arm-none-eabi-toolchain-4.9
469 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
470 newlib-arm-none-eabi))
472 (define-public arm-none-eabi-nano-toolchain-4.9
473 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
474 newlib-nano-arm-none-eabi))
476 (define-public arm-none-eabi-toolchain-6
477 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
478 newlib-arm-none-eabi))
480 (define-public arm-none-eabi-nano-toolchain-6
481 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
482 newlib-nano-arm-none-eabi))
484 (define-public arm-none-eabi-toolchain-7-2018-q2-update
485 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
486 newlib-arm-none-eabi-7-2018-q2-update))
488 (define-public arm-none-eabi-nano-toolchain-7-2018-q2-update
489 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
490 newlib-nano-arm-none-eabi-7-2018-q2-update))
492 (define-public gdb-arm-none-eabi
495 (name "gdb-arm-none-eabi")
497 `(#:configure-flags '("--target=arm-none-eabi"
500 "--enable-languages=c,c++"
502 ,@(package-arguments gdb)))))
504 (define-public libjaylink
511 (url "https://repo.or.cz/libjaylink.git")
513 (file-name (git-file-name name version))
516 "0ndyfh51hiqyv2yscpj6qd091w7myxxjid3a6rx8f6k233vy826q"))))
517 (build-system gnu-build-system)
519 `(("autoconf" ,autoconf)
520 ("automake" ,automake)
522 ("pkg-config" ,pkg-config)))
524 `(("libusb" ,libusb)))
525 (home-page "https://repo.or.cz/w/libjaylink.git")
526 (synopsis "Library to interface Segger J-Link devices")
527 (description "libjaylink is a shared library written in C to access
528 SEGGER J-Link and compatible devices.")
529 (license license:gpl2+)))
531 (define-public jimtcl
538 (url "https://github.com/msteveb/jimtcl")
540 (file-name (git-file-name name version))
543 "06rn60cx9sapc175vxvan87b8j5rkhh5gvvz7343xznzwlr0wcgk"))))
544 (build-system gnu-build-system)
547 (modify-phases %standard-phases
549 ;; This package doesn't use autoconf.
550 (lambda* (#:key outputs #:allow-other-keys)
551 (let ((out (assoc-ref outputs "out")))
552 (invoke "./configure"
553 (string-append "--prefix=" out)))))
554 (add-before 'check 'delete-failing-tests
556 ;; XXX All but 1 TTY tests fail (Inappropriate ioctl for device).
557 (delete-file "tests/tty.test")
562 `(("inetutils" ,inetutils))) ; for hostname
563 (home-page "http://jim.tcl.tk/index.html")
564 (synopsis "Small footprint Tcl implementation")
565 (description "Jim is a small footprint implementation of the Tcl programming
567 (license license:bsd-2)))
569 (define-public openocd
570 (let ((commit "9a877a83a1c8b1f105cdc0de46c5cbc4d9e8799e")
574 (version (string-append "0.10.0-" revision "."
575 (string-take commit 7)))
579 (url "https://git.code.sf.net/p/openocd/code")
581 (file-name (string-append name "-" version "-checkout"))
584 "1q536cp80v2bcy6xwk08f1r2ljyw13jchx3a1z7d3ni3vqql7rc6"))))
585 (build-system gnu-build-system)
587 `(("autoconf" ,autoconf)
588 ("automake" ,automake)
590 ("which" ,base:which)
591 ("pkg-config" ,pkg-config)))
596 ("libjaylink" ,libjaylink)
597 ("libusb-compat" ,libusb-compat)))
600 (append (list "LIBS=-lutil"
603 "--disable-internal-jimtcl"
604 "--disable-internal-libjaylink")
605 (map (lambda (programmer)
606 (string-append "--enable-" programmer))
607 '("amtjtagaccel" "armjtagew" "buspirate" "ftdi"
608 "gw16012" "jlink" "opendous" "osbdm"
609 "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi"
610 "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink"
611 "usbprog" "vsllink" "usb-blaster-2" "usb_blaster"
612 "presto" "openjtag")))
614 (modify-phases %standard-phases
617 (patch-shebang "bootstrap")
618 (invoke "./bootstrap" "nosubmodule")))
619 (add-after 'autoreconf 'change-udev-group
621 (substitute* "contrib/60-openocd.rules"
622 (("plugdev") "dialout"))
624 (add-after 'install 'install-udev-rules
625 (lambda* (#:key outputs #:allow-other-keys)
626 (install-file "contrib/60-openocd.rules"
628 (assoc-ref outputs "out")
629 "/lib/udev/rules.d/"))
631 (home-page "http://openocd.org")
632 (synopsis "On-Chip Debugger")
633 (description "OpenOCD provides on-chip programming and debugging support
634 with a layered architecture of JTAG interface and TAP support.")
635 (license license:gpl2+))))
637 ;; The commits for all propeller tools are the stable versions published at
638 ;; https://github.com/propellerinc/propgcc in the release_1_0. According to
639 ;; personal correspondence with the developers in July 2017, more recent
640 ;; versions are currently incompatible with the "Simple Libraries".
642 (define propeller-binutils
643 (let ((xbinutils (cross-binutils "propeller-elf"))
644 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
648 (name "propeller-binutils")
649 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
650 (source (origin (inherit (package-source xbinutils))
653 (url "https://github.com/parallaxinc/propgcc")
655 (file-name (string-append name "-" commit "-checkout"))
658 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
659 (patch-flags (list "-p1" "--directory=binutils"))))
661 `(;; FIXME: For some reason there are many test failures. It's not
662 ;; obvious how to fix the failures.
665 (modify-phases %standard-phases
666 (add-after 'unpack 'chdir
667 (lambda _ (chdir "binutils") #t)))
668 ,@(substitute-keyword-arguments (package-arguments xbinutils)
669 ((#:configure-flags flags)
670 `(cons "--disable-werror" ,flags)))))
676 ,@(package-native-inputs xbinutils))))))
678 (define-public propeller-gcc-6
679 (let ((xgcc (cross-gcc "propeller-elf"
680 #:xbinutils propeller-binutils))
681 (commit "b4f45a4725e0b6d0af59e594c4e3e35ca4105867")
683 (package (inherit xgcc)
684 (name "propeller-gcc")
685 (version (string-append "6.0.0-" revision "." (string-take commit 9)))
689 (url "https://github.com/totalspectrum/gcc-propeller")
691 (file-name (string-append name "-" commit "-checkout"))
694 "0d9kdxm2fzanjqa7q5850kzbsfl0fqyaahxn74h6nkxxacwa11zb"))
697 (origin-patches (package-source gcc-6))
698 (search-patches "gcc-cross-environment-variables.patch")))))
701 ,@(package-native-inputs xgcc)))
702 ;; All headers and cross libraries of the propeller toolchain are
703 ;; installed under the "propeller-elf" prefix.
705 (list (search-path-specification
706 (variable "CROSS_C_INCLUDE_PATH")
707 (files '("propeller-elf/include")))
708 (search-path-specification
709 (variable "CROSS_LIBRARY_PATH")
710 (files '("propeller-elf/lib")))))
711 (home-page "https://github.com/totalspectrum/gcc-propeller")
712 (synopsis "GCC for the Parallax Propeller"))))
714 (define-public propeller-gcc-4
715 (let ((xgcc propeller-gcc-6)
716 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
718 (package (inherit xgcc)
719 (name "propeller-gcc")
720 (version (string-append "4.6.1-" revision "." (string-take commit 9)))
724 (url "https://github.com/parallaxinc/propgcc")
726 (file-name (string-append name "-" commit "-checkout"))
729 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
730 (patch-flags (list "-p1" "--directory=gcc"))
733 (origin-patches (package-source gcc-4.7))
734 (search-patches "gcc-4.6-gnu-inline.patch"
735 "gcc-cross-environment-variables.patch")))))
737 (substitute-keyword-arguments (package-arguments propeller-gcc-6)
739 `(modify-phases ,phases
740 (add-after 'unpack 'chdir
741 (lambda _ (chdir "gcc") #t))))))
744 ,@(package-native-inputs propeller-gcc-6)))
745 (home-page "https://github.com/parallaxinc/propgcc")
746 (supported-systems (delete "aarch64-linux" %supported-systems)))))
748 ;; Version 6 is experimental and may not work correctly. This is why we
749 ;; default to version 4, which is also used in the binary toolchain bundle
750 ;; provided by Parallax Inc.
751 (define-public propeller-gcc propeller-gcc-4)
754 ;; FIXME: We do not build the tiny library because that would require C++
755 ;; headers, which are not available. This may require adding a propeller-elf
756 ;; variant of the libstdc++ package.
757 (define-public proplib
758 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
762 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
766 (url "https://github.com/parallaxinc/propgcc")
768 (file-name (string-append name "-" commit "-checkout"))
771 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
772 (build-system gnu-build-system)
774 `(#:tests? #f ; no tests
776 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
777 (string-append "BUILD=" (getcwd) "/build"))
779 (modify-phases %standard-phases
781 (add-after 'unpack 'chdir
782 (lambda _ (chdir "lib") #t))
783 (add-after 'chdir 'fix-Makefile
785 (substitute* "Makefile"
786 ;; Control the installation time of the headers.
787 ((" install-includes") ""))
789 ;; The Makefile does not separate building from installation, so we
790 ;; have to create the target directories at build time.
791 (add-before 'build 'create-target-directories
792 (lambda* (#:key make-flags #:allow-other-keys)
793 (apply invoke "make" "install-dirs" make-flags)))
794 (add-before 'build 'set-cross-environment-variables
795 (lambda* (#:key outputs #:allow-other-keys)
796 (setenv "CROSS_LIBRARY_PATH"
797 (string-append (assoc-ref outputs "out")
798 "/propeller-elf/lib:"
799 (or (getenv "CROSS_LIBRARY_PATH") "")))
800 (setenv "CROSS_C_INCLUDE_PATH"
801 (string-append (assoc-ref outputs "out")
802 "/propeller-elf/include:"
803 (or (getenv "CROSS_C_INCLUDE_PATH") "")))
805 (add-before 'install 'install-includes
806 (lambda* (#:key make-flags #:allow-other-keys)
807 (apply invoke "make" "install-includes" make-flags))))))
809 `(("propeller-gcc" ,propeller-gcc)
810 ("propeller-binutils" ,propeller-binutils)
812 (home-page "https://github.com/parallaxinc/propgcc")
813 (synopsis "C library for the Parallax Propeller")
814 (description "This is a C library for the Parallax Propeller
816 ;; Most of the code is released under the Expat license. Some of the
817 ;; included code is public domain and some changes are BSD licensed.
818 (license license:expat))))
820 (define-public propeller-toolchain
822 (name "propeller-toolchain")
823 (version (package-version propeller-gcc))
825 (build-system trivial-build-system)
826 (arguments '(#:builder (begin (mkdir %output) #t)))
828 `(("binutils" ,propeller-binutils)
830 ("gcc" ,propeller-gcc)))
831 (synopsis "Complete GCC tool chain for Propeller micro-controllers")
832 (description "This package provides a complete GCC tool chain for
833 Propeller micro-controller development.")
834 (home-page (package-home-page propeller-gcc))
835 (license (package-license propeller-gcc))))
837 (define-public openspin
844 (url "https://github.com/parallaxinc/OpenSpin")
846 (file-name (git-file-name name version))
849 "0ghk8hj4717ydhqzx2pfs6737s1cxng6sgg2xgbkwvcfclxdbrd0"))))
850 (build-system gnu-build-system)
852 `(#:tests? #f ; no tests
854 (modify-phases %standard-phases
856 (add-after 'unpack 'remove-timestamp
858 (substitute* "SpinSource/openspin.cpp"
859 ((" Compiled on.*$") "\\n\");"))
861 ;; Makefile does not include "install" target
863 (lambda* (#:key outputs #:allow-other-keys)
864 (let ((bin (string-append (assoc-ref outputs "out")
867 (install-file "build/openspin" bin)
869 (home-page "https://github.com/parallaxinc/OpenSpin")
870 (synopsis "Spin/PASM compiler for the Parallax Propeller")
871 (description "OpenSpin is a compiler for the Spin/PASM language of the
872 Parallax Propeller. It was ported from Chip Gracey's original x86 assembler
874 (license license:expat)))
876 (define-public propeller-load
877 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
880 (name "propeller-load")
885 (url "https://github.com/parallaxinc/propgcc")
887 (file-name (string-append name "-" commit "-checkout"))
890 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
891 (build-system gnu-build-system)
893 `(#:tests? #f ; no tests
896 (string-append "TARGET=" (assoc-ref %outputs "out")))
898 (modify-phases %standard-phases
899 (add-after 'unpack 'chdir
900 (lambda _ (chdir "loader") #t))
901 (delete 'configure))))
903 `(("openspin" ,openspin)
904 ("propeller-toolchain" ,propeller-toolchain)))
905 (home-page "https://github.com/parallaxinc/propgcc")
906 (synopsis "Loader for Parallax Propeller micro-controllers")
907 (description "This package provides the tool @code{propeller-load} to
908 upload binaries to a Parallax Propeller micro-controller.")
909 (license license:expat))))
911 (define-public spin2cpp
918 (url "https://github.com/totalspectrum/spin2cpp")
919 (commit (string-append "v" version))))
920 (file-name (git-file-name name version))
923 "0wznqvsckzzz4hdy2rpvj6jqpxw4yn7i0c7zxfm6i46k8gg9327b"))))
924 (build-system gnu-build-system)
926 `(#:tests? #f ;; The tests assume that a micro-controller is connected.
928 (modify-phases %standard-phases
930 (add-before 'build 'set-cross-environment-variables
931 (lambda* (#:key inputs #:allow-other-keys)
932 (setenv "CROSS_LIBRARY_PATH"
933 (string-append (assoc-ref inputs "propeller-toolchain")
934 "/propeller-elf/lib"))
935 (setenv "CROSS_C_INCLUDE_PATH"
936 (string-append (assoc-ref inputs "propeller-toolchain")
937 "/propeller-elf/include"))
940 (lambda* (#:key outputs #:allow-other-keys)
941 (let ((bin (string-append (assoc-ref outputs "out")
943 (for-each (lambda (file)
944 (install-file (string-append "build/" file)
946 '("testlex" "spin2cpp" "fastspin")))
950 ("propeller-load" ,propeller-load)
951 ("propeller-toolchain" ,propeller-toolchain)))
952 (home-page "https://github.com/totalspectrum/spin2cpp")
953 (synopsis "Convert Spin code to C, C++, or PASM code")
954 (description "This is a set of tools for converting the Spin language for
955 the Parallax Propeller micro-controller into C or C++ code, into PASM, or even
956 directly into an executable binary. The binaries produced use LMM PASM, so
957 they are much faster than regular Spin bytecodes (but also quite a bit
959 (license license:expat)))
961 (define-public spinsim
962 (let ((commit "66915a7ad1a3a2cf990a725bb341fab8d11eb620")
966 (version (string-append "0.75-" revision "." (string-take commit 9)))
970 (url "https://github.com/parallaxinc/spinsim")
972 (file-name (string-append name "-" commit "-checkout"))
975 "1n9kdhlxsdx7bz6c80w8dhi96zp633gd6qs0x9i4ii8qv4i7sj5k"))))
976 (build-system gnu-build-system)
978 `(#:tests? #f ; no tests
980 (modify-phases %standard-phases
983 (lambda* (#:key outputs #:allow-other-keys)
984 (let ((bin (string-append (assoc-ref outputs "out")
986 (install-file "build/spinsim" bin))
988 (home-page "https://github.com/parallaxinc/spinsim")
989 (synopsis "Spin simulator")
990 (description "This package provides the tool @code{spinsim}, a simulator
991 and simple debugger for Spin programs written for a Parallax Propeller
992 micro-controller. Spinsim supports execution from cog memory and hub
993 execution, but it does not support multi-tasking. It supports about
994 two-thirds of the opcodes in the P2 instruction set.")
995 (license license:expat))))
997 (define-public propeller-development-suite
999 (name "propeller-development-suite")
1000 (version (package-version propeller-gcc))
1002 (build-system trivial-build-system)
1003 (arguments '(#:builder (begin (mkdir %output) #t)))
1005 `(("toolchain" ,propeller-toolchain)
1006 ("openspin" ,openspin)
1007 ("propeller-load" ,propeller-load)
1008 ("spin2cpp" ,spin2cpp)
1009 ("spinsim" ,spinsim)))
1010 (synopsis "Complete development suite for Propeller micro-controllers")
1011 (description "This meta-package provides a complete environment for the
1012 development with Parallax Propeller micro-controllers. It includes the GCC
1013 toolchain, the loader, the Openspin compiler, the Spin2cpp tool, and the Spin
1015 (home-page (package-home-page propeller-gcc))
1016 (license (package-license propeller-gcc))))
1018 (define-public binutils-vc4
1019 (let ((commit "708acc851880dbeda1dd18aca4fd0a95b2573b36"))
1021 (name "binutils-vc4")
1022 (version (string-append "2.23.51-0." (string-take commit 7)))
1026 (url "https://github.com/puppeh/binutils-vc4")
1028 (file-name (string-append name "-" version "-checkout"))
1031 "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63"))))
1032 (build-system gnu-build-system)
1034 `(#:configure-flags '("--target=vc4-elf"
1036 "--enable-cgen-maint")
1038 (modify-phases %standard-phases
1039 (add-after 'unpack 'unpack-cgen
1040 (lambda* (#:key inputs #:allow-other-keys)
1041 (copy-recursively (string-append (assoc-ref inputs "cgen")
1044 (add-after 'unpack-cgen 'fix-cgen-guile
1046 (substitute* "opcodes/Makefile.in"
1047 (("guile\\{,-\\}1.8") "guile"))
1048 (invoke "which" "guile"))))))
1054 (url "https://github.com/puppeh/cgen")
1055 (commit "d8e2a9eb70425f180fdd5bfd032884b0855f2032")))
1058 "14b3h2ji740s8zq5vwm4qdcxs4aa4wxi6wb9di3bv1h39x14nyr9"))))
1059 ("texinfo" ,texinfo)
1062 ("guile-1.8" ,guile-1.8)
1063 ("which" ,base:which)))
1064 (synopsis "Binutils for VC4")
1065 (description "This package provides @code{binutils} for VideoCore IV,
1066 the Raspberry Pi chip.")
1067 (license license:gpl3+)
1068 (home-page "https://github.com/puppeh/vc4-toolchain/"))))
1070 (define-public gcc-vc4
1071 (let ((commit "0fe4b83897341742f9df65797474cb0feab4b377")
1072 (xgcc (cross-gcc "vc4-elf" #:xgcc gcc-6 #:xbinutils binutils-vc4)))
1073 (package (inherit xgcc)
1078 (url "https://github.com/puppeh/gcc-vc4")
1080 (file-name (string-append name
1082 (package-version xgcc)
1086 "0kvaq4s0assvinmmicwqp07d0wwldcw0fv6f4k13whp3q5909jnr"))
1088 (search-patches "gcc-6-fix-buffer-size.patch"
1089 "gcc-6-fix-isl-includes.patch"))))
1092 ,@(package-native-inputs xgcc)))
1093 (synopsis "GCC for VC4")
1094 (description "This package provides @code{gcc} for VideoCore IV,
1095 the Raspberry Pi chip."))))
1097 (define-public python-libmpsse
1099 (name "python-libmpsse")
1105 (url "https://github.com/daym/libmpsse")
1106 (commit (string-append "v" version))))
1107 (file-name "libmpsse-checkout")
1110 "1rypfb96k2szqgygp3jnwg2zq9kwmfz0460dsahn3r2vkzml8wn7"))))
1111 (build-system gnu-build-system)
1113 `(("libftdi" ,libftdi)
1114 ("python" ,python)))
1116 `(("pkg-config" ,pkg-config)
1118 ("which" ,base:which)))
1120 `(#:tests? #f ; No tests exist.
1121 #:parallel-build? #f ; Would be buggy.
1123 (list (string-append "CFLAGS=-Wall -fPIC -fno-strict-aliasing -g -O2 "
1124 "$(shell pkg-config --cflags libftdi1)"))
1126 (modify-phases %standard-phases
1127 (add-after 'unpack 'set-environment-up
1128 (lambda* (#:key inputs outputs #:allow-other-keys)
1129 (let ((python (assoc-ref inputs "python")))
1131 (setenv "PYDEV" (string-append python
1133 ,(version-major+minor (package-version python))))
1136 (lambda* (#:key inputs outputs make-flags #:allow-other-keys #:rest args)
1137 (let* ((out (assoc-ref outputs "out"))
1138 (out-python (string-append out
1140 ,(version-major+minor (package-version python))
1142 (install (assoc-ref %standard-phases 'install)))
1143 (install #:make-flags (cons (string-append "PYLIB=" out-python)
1145 (home-page "https://code.google.com/archive/p/libmpsse/")
1146 (synopsis "Python library for MPSSE SPI I2C JTAG adapter by FTDI")
1147 (description "This package provides a library in order to support the
1148 MPSSE (Multi-Protocol Synchronous Serial Engine) adapter by FTDI that can do
1150 (license license:gpl2+)))
1152 (define-public python2-libmpsse
1154 (inherit python-libmpsse)
1155 (name "python2-libmpsse")
1157 (substitute-keyword-arguments (package-arguments python-libmpsse)
1159 `(modify-phases ,phases
1160 (replace 'set-environment-up
1161 (lambda* (#:key inputs outputs #:allow-other-keys)
1162 (let ((python (assoc-ref inputs "python")))
1164 (setenv "PYDEV" (string-append python
1166 ,(version-major+minor (package-version python-2))))
1169 (lambda* (#:key inputs outputs make-flags #:allow-other-keys #:rest args)
1170 (let* ((out (assoc-ref outputs "out"))
1171 (out-python (string-append out
1173 ,(version-major+minor (package-version python-2))
1175 (install (assoc-ref %standard-phases 'install)))
1176 (install #:make-flags (cons (string-append "PYLIB=" out-python)
1179 (alist-replace "python" (list python-2)
1180 (package-inputs python-libmpsse)))))
1182 (define-public picprog
1188 (uri (string-append "http://www.iki.fi/hyvatti/pic/picprog-"
1190 (file-name (string-append name "-" version ".tar.gz"))
1193 "1r04hg1n3v2jf915qr05la3q9cxy7a5jnh9cc98j04lh6c9p4x85"))
1194 (patches (search-patches "picprog-non-intel-support.patch"))))
1195 (build-system gnu-build-system)
1197 `(#:tests? #f ; No tests exist.
1199 (modify-phases %standard-phases
1200 (add-after 'unpack 'patch-paths
1201 (lambda* (#:key outputs #:allow-other-keys)
1202 (substitute* "Makefile"
1203 (("/usr/local") (assoc-ref outputs "out"))
1204 ((" -o 0 -g 0 ") " ")
1207 (add-before 'install 'mkdir
1208 (lambda* (#:key outputs #:allow-other-keys)
1209 (let ((out (assoc-ref outputs "out")))
1210 (mkdir-p (string-append out "/bin"))
1211 (mkdir-p (string-append out "/man/man1"))
1213 (delete 'configure))))
1214 (synopsis "Programs Microchip's PIC microcontrollers")
1215 (description "This program programs Microchip's PIC microcontrollers.")
1216 (home-page "https://hyvatti.iki.fi/~jaakko/pic/picprog.html")
1217 (license license:gpl3+)))
1219 (define-public fc-host-tools
1221 (name "fc-host-tools")
1225 (uri (string-append "ftp://ftp.freecalypso.org/pub/GSM/"
1226 "FreeCalypso/fc-host-tools-r" version ".tar.bz2"))
1229 "09ccd76khfvlx4dwi9dhrzl5mm68402mlych0g7f9ncfr5jzyf26"))))
1230 (build-system gnu-build-system)
1232 `(#:tests? #f ; No tests exist.
1234 (list (string-append "INSTALL_PREFIX=" %output)
1235 (string-append "INCLUDE_INSTALL_DIR=" %output "include/rvinterf"))
1237 (modify-phases %standard-phases
1238 (add-after 'unpack 'patch-installation-paths
1239 (lambda* (#:key outputs #:allow-other-keys)
1240 (substitute* '("Makefile"
1241 "rvinterf/etmsync/fsiomain.c"
1242 "rvinterf/etmsync/fsnew.c"
1243 "rvinterf/asyncshell/help.c"
1244 "rvinterf/libinterf/launchrvif.c"
1245 "loadtools/defpath.c"
1246 "loadtools/Makefile"
1247 "miscutil/c139explore"
1248 "miscutil/pirexplore"
1249 "ffstools/tiffs-wrappers/installpath.c"
1250 "uptools/atcmd/atinterf.c")
1251 (("/opt/freecalypso/loadtools")
1252 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
1253 (("\\$\\{INSTALL_PREFIX\\}/loadtools")
1254 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
1255 (("\\$\\{INSTALL_PREFIX\\}/target-bin")
1256 (string-append (assoc-ref outputs "out") "/lib/freecalypso/target-bin"))
1257 (("/opt/freecalypso")
1258 (assoc-ref outputs "out")))
1260 (delete 'configure))))
1262 `(("libx11" ,libx11)))
1263 (synopsis "Freecalypso host tools")
1264 (description "This package provides some tools for debugging FreeCalypso phones and the FreeCalypso FCDEV3B dev board.
1267 @item fc-e1decode: Decodes a binary Melody E1 file into an ASCII source file.
1268 @item fc-e1gen: Encodes an ASCII Melody E1 file into a binary Melody E1 file.
1269 @item fc-fr2tch: Converts a GSM 06.10 speech recording from libgsm to hex
1270 strings of TCH bits to be fed to the GSM 05.03 channel encoder of a TI
1272 @item fc-tch2fr: Converts hex strings of TCH bits to libgsm.
1273 @item fc-gsm2vm: utility converts a GSM 06.10 speech sample from the libgsm
1274 source format into a voice memo file that can be uploaded into the FFS of a
1275 FreeCalypso device and played with the audio_vm_play_start() API or the
1276 AT@@VMP command that invokes the latter.
1277 @item fc-rgbconv: Convers RGB 5:6:5 to RGB 8:8:8 and vice versa.
1278 @item rvinterf: Communicates with a TI Calypso GSM device via RVTMUX.
1279 @item rvtdump: produces a human-readable dump of all output emitted by a
1280 TI-based GSM fw on the RVTMUX binary packet interface.
1281 @item fc-shell: FreeCalypso firmwares have a feature of our own invention
1282 (not present in any pre-existing ones) to accept AT commands over the RVTMUX
1283 interface. It is useful when no second UART is available for a dedicated
1284 standard AT command interface. fc-shell is the tool that allows you to send
1285 AT commands to the firmware in this manner.
1286 @item fc-memdump: Captures a memory dump from a GSM device.
1287 @item fc-serterm: Trivial serial terminal. Escapes binary chars.
1288 @item fc-fsio: Going through rvinterf, this tool connects to GSM devices and
1289 allows you to manipulate the device's flash file system.
1290 @item tiaud-compile: Compiles an audio mode configuration table for TI's
1291 Audio Service from our own ASCII source format into the binary format for
1292 uploading into FreeCalypso GSM device FFS with fc-fsio.
1293 @item tiaud-decomp: Decodes TI's audio mode configuration files read out of
1294 FFS into our own ASCII format.
1295 @item tiaud-mkvol: Generates the *.vol binary files which need to accompany
1296 the main *.cfg ones.
1297 @item fc-compalram: Allows running programs on the device without writing
1298 them to flash storage.
1299 @item fc-xram: Allows running programs on the device without writing them
1301 @item fc-iram: Allows running programs on the device without writing them
1303 @item fc-loadtool: Writes programs to the device's flash storage.
1304 @item pirffs: Allows listing and extracting FFS content captured as a raw
1305 flash image from Pirelli phones.
1306 @item mokoffs: Allows listing and extracting FFS content captured as a raw
1307 flash image from OpenMoko phones.
1308 @item tiffs: Allows listing and extracting FFS content captured as a raw
1309 flash image from TI phones.
1310 @item c139explore: Run-from-RAM program for C139 phones that
1311 exercises their peripheral hardware: LCD, keypad backlight, buzzer, vibrator.
1312 @item pirexplore: Run-from-RAM program for Pirelli DP-L10 phones that
1313 exercises their peripheral hardware, primarily their LCD.
1314 @item tfc139: Breaks into Mot C1xx phones via shellcode injection, allowing
1315 you to reflash locked phones with new firmware with fc-loadtool.
1316 @item ctracedec: GSM firmwares built in TI's Windows environment have a
1317 compressed trace misfeature whereby many of the ASCII strings
1318 in debug trace messages get replaced with numeric indices at
1319 build time, and these numeric indices are all that gets emitted
1320 on the RVTMUX serial channel. This tools decodes these numeric indices
1321 back to strings in trace output.
1322 @item fc-cal2text: This utility takes a dump of TI's /gsm/rf flash file system
1323 directory subtree as input (either extracted in vitro with tiffs
1324 or read out in vivo with fc-fsio) and converts all RF tables
1325 found therein into a readable ASCII format.
1326 @item imei-luhn: Computes or verifies the Luhn check digit of an IMEI number.
1327 @item fc-dspapidump: Reads and dumps the contents of the DSP API RAM in a
1328 target Calypso GSM device.
1329 @item fc-vm2hex: Converts the old-fashioned (non-AMR) voice memo files read
1330 out of FFS into hex strings.
1331 @item fc-buzplay: Plays piezoelectic buzzer melodies on an actual
1332 Calypso device equipped with such a buzzer (Mot C1xx, TI's D-Sample board,
1333 our planned future HSMBP) by loading a buzplayer agent onto the target and
1334 feeding melodies to be played to it.
1335 @item fc-tmsh: TI-based GSM firmwares provide a rich set of Test Mode commands
1336 that can be issued through the RVTMUX (debug trace) serial channel.
1337 This program is our test mode shell for sending Test Mode commands to targets
1338 and displaying decoded target responses.
1339 @item fcup-smsend: Send a short message via SMS
1340 @item fcup-smsendmult: Send multiple short messages via SMS in one go
1341 @item fcup-smsendpdu: Send multiple short messages given in PDU format via SMS
1342 @item sms-pdu-decode: Decode PDU format messages
1343 @item fc-dspromdump: Dump DSP ROM.
1344 @item pcm-sms-decode: Decode /pcm/SMS binary files read out of FFS maintained
1345 by Pirelli DP-L10. Display the SMS in human-readable form.
1346 @item srec-regions: Parse S-record (TI's *.m0), identify the set of
1347 discontiguous regions into which this SREC image deposits bits, and list
1348 these identified regions.
1350 (home-page "https://www.freecalypso.org/")
1351 (license license:public-domain)))
1353 (define-public stlink
1361 (url "https://github.com/texane/stlink")
1362 (commit (string-append "v" version))))
1363 (file-name (git-file-name name version))
1366 "1d5gxiqpsm8fc105cxlp27af9fk339fap5h6nay21x5a7n61jgyc"))))
1367 (build-system cmake-build-system)
1369 `(#:tests? #f ;no tests
1371 (let* ((out (assoc-ref %outputs "out"))
1372 (etc (in-vicinity out "etc"))
1373 (modprobe (in-vicinity etc "modprobe.d"))
1374 (udev-rules (in-vicinity etc "udev/rules.d")))
1375 (list (string-append "-DSTLINK_UDEV_RULES_DIR=" udev-rules)
1376 (string-append "-DSTLINK_MODPROBED_DIR=" modprobe)))))
1378 `(("libusb" ,libusb)))
1379 (synopsis "Programmer for STM32 Discovery boards")
1380 (description "This package provides a firmware programmer for the STM32
1381 Discovery boards. It supports two versions of the chip: ST-LINK/V1 (on
1382 STM32VL discovery kits) and ST-LINK/V2 (on STM32L discovery and later kits).
1383 Two different transport layers are used: ST-LINK/V1 uses SCSI passthru
1384 commands over USB, and ST-LINK/V2 and ST-LINK/V2-1 (seen on Nucleo boards) use
1386 (home-page "https://github.com/texane/stlink")
1387 ;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are
1388 ;; licensed under the GPLv2+.
1389 (license (list license:bsd-3 license:gpl2+))))
1398 (uri (pypi-uri "west" version))
1401 "0ql6ij1hrj2ir5wkxm96zgig5qwvfwa75w77wh2y13w6b9cqcr4b"))))
1403 `(("python-colorama" ,python-colorama)
1404 ("python-configobj" ,python-configobj)
1405 ("python-pykwalify" ,python-pykwalify)
1406 ("python-pyyaml" ,python-pyyaml)))
1407 (build-system python-build-system)
1408 (home-page "https://github.com/zephyrproject-rtos/west")
1409 (synopsis "Zephyr RTOS Project meta-tool")
1410 (description "West is the swiss-army knife command line tool of the Zephyr
1411 project. Its built-in commands provide a multiple repository management
1412 system with features inspired by Google’s Repo tool and Git submodules. West
1413 simplifies configuration and is also pluggable: you can write your own west
1414 \"extension commands\" which add additional features to west. Zephyr uses
1415 this feature to provide conveniences for building applications, flashing and
1416 debugging them, and more.")
1417 (license license:expat)))
1419 (define-public ebusd
1426 (url "https://github.com/john30/ebusd")
1427 (commit (string-append "v" version))))
1428 (file-name (string-append name "-" version "-checkout"))
1431 "0iva70bam7wdx60bpd3an9kxr28zxlvp3vprivgqshwwdhqa0hzp"))))
1432 (build-system gnu-build-system)
1435 (modify-phases %standard-phases
1436 (add-after 'install 'install-config
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let ((config-destination
1439 (string-append (assoc-ref outputs "out")
1441 (copy-recursively (string-append (assoc-ref inputs "config")
1446 `(("mosquitto" ,mosquitto)))
1448 `(("automake" ,automake)
1449 ("autoconf" ,autoconf)
1454 (url "https://github.com/john30/ebusd-configuration")
1455 (commit "666c0f6b9c4d7545eff7f43ab28a1c7baeab7913")))
1456 (file-name "config-checkout")
1459 "0yxnx8p4lbk614l16854r9s9d8s9c7ixgczfs8mph94xz0wkda7x"))))))
1460 (synopsis "Daemon for communicating with eBUS devices")
1461 (description "This package provides @command{ebusd}, a daemon for
1462 handling communication with eBUS devices connected to a 2-wire bus system
1463 (\"energy bus\" used by numerous heating systems).")
1464 (home-page "https://ebusd.eu/")
1465 (license license:gpl3+)))
1467 (define-public ucsim
1470 (version "0.6-pre67")
1474 "http://mazsola.iit.uni-miskolc.hu/ucsim/download/unix/"
1475 "devel/ucsim-" version ".tar.gz"))
1478 "0aahj9pbfjphjrm4hgs9pfmp6d5aikaq4yvxlrvhywjinnnf0qp1"))))
1479 (build-system gnu-build-system)
1481 `(#:configure-flags '("--enable-avr-port"
1482 "--enable-m6809-port"
1483 "--enable-p1516-port"
1484 "--enable-st7-port")
1486 (modify-phases %standard-phases
1487 (add-after 'unpack 'patch-makefiles
1489 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1490 (("/bin/sh") (which "sh")))
1492 (add-after 'install 'remove-empty-directory
1493 (lambda* (#:key outputs #:allow-other-keys)
1494 (delete-file-recursively
1495 (string-append (assoc-ref outputs "out") "/share/man"))
1500 (home-page "http://mazsola.iit.uni-miskolc.hu/ucsim/")
1501 (synopsis "Simulators for various microcontroller families")
1502 (description "μCsim is a collection of software simulators for
1503 microcontrollers in the Atmel AVR; Intel MCS-51 (8051); Motorola 68HC08 and
1504 6809; P1516; Padauk PDK13, PDK14 and PDK15; STMicroelectronics ST7 and STM8;
1505 and Zilog Z80 families, plus many of their variants.")
1506 (license license:gpl2+)))
1515 "mirror://sourceforge/sdcc/sdcc"
1516 "/" version "/sdcc-src-" version ".tar.bz2"))
1519 "0gskzli17ghnn5qllvn4d56qf9bvvclqjh63nnj63p52smvggvc1"))
1520 (modules '((guix build utils)))
1523 ;; Remove non-free source files
1524 (delete-file-recursively "device/non-free")
1525 ;; Remove bundled μCsim source
1526 (delete-file-recursively "sim")
1528 (patches (search-patches "sdcc-disable-non-free-code.patch"))))
1529 (build-system gnu-build-system)
1534 ("python-2" ,python-2)
1535 ("texinfo" ,texinfo)
1538 `(;; GPUTILS is required for the PIC ports, but the licensing status of
1539 ;; some of the files contained in its distribution is unclear (see
1540 ;; https://issues.guix.gnu.org/44557). For this reason it is not yet
1541 ;; available as a package in Guix.
1543 '("--disable-pic14-port" "--disable-pic16-port" "--disable-ucsim")
1545 (modify-phases %standard-phases
1546 (add-after 'unpack 'patch-makefiles
1548 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1549 (("/bin/sh") (which "sh")))
1551 (home-page "http://sdcc.sourceforge.net")
1552 (synopsis "C compiler suite for 8-bit microcontrollers")
1553 (description "SDCC is a retargetable, optimizing Standard C compiler suite
1554 that targets 8-bit microcontrollers in the Intel MCS-51 (8051); Motorola
1555 68HC08; Padauk PDK13, PDK14 and PDK15; STMicroelectronics STM8; and Zilog Z80
1556 families, plus many of their variants.")
1557 (license (list license:gpl2+
1562 license:public-domain
1565 (define-public python-psptool
1567 (name "python-psptool")
1571 (uri (pypi-uri "psptool" version))
1574 "1kx0xpfx67m4zclk4gs97wiwjms8i7z4f6b6m68y8sfgpshy4rf3"))
1575 (modules '((guix build utils)))
1578 ;; IPython is not used by the package at all
1579 (substitute* '("psptool/directory.py" "psptool/entry.py")
1580 (("from IPython.*") ""))))))
1581 (build-system python-build-system)
1583 `(("python-cryptography" ,python-cryptography)
1584 ("python-prettytable" ,python-prettytable)))
1585 (home-page "https://github.com/PSPReverse/psptool")
1586 (synopsis "Tool for dealing with AMD binary blobs")
1587 (description "PSPTool is a tool for dealing with AMD binary blobs")
1588 (license license:gpl3+)))
1590 (define-public agent-proxy
1591 (let ((commit "8927798a71d246871ea8fc22b4512296a3fa1765")
1594 (name "agent-proxy")
1595 (version (git-version "1.98" revision commit))
1597 "https://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git")
1600 (uri (git-reference (url home-page) (commit commit)))
1601 (file-name (git-file-name name version))
1604 "1bxkzwsqfld4pknmiq8j3k55pv90n8s6kzh0xh42bhy2jv1wxz2z"))))
1605 (build-system gnu-build-system)
1609 (modify-phases %standard-phases
1611 (add-after 'build 'build-kdmx
1613 (invoke "make" "-C" "kdmx")
1616 (lambda* (#:key outputs #:allow-other-keys)
1617 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
1618 (install-file "agent-proxy" bin)
1619 (install-file "kdmx/kdmx" bin)
1621 (synopsis "Proxies to run kgdb/gdbserver and console on a serial port")
1622 (description "These programs are proxies allowing to run kgdb/gdbserver
1623 and console on a single serial port. agent-proxy creates network sockets,
1624 whereas kdmx creates pseudo-ttys.")
1625 (license license:gpl2))))