unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#48767] [PATCH 2/7] gnu: Add gcc-msp430.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
@ 2021-06-01  3:09 ` Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 3/7] gnu: Add newlib-msp430 Morgan.J.Smith
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (gcc-msp430): New variable.
---
 gnu/packages/bootstrap.scm |  1 +
 gnu/packages/embedded.scm  | 46 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index c598cedc0a..54a028e977 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -311,6 +311,7 @@ (define* (glibc-dynamic-linker
         ((string=? system "arm-eabi") "no-ld.so")
         ((string=? system "xtensa-elf") "no-ld.so")
         ((string=? system "avr") "no-ld.so")
+        ((string=? system "msp430-elf") "no-ld.so")
         ((string=? system "propeller-elf") "no-ld.so")
         ((string=? system "i686-mingw") "no-ld.so")
         ((string=? system "x86_64-mingw") "no-ld.so")
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 3e66382eed..cf48c61a93 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -530,6 +530,52 @@ (define-public gcc-msp430-support-files
      `(("unzip" ,unzip)))
     (license license:bsd-3)))
 
+(define-public gcc-msp430
+  (let ((xgcc (cross-gcc "msp430-elf"
+                         #:xgcc gcc-9
+                         #:xbinutils (cross-binutils "msp430-elf"))))
+    (package
+      (inherit xgcc)
+      (name "gcc-msp430")
+      (native-inputs
+       `(("gcc" ,gcc-9)
+         ,@(package-native-inputs xgcc)))
+      (arguments
+       (substitute-keyword-arguments (package-arguments xgcc)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let ((gcc (assoc-ref inputs  "gcc")))
+                   ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
+                   ;; prevent header conflict with the GCC from native-inputs.
+                   (setenv "CPLUS_INCLUDE_PATH"
+                           (string-join
+                            (delete (string-append gcc "/include/c++")
+                                    (string-split (getenv "CPLUS_INCLUDE_PATH")
+                                                  #\:))
+                            ":"))
+                   (format #t
+                           "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+                           (getenv "CPLUS_INCLUDE_PATH"))
+                   #t)))))
+         ((#:configure-flags flags)
+          `(append (list
+                    "--target=msp430-elf"
+                    "--enable-languages=c,c++"
+                    "--disable-nls"
+                    "--enable-initfini-array"
+                    "--enable-target-optspace"
+                    "--enable-newlib-nano-formatted-io")
+                   ,flags))))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "CROSS_C_INCLUDE_PATH")
+              (files '("msp430-elf/include")))
+             (search-path-specification
+              (variable "CROSS_LIBRARY_PATH")
+              (files '("msp430-elf/lib"))))))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#48767] [PATCH 3/7] gnu: Add newlib-msp430.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
  2021-06-01  3:09 ` [bug#48767] [PATCH 2/7] gnu: Add gcc-msp430 Morgan.J.Smith
@ 2021-06-01  3:09 ` Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 4/7] gnu: Add msp430-toolchain Morgan.J.Smith
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (newlib-msp430): New variable.
---
 gnu/packages/embedded.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index cf48c61a93..af8c451573 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -576,6 +576,45 @@ (define-public gcc-msp430
               (variable "CROSS_LIBRARY_PATH")
               (files '("msp430-elf/lib"))))))))
 
+(define-public newlib-msp430
+  (package
+    (name "newlib")
+    (version "2.4.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:out-of-source? #t
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-references-to-/bin/sh
+           (lambda _
+             (substitute* '("libgloss/msp430/Makefile.in"
+                            "libgloss/libnosys/Makefile.in"
+                            "libgloss/Makefile.in")
+               (("/bin/sh") (which "sh")))
+             #t)))
+       #:configure-flags '("--target=msp430-elf"
+                           "--enable-languages=c,c++"
+                           "--disable-nls"
+                           "--enable-initfini-array")))
+    (native-inputs
+     `(("xbinutils" ,(cross-binutils "msp430-elf"))
+       ("xgcc" ,gcc-msp430)
+       ("texinfo" ,texinfo)))
+    (home-page "https://www.sourceware.org/newlib/")
+    (synopsis "C library for use on embedded systems")
+    (description "Newlib is a C library intended for use on embedded
+systems.  It is a conglomeration of several library parts that are easily
+usable on embedded products.")
+    (license (license:non-copyleft
+              "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#48767] [PATCH 4/7] gnu: Add msp430-toolchain.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
  2021-06-01  3:09 ` [bug#48767] [PATCH 2/7] gnu: Add gcc-msp430 Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 3/7] gnu: Add newlib-msp430 Morgan.J.Smith
@ 2021-06-01  3:09 ` Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 5/7] gnu: Add gdb-msp430 Morgan.J.Smith
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (msp430-toolchain): New variable.
---
 gnu/packages/embedded.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index af8c451573..dc324e54a1 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -615,6 +615,44 @@ (define-public newlib-msp430
     (license (license:non-copyleft
               "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
 
+(define (make-msp430-toolchain xgcc newlib)
+  "Produce a cross-compiler toolchain package with the compiler XGCC and the C
+library variant NEWLIB."
+  (let ((newlib-with-xgcc (package (inherit newlib)
+                                   (native-inputs
+                                    (alist-replace "xgcc" (list xgcc)
+                                                   (package-native-inputs newlib))))))
+    (package
+      (name "msp430-toolchain")
+      (version (package-version xgcc))
+      (source #f)
+      (build-system trivial-build-system)
+      (arguments
+       '(#:modules ((guix build union))
+         #:builder
+         (begin
+           (use-modules (ice-9 match)
+                        (guix build union))
+           (match %build-inputs
+             (((names . directories) ...)
+              (union-build (assoc-ref %outputs "out")
+                           directories)
+              #t)))))
+      (propagated-inputs
+       `(("binutils" ,(cross-binutils "msp430"))
+         ("gcc" ,xgcc)
+         ("gcc-msp430-support-files" ,gcc-msp430-support-files)
+         ("newlib" ,newlib-with-xgcc)))
+      (synopsis "Complete GCC tool chain for MSP430")
+      (description "This package provides a complete GCC tool chain for MSP430.
+This includes the GCC msp430-elf cross compiler and newlib as the C library.
+The supported programming language is C.")
+      (home-page (package-home-page xgcc))
+      (license (package-license xgcc)))))
+
+(define-public msp430-toolchain
+  (make-msp430-toolchain gcc-msp430 newlib-msp430))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#48767] [PATCH 5/7] gnu: Add gdb-msp430.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
                   ` (2 preceding siblings ...)
  2021-06-01  3:09 ` [bug#48767] [PATCH 4/7] gnu: Add msp430-toolchain Morgan.J.Smith
@ 2021-06-01  3:09 ` Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 6/7] gnu: mspdebug: Update to 0.25-0.4c4d94e Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 7/7] gnu: Add msp430lib Morgan.J.Smith
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (gdb-msp430): New variable.
---
 gnu/packages/embedded.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index dc324e54a1..6c9a8470d5 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -653,6 +653,21 @@ (define (make-msp430-toolchain xgcc newlib)
 (define-public msp430-toolchain
   (make-msp430-toolchain gcc-msp430 newlib-msp430))
 
+(define-public gdb-msp430
+  (package
+    (inherit gdb)
+    (name "gdb-msp430")
+    (arguments
+     `(#:configure-flags '("--target=msp430-elf"
+                           "--enable-languages=c,c++"
+                           "--disable-nls"
+                           "--enable-initfini-array"
+
+                           ;; These two options are used by python if support is enabled
+                           "--program-prefix=msp430-elf-"
+                           "--program-suffix=-py")
+       ,@(package-arguments gdb)))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#48767] [PATCH 6/7] gnu: mspdebug: Update to 0.25-0.4c4d94e.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
                   ` (3 preceding siblings ...)
  2021-06-01  3:09 ` [bug#48767] [PATCH 5/7] gnu: Add gdb-msp430 Morgan.J.Smith
@ 2021-06-01  3:09 ` Morgan.J.Smith
  2021-06-01  3:09 ` [bug#48767] [PATCH 7/7] gnu: Add msp430lib Morgan.J.Smith
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/debug.scm (mspdebug): Update to 0.25-0.4c4d94e.
---
 gnu/packages/debug.scm | 61 ++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 3a29886b0e..c12013e50a 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
-;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2020, 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -703,35 +703,38 @@ (define-public libleak
     (license license:gpl2+)))
 
 (define-public mspdebug
-  (package
-    (name "mspdebug")
-    (version "0.25")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/dlbeer/mspdebug")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32 "0prgwb5vx6fd4bj12ss1bbb6axj2kjyriyjxqrzd58s5jyyy8d3c"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:tests? #f                         ; no test suite
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure))              ; no configure script
-       #:make-flags
-       (list (string-append "CC=" ,(cc-for-target))
-             "INSTALL=install"
-             (string-append "PREFIX=" %output))))
-  (inputs
-     `(("libusb-compat" ,libusb-compat)
-       ("readline" ,readline)))
-    (synopsis "Debugging tool for MSP430 MCUs")
-    (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
+  ;; Last official release was 24 July 2017
+  (let ((commit "4c4d94e43bc4a18ecf82070ff81cd38dd5641e3b")
+        (revision "0"))
+    (package
+      (name "mspdebug")
+      (version (git-version "0.25" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/dlbeer/mspdebug")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32 "1lgw1dsc1aglyja610ichadvgs5b0df3wlarinczb0ykf431gjln"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                         ; no test suite
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure))              ; no configure script
+         #:make-flags
+         (list (string-append "CC=" ,(cc-for-target))
+               "INSTALL=install"
+               (string-append "PREFIX=" %output))))
+      (inputs
+       `(("libusb-compat" ,libusb-compat)
+         ("readline" ,readline)))
+      (synopsis "Debugging tool for MSP430 MCUs")
+      (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
 MSP430-JTAG-TINY programmers, as well as many other compatible
 devices.  It can be used as a proxy for gdb or as an independent
 debugger with support for programming, disassembly and reverse
 engineering.")
-    (home-page "https://github.com/dlbeer/mspdebug")
-    (license license:gpl2+)))
+      (home-page "https://github.com/dlbeer/mspdebug")
+      (license license:gpl2+))))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#48767] [PATCH 7/7] gnu: Add msp430lib.
       [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
                   ` (4 preceding siblings ...)
  2021-06-01  3:09 ` [bug#48767] [PATCH 6/7] gnu: mspdebug: Update to 0.25-0.4c4d94e Morgan.J.Smith
@ 2021-06-01  3:09 ` Morgan.J.Smith
  5 siblings, 0 replies; 6+ messages in thread
From: Morgan.J.Smith @ 2021-06-01  3:09 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/debug.scm (msp430lib): New variable.
---
 gnu/packages/debug.scm | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index c12013e50a..b4b037eb2a 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -36,6 +36,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages c)
   #:use-module (gnu packages code)
@@ -738,3 +739,61 @@ (define-public mspdebug
 engineering.")
       (home-page "https://github.com/dlbeer/mspdebug")
       (license license:gpl2+))))
+
+(define (version-with-underscores version)
+  (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))
+
+(define-public msp430lib
+  (package
+    (name "msp430lib")
+    (version "3.15.1.1")
+    (source (origin
+              (method url-fetch/zipbomb)
+              (uri (string-append
+                    "https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/"
+                    (version-with-underscores (version-major+minor+point version))
+                    "_001/export/MSPDebugStack_OS_Package_"
+                    (version-with-underscores version) ".zip"))
+              (sha256
+               (base32
+                "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list
+        (string-append "BOOST_DIR=" (assoc-ref %build-inputs "boost"))
+        (string-append "HIDOBJ=-I" (assoc-ref %build-inputs "hidapi") "/include/hidapi"
+                       " -lhidapi-libusb")
+        "STATIC_LIBS=-lbsl430")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (add-before 'build 'fix-hidapi-includes
+           (lambda _
+             (substitute*
+                 '("ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.h"
+                   "DLL430_v3/src/TI/DLL430/HidUpdateManager.cpp")
+               (("hidapi.h") "hidapi/hidapi.h"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "libmsp430.so"
+                           (string-append (assoc-ref outputs "out") "/lib"))
+             #t)))))
+    (inputs
+     `(("boost" ,boost)
+       ("hidapi" ,hidapi)
+       ("libusb" ,libusb)))
+    (native-search-paths
+     (list (search-path-specification
+            ;; Used by mspdebug. mspdebug has a few different drivers it can
+            ;; use to interact with MSP430's so this is an optional dependency
+            (variable "MSPDEBUG_TILIB_PATH")
+            (files '("lib")))))
+    (home-page "https://www.ti.com/tool/MSPDS")
+    (synopsis "Library used to program and debug MSP430 microcontrollers")
+    (description "This library facilitates communication between a host computer and
+certain MSP430 debuggers.  This is an optional dependency of mspdebug (which calls
+this library \"tilib\")")
+    (license license:bsd-3)))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-01  3:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210601030951.10432-1-Morgan.J.Smith@outlook.com>
2021-06-01  3:09 ` [bug#48767] [PATCH 2/7] gnu: Add gcc-msp430 Morgan.J.Smith
2021-06-01  3:09 ` [bug#48767] [PATCH 3/7] gnu: Add newlib-msp430 Morgan.J.Smith
2021-06-01  3:09 ` [bug#48767] [PATCH 4/7] gnu: Add msp430-toolchain Morgan.J.Smith
2021-06-01  3:09 ` [bug#48767] [PATCH 5/7] gnu: Add gdb-msp430 Morgan.J.Smith
2021-06-01  3:09 ` [bug#48767] [PATCH 6/7] gnu: mspdebug: Update to 0.25-0.4c4d94e Morgan.J.Smith
2021-06-01  3:09 ` [bug#48767] [PATCH 7/7] gnu: Add msp430lib Morgan.J.Smith

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).