Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerized toolchain support #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matsievskiysv
Copy link

This PR adds support for dockerized build toolchain, which would allow adding CI/CD to this project.

  • folder docker contains build.dockerfile for building the toolchain container and instructions on how to use it.
  • Makefile added to BPv4 bootloader and firmware folders for building without microchip IDE
  • minor changes to code were added to make it compile

Notes:

  • I successfully flashed and tested BPv4 firmware using pickit2
  • I flashed BPv4 bootloader using pickit2 and cannot enter bootloader mode, but I had exactly the same problem with precompiled binaries from this project. I think, that the problem is in my board
  • xc16 linker seem to be sensitive to the order of the object files, so couldn't use wildcard in firmware Makefile

@DerekGn
Copy link

DerekGn commented Oct 6, 2022

@matsievskiysv

I tried to build the v4 firmware using the docker image in this PR. However I am getting an error

From BASH shell

xxxxxxxxxxxxxxxxxxxx MINGW64 /d/Git/Bus_Pirate/Bootloaders/BPv4-bootloader/firmware-v1 (pr-docker)
$ docker run --rm -it -v $PWD:/work buspirate:latest
make: *** No targets specified and no makefile found.  Stop.

From Powershell

D:\Git\Bus_Pirate\Bootloaders\BPv4-bootloader\firmware-v1>docker run --rm -it -v %cd%/work buspirate:latest
make: *** No targets specified and no makefile found.  Stop.

I am running docker on windows. Any ideas?

@matsievskiysv
Copy link
Author

You should check that folder got mounted. Issue command

docker run --rm -it -v $PWD:/work --entrypoint bash buspirate:latest

This will take you to the shell inside the container. Check that firmware files are present in /work folder.

@DerekGn
Copy link

DerekGn commented Oct 6, 2022

Its empty

$ docker run --rm -it -v $PWD:/work --entrypoint bash buspirate:latest
root@8c2156db0d15:/work# ls
root@8c2156db0d15:/work#

@matsievskiysv
Copy link
Author

You could double-check that $PWD points to the right folder

ls $PWD

If it does, then the docker installation is messed up. I actually don't know if windows docker supports folder mounts.

@DerekGn
Copy link

DerekGn commented Oct 6, 2022

It seems to be OK

root@8c2156db0d15:/work# ls $PWD
root@8c2156db0d15:/work# ls $PWD
root@8c2156db0d15:/work#

It was probably a stretch trying to get this to work on windows. I will move over to debian and give it a try. Thanks for the help.

@matsievskiysv
Copy link
Author

It seems to be OK

No, I've meant to issue this command from mingw, not from inside the container.

@DerekGn
Copy link

DerekGn commented Oct 6, 2022

Sorry misunderstood

xxxxxxxxx MINGW64 /d/Git/Bus_Pirate/Bootloaders/BPv4-bootloader/firmware-v1 (pr-docker)
$ ls $PWD
boot_config.h  bootloader.c  bootloader.h  bpv4-bootloader.X/  cdc.c  cdc.h  descriptors.h  globals.h  main.c  Makefile  p24FJ256GB106.gld  picusb.h  usb_lang.h  usb_stack.c  usb_stack.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants