unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Question regarding qmk firmware
@ 2023-10-07 21:23 Fredrik Salomonsson
  2023-10-08 10:28 ` Ekaitz Zarraga
  0 siblings, 1 reply; 6+ messages in thread
From: Fredrik Salomonsson @ 2023-10-07 21:23 UTC (permalink / raw)
  To: help-guix

Hi,

Today I was tweaking a keymap for one of my qmk based keyboards but some
of the packages I used when building the firmware has been removed.  My
commad was as follows:

```sh
    guix shell avr-toolchain dfu-programmer qmk -- qmk flash -kb ergodox_infinity -km plattfot -bl dfu-split-left
```

But `avr-toolchain` is gone.  When I tried to just drop it and see if it
worked I get

```
Ψ Compiling keymap with make --jobs=1 ergodox_infinity:plattfot:dfu-split-left


QMK Firmware 0.14.19
Making ergodox_infinity with keymap plattfot and target dfu-split-left

/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/sh: line 1: arm-none-eabi-gcc: command not found
```

It seems `arm-none-eabi-toolchain` is also removed.  Looking at the
commit history for guix it looks like they got replaced by
[proceduers][0] instead.

[0] https://git.savannah.gnu.org/cgit/guix.git/commit/?id=35c1df5bd6317b1cd038c1a4aca1c7e4a52d4d93

My question is how do I get access to the arm-none-eabi-toolchain from
the commandline with guix shell?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Question regarding qmk firmware
  2023-10-07 21:23 Question regarding qmk firmware Fredrik Salomonsson
@ 2023-10-08 10:28 ` Ekaitz Zarraga
  2023-10-10 19:32   ` Fredrik Salomonsson
  0 siblings, 1 reply; 6+ messages in thread
From: Ekaitz Zarraga @ 2023-10-08 10:28 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix




------- Original Message -------
On Saturday, October 7th, 2023 at 21:23, Fredrik Salomonsson <plattfot@posteo.net> wrote:


> Hi,
> 
> Today I was tweaking a keymap for one of my qmk based keyboards but some
> of the packages I used when building the firmware has been removed. My
> commad was as follows:
> 
> `sh guix shell avr-toolchain dfu-programmer qmk -- qmk flash -kb ergodox_infinity -km plattfot -bl dfu-split-left`
> 
> But `avr-toolchain` is gone. When I tried to just drop it and see if it
> worked I get
> 
> `Ψ Compiling keymap with make --jobs=1 ergodox_infinity:plattfot:dfu-split-left QMK Firmware 0.14.19 Making ergodox_infinity with keymap plattfot and target dfu-split-left /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/sh: line 1: arm-none-eabi-gcc: command not found`
> 
> It seems `arm-none-eabi-toolchain` is also removed. Looking at the
> commit history for guix it looks like they got replaced by
> [proceduers][0] instead.
> 
> [0] https://git.savannah.gnu.org/cgit/guix.git/commit/?id=35c1df5bd6317b1cd038c1a4aca1c7e4a52d4d93
> 
> My question is how do I get access to the arm-none-eabi-toolchain from
> the commandline with guix shell?
> 
> Thanks


Hi Fredrik,

Now what you need to do is call to the `make-avr-toolchain` function from `(gnu packages avr)` to get that.

Maybe the easiest way is to create a `manifest.scm` where you do something like this (i'm doing it by memory):

``` scheme
(use-modules (gnu packages avr)
             (gnu packages flashing-tools)
             (gnu packages firmware))

(packages->manifest (list (make-avr-toolchain) dfu-programmer qmk))
```

Then use `guix shell -m manifest.scm`.

There are other ways to do it, but I find this the easiest.
You can even make a package for your firmware and let guix compile it for you (and maybe flash it too?).

Cheers,
Ekaitz



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

* Re: Question regarding qmk firmware
  2023-10-08 10:28 ` Ekaitz Zarraga
@ 2023-10-10 19:32   ` Fredrik Salomonsson
  0 siblings, 0 replies; 6+ messages in thread
From: Fredrik Salomonsson @ 2023-10-10 19:32 UTC (permalink / raw)
  To: Ekaitz Zarraga; +Cc: help-guix


Hi Ekaitz,

Ekaitz Zarraga <ekaitz@elenq.tech> writes:

> Hi Fredrik,
>
> Now what you need to do is call to the `make-avr-toolchain` function from `(gnu packages avr)` to get that.
>
> Maybe the easiest way is to create a `manifest.scm` where you do something like this (i'm doing it by memory):
>
> ``` scheme
> (use-modules (gnu packages avr)
>              (gnu packages flashing-tools)
>              (gnu packages firmware))
>
> (packages->manifest (list (make-avr-toolchain) dfu-programmer qmk))
> ```
>
> Then use `guix shell -m manifest.scm`.
>
> There are other ways to do it, but I find this the easiest.

Thank you for pointing me in the right direction!  This is what I ended
up with:

```scheme
(use-modules
 (gnu packages embedded)
 (gnu packages flashing-tools)
 (gnu packages firmware))

(packages->manifest
 (list (make-arm-none-eabi-nano-toolchain-6)
       dfu-util
       qmk))
```
Then just simply run

```sh
guix shell -m manifest.scm -- qmk flash -kb ergodox_infinity -km plattfot -bl dfu-util-split-left
```
And that worked like a charm.

I had forgotten that my ergodox is using different tools than my kyria.
Also the nano lib threw me for a loop.  I was using the
`make-arm-none-eabi-toolchain-6` at first.

> You can even make a package for your firmware and let guix compile it
> for you (and maybe flash it too?).

Oh, that sounds that it might be useful.  Especially if it can flash it
too.  As I have a few keyboards and not all keymaps are pushed upstream
(yet).

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Question regarding qmk firmware
  2023-10-10 14:20 ` Peter Polidoro
  2023-10-10 17:43   ` Ekaitz Zarraga
@ 2023-10-10 18:32   ` Maxim Cournoyer
  1 sibling, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2023-10-10 18:32 UTC (permalink / raw)
  To: Peter Polidoro; +Cc: help-guix

Hi,

Peter Polidoro <peter@polidoro.io> writes:

> On Sunday, October 8th, 2023 at 10:28, Ekaitz Zarraga
> <ekaitz@elenq.tech> wrote:
>
>> There are other ways to do it, but I find this the easiest.
>> You can even make a package for your firmware and let guix compile
>> it for you (and maybe flash it too?).
>
>> Cheers,
>> Ekaitz
>
> I am also interested in using Guix packages for firmware projects.
>
> Do you have any links to example firmware projects that package,
> compile, and flash firmware to embedded boards?

Our 'qmk' package now contains all that is needed to build Arduino based
firmwares, and you can also use the 'qmk-make-firmware' procedure to
generate a customized firmware.  For my ErgoDox keyboard, I use the
following:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu packages firmware)
             (guix gexp))

(define-public qmk-firmware-dvorak-emacs-software-custom
  (make-qmk-firmware
   "ergodox_ez" "dvorak_emacs_software_custom"
   #:keymap-source-directory (local-file "dvorak_emacs_software"
                                         #:recursive? #t)))

qmk-firmware-dvorak-emacs-software-custom
--8<---------------cut here---------------end--------------->8---

where 'dvorak_emacs_software' is a directory containing keymap.c and
supporting files.

-- 
Thanks,
Maxim


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

* Re: Question regarding qmk firmware
  2023-10-10 14:20 ` Peter Polidoro
@ 2023-10-10 17:43   ` Ekaitz Zarraga
  2023-10-10 18:32   ` Maxim Cournoyer
  1 sibling, 0 replies; 6+ messages in thread
From: Ekaitz Zarraga @ 2023-10-10 17:43 UTC (permalink / raw)
  To: Peter Polidoro; +Cc: help-guix





ElenQ Technology


------- Original Message -------
On Tuesday, October 10th, 2023 at 14:20, Peter Polidoro <peter@polidoro.io> wrote:


> On Sunday, October 8th, 2023 at 10:28, Ekaitz Zarraga
> ekaitz@elenq.tech wrote:
> 
> > There are other ways to do it, but I find this the easiest.
> > You can even make a package for your firmware and let guix
> > compile it for you (and maybe flash it too?).
> 
> > Cheers,
> > Ekaitz
> 
> 
> I am also interested in using Guix packages for firmware projects.
> 
> Do you have any links to example firmware projects that package,
> compile, and flash firmware to embedded boards?
> 
> This would be a great blog post if you are up for writing it. I
> really enjoyed Mitchell Schmeisser's blog post about building
> toolchains with Guix. It would be nice to see examples of firmware
> that do not use the Zephyr real-time operating system as well, if
> anyone is doing that.
> 
> I am tempted to use PlatformIO with Guix as an intermediate
> solution until I figure out how to do everything in Guix. I would
> like to have a pure Guix solution for Arduino-based projects and
> Raspberry Pi RP2040 as well.
> 
> Thanks!


Hi Peter,

I suggest you to take a look to:
  https://lists.gnu.org/archive/html/guix-devel/2023-10/msg00014.html
Because I'm the ^1 in that email and you can see the problems I've
had with ARM (it was a problem with RP4020).

The current toolchain is not able to find the stdlib.h and this is a
huge inconvenience. I didn't manage to solve it but the email I'm
linking there is really promising (I didn't have the time to test,
but the author told me he was able to solve my problem using his
toolchain).

We should fix this in Guix, but right now it just doesn't work.

Cheers,
Ekaitz


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

* Re: Question regarding qmk firmware
       [not found] <mailman.67.1696780842.10213.help-guix@gnu.org>
@ 2023-10-10 14:20 ` Peter Polidoro
  2023-10-10 17:43   ` Ekaitz Zarraga
  2023-10-10 18:32   ` Maxim Cournoyer
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Polidoro @ 2023-10-10 14:20 UTC (permalink / raw)
  To: help-guix

On Sunday, October 8th, 2023 at 10:28, Ekaitz Zarraga 
<ekaitz@elenq.tech> wrote:

> There are other ways to do it, but I find this the easiest.
> You can even make a package for your firmware and let guix 
> compile it for you (and maybe flash it too?).

> Cheers,
> Ekaitz

I am also interested in using Guix packages for firmware projects.

Do you have any links to example firmware projects that package, 
compile, and flash firmware to embedded boards?

This would be a great blog post if you are up for writing it. I 
really enjoyed Mitchell Schmeisser's blog post about building 
toolchains with Guix. It would be nice to see examples of firmware 
that do not use the Zephyr real-time operating system as well, if 
anyone is doing that.

I am tempted to use PlatformIO with Guix as an intermediate 
solution until I figure out how to do everything in Guix. I would 
like to have a pure Guix solution for Arduino-based projects and 
Raspberry Pi RP2040 as well.

Thanks!


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

end of thread, other threads:[~2023-10-10 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-07 21:23 Question regarding qmk firmware Fredrik Salomonsson
2023-10-08 10:28 ` Ekaitz Zarraga
2023-10-10 19:32   ` Fredrik Salomonsson
     [not found] <mailman.67.1696780842.10213.help-guix@gnu.org>
2023-10-10 14:20 ` Peter Polidoro
2023-10-10 17:43   ` Ekaitz Zarraga
2023-10-10 18:32   ` Maxim Cournoyer

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).