> The build was successful! Great. The whole process is easier than I probably made it seem! 🙂 Just follow Liviu's instructions and then edit the scripts/defs-source.sh file. In fact Liviu just accepted a Pull Request from me that adds the required defines commented out so they just need to be uncommented:
https://github.com/xpack-dev-tools/openocd-xpack/blob/xpack/scripts/defs-source.sh#L43 > Is this really the latest bleeding-edge version? If anyone can confirm, Yes - that's the latest commit in the OpenOCD master repo at the moment: https://repo.or.cz/openocd.git/shortlog/f98099507f509db9a18c70365490a6b9f67108db https://repo.or.cz/openocd.git/commit/f98099507f509db9a18c70365490a6b9f67108db ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 18:23 To: Tommy Murphy <tommy_mur...@hotmail.com>; Liviu Ionescu <i...@livius.net> Cc: openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Hi @Tommy Murphy and @Liviu Ionescu, The build was successful! I transferred the build outputs to Windows 10 and unzipped xpack-openocd-0.10.0-14-win32-x64.zip. Then I run openocd.exe: C:\Users\Kristof\ubuntu_shared\xpack-openocd-0.10.0-14-win32-x64\xpack-openocd-0.10.0-14\bin>openocd.exe Open On-Chip Debugger 0.10.0+dev-01032-gf9809950 (2020-01-21-17:32) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html embedded:startup.tcl:26: Error: Can't find openocd.cfg in procedure 'script' at file "embedded:startup.tcl", line 26 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Error: Debug Adapter has to be specified, see "interface" command embedded:startup.tcl:26: Error: in procedure 'script' at file "embedded:startup.tcl", line 26 The errors are normal because I did not attach any probe. But the point is: the OpenOCD build worked!!! As you can see, it prints: Open On-Chip Debugger 0.10.0+dev-01032-gf9809950 Is this really the latest bleeding-edge version? If anyone can confirm, I would be very happy :-) Many thanks to @Tommy Murphy and @Liviu Ionescu for all the help. Kind greetings, Kristof ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 18:11:25 Onderwerp: Re: Building OpenOCD xPack if you don't use the curl command then you need to do the two commands listed on the instructions page: $ rm -rf ~/Downloads/openocd-xpack.git $ git clone --recurse-submodules https://github.com/xpack-dev-tools/openocd-xpack.git \ ~/Downloads/openocd-xpack.git the other stuff is about using the develop branch but I have never used it and maybe it's not up to date or something? I suspect that that's more for Liviu when HE'S maintaining the scripts as opposed to an "end user" like you or me who should stick with master? ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 17:09 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Hi @Tommy Murphy, I did not issue the command: $ curl -L https://github.com/xpack-dev-tools/openocd-xpack/raw/xpack/scripts/git-clone.sh | bash But I issued the following commands instead: $ rm -rf ~/Downloads/openocd-xpack.git $ git clone --recurse-submodules --branch xpack-develop https://github.com/xpack-dev-tools/openocd-xpack.git \ ~/Downloads/openocd-xpack.git Note the flag --branch xpack-develop in the command. The guide from Liviu shows one example with and one without this flag. I'm not sure if this flag has anything to do with the problem? ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 18:01:43 Onderwerp: Re: Building OpenOCD xPack > The folder ~/Downloads/openocd-xpack.git/scripts does not contain a file > defs-source.sh: Are you sure that you did this to retrieve them? https://github.com/xpack-dev-tools/openocd-xpack/blob/xpack/README-BUILD.md $ curl -L https://github.com/xpack-dev-tools/openocd-xpack/raw/xpack/scripts/git-clone.sh | bash Definitely that file should exist - see the build scripts repo: https://github.com/xpack-dev-tools/openocd-xpack/tree/xpack/scripts Just to clarify - by adding the following to .../scripts/defs-source.h at the end of the file you can build from the upstream//master repo: OPENOCD_GIT_URL=git://git.code.sf.net/p/openocd/code OPENOCD_GIT_BRANCH=master OPENOCD_GIT_COMMIT=HEAD Liviu - yes, HEAD instead of a commit id works fine. 🙂 ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 16:53 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Hi @Tommy Murphy, The folder ~/Downloads/openocd-xpack.git/scripts does not contain a file defs-source.sh: $ cd ~/Downloads/openocd-xpack.git/scripts $ ls --all . .. helper $ cd helper $ ls --all . .. common-functions-source.sh container-functions-source.sh .git host-functions-source.sh LICENSE README.md templates.sh So I don't know how to proceed... ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 17:44:16 Onderwerp: Re: Building OpenOCD xPack Sorry - obviously change the URL, beanch and/or commit as necessary. I just used the latest mirror repo, master branch and latest commit in this example. At the moment you MUST provide ALL of these - e.g. you cannot omit the commit expecting the script to default to the latest. ________________________________ From: Tommy Murphy <tommy_mur...@hotmail.com> Sent: Tuesday 21 January 2020 16:42 To: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Cc: openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack FWIW this worked for me to use Liviu's xPack Project OpenOCD build scripts to build from the upstream master repo instead of Liviu's repos/snapshots... Edit your local copy of ~/Downloads/openocd-xpack.git/scripts/defs-source.sh https://github.com/xpack-dev-tools/openocd-xpack/blob/xpack/scripts/defs-source.sh#L41 and add the following at the end of the file: OPENOCD_GIT_URL=git://git.code.sf.net/p/openocd/code OPENOCD_GIT_BRANCH=master OPENOCD_GIT_COMMIT=f98099507f509db9a18c70365490a6b9f67108db and then build as normal: bash ~/Downloads/openocd-xpack.git/scripts/build.sh --all (or instead of --all any combination of --linux32, --linux64, --win32, --win64 etc.). ________________________________ From: Tommy Murphy <tommy_mur...@hotmail.com> Sent: Tuesday 21 January 2020 16:06 To: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Cc: openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: [OpenOCD-devel] Building OpenOCD xPack As I said I would not try to merge Liviu's repo with upstream just yet. In any case the scripts will try to pull his stuff anew anyway while building. It won't use anything local. Did you pipeclean the standard xPack build process as I asked? ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 16:04 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Hi @Tommy Murphy and @Liviu Ionescu, I've tried some more things to get the merge done. Here is what I tried: # Navigate to the git repo # ------------------------ $ cd ~/Downloads/openocd-xpack.git # Checkout the master # ------------------- $ git checkout master warning: unable to rmdir 'scripts/helper': Directory not empty Branch 'master' set up to track remote branch 'master' from 'origin'. Switched to a new branch 'master' # Make sure Git knows the upstream remote repo # -------------------------------------------- $ git remote add upstream git://git.code.sf.net/p/openocd/code # View the Git remote repos info # ------------------------------ $ git remote -v origin https://github.com/xpack-dev-tools/openocd-xpack.git (fetch) origin https://github.com/xpack-dev-tools/openocd-xpack.git (push) upstream git://git.code.sf.net/p/openocd/code (fetch) upstream git://git.code.sf.net/p/openocd/code (push) # Fetch the upstream repo # ----------------------- $ git fetch upstream warning: no common commits remote: Enumerating objects: 62390, done. remote: Counting objects: 100% (62390/62390), done. remote: Compressing objects: 100% (26325/26325), done. remote: Total 62390 (delta 51266), reused 43580 (delta 35902) Receiving objects: 100% (62390/62390), 14.18 MiB | 4.84 MiB/s, done. Resolving deltas: 100% (51266/51266), done. From git://git.code.sf.net/p/openocd/code * [new branch] master -> upstream/master * [new branch] v0.6.1 -> upstream/v0.6.1 * [new tag] v0.6.1 -> v0.6.1 [...] # Checkout the upstream master # ---------------------------- $ git checkout upstream/master Note: checking out 'upstream/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at f9809950 mips_ejtag: there is no DCR.MIPS64 bit # Checkout the local master again # ------------------------------- $ git checkout master Previous HEAD position was f9809950 mips_ejtag: there is no DCR.MIPS64 bit Switched to branch 'master' Your branch is up to date with 'origin/master'. # Try to merge # ------------ $ git merge upstream/master fatal: refusing to merge unrelated histories What am I doing wrong? Kind greetings, Kristof ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "Liviu Ionescu" <i...@livius.net>, "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 16:43:05 Onderwerp: Re: Building OpenOCD xPack Did you first pipeclean the standard xPack build process by just running the script that pulls the build scripts and then running, say, bash ~/Downloads/xpack-openocd-build/scripts/build.sh --win64 Just to make sure that that works? I was going to separately try to configure the scripts to build from upstream by configuring some or all of the following env vars: OPENOCD_GIT_URL OPENOCD_GIT_BRANCH OPENOCD_GIT_COMMIT I just didn't get a chance to try this yet but should be able to in the next hour or so. I don't think that trying to merge Liviu's openocd forked repo with the master/upstream repo is going to work (easily). But I've never tried it. ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 15:39 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack My apologies to bother you guys again, But I got stuck once more. I successfully completed the prerequisites (see https://xpack.github.io/xbb/prerequisites/) so I can start updating the git repos (see "How to build distributions" in the guide at https://github.com/xpack-dev-tools/openocd-xpack/blob/xpack/README-BUILD.md): $ cd ~/Downloads/openocd-xpack.git $ git checkout master warning: unable to rmdir 'scripts/helper': Directory not empty Branch 'master' set up to track remote branch 'master' from 'origin'. Switched to a new branch 'master' $ git remote add upstream git://git.code.sf.net/p/openocd/code $ git remote -v origin https://github.com/xpack-dev-tools/openocd-xpack.git (fetch) origin https://github.com/xpack-dev-tools/openocd-xpack.git (push) upstream git://git.code.sf.net/p/openocd/code (fetch) upstream git://git.code.sf.net/p/openocd/code (push) $ git merge upstream/master merge: upstream/master - not something we can merge For some reason, the merging fails. But I have no clue why exactly. Kind greetings, Kristof Mulier ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "Liviu Ionescu" <i...@livius.net>, "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 16:14:23 Onderwerp: Re: Building OpenOCD xPack No problem Kristof. All the kudos goes to Liviu though for developing the scripts. I just use them! 🙂 ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 15:10 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Thank you @Tommy Murphy. I thought it would be this way, but I'm happy to get it confirmed. Basically I'm a hardware guy (PCB design, ...) who's also getting involved into software design in the past few years. I'm very thankful to people like you (@Tommy Murphy) and @Liviu Ionescu, for helping me out :-) Kind greetings. ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "Liviu Ionescu" <i...@livius.net>, "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 16:01:18 Onderwerp: Re: Building OpenOCD xPack Great - another thing to note in case it was not clear - even when running on, say, Ubuntu 19.10 the xPack stuff builds under an older Linux (CentOS 6 I think) docker image with a newer than default compiler resulting in Linux executables that run on a wider set of distros/versions than if built natively. A bit like the Holy Build Box approach mentioned earlier (https://github.com/phusion/holy-build-box). This is another clear benefit of building using the xPack scripts. ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 14:58 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Thank you @Tommy Murphy! I will proceed with the workaround you proposed :D ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "Liviu Ionescu" <i...@livius.net>, "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Dinsdag 21 januari 2020 15:50:24 Onderwerp: Re: Building OpenOCD xPack That issue is unfortunate but is ultimately a problem at the docker repo end. The workaround here worked for me to get docker installed: https://github.com/docker/for-linux/issues/833#issuecomment-544236041 However when adding the user to the docker group I always found that I had to reboot rather than just logout and login again: https://xpack.github.io/xbb/prerequisites/#configure-docker-to-run-as-a-regular-user Once all that's done and then I install git the build proceeds fine on 19.10 as per the following instructions: https://github.com/xpack-dev-tools/openocd-xpack/blob/xpack/README-BUILD.md Hope this helps. Cheers Tommy ________________________________ From: Tommy Murphy <tommy_mur...@hotmail.com> Sent: Tuesday 21 January 2020 14:24 To: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack I tried Ubuntu 19.10 and get the same error as Kristof. Looks like a problem with the docker repos: https://github.com/docker/for-linux/issues/833 There's a workaround in that issue. I generally try to stick to LTS versions for production work. Hope this helps Cheers Tommy ________________________________ From: Tommy Murphy <tommy_mur...@hotmail.com> Sent: Tuesday 21 January 2020 12:54 To: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: Building OpenOCD xPack Hi Kristof I just followed the prerequisites installation instructions to install docker on a clean Ubuntu 18 virtual machine and it all worked fine for me. See attached. Cheers Tommy ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Tuesday 21 January 2020 11:56 To: Tommy Murphy <tommy_mur...@hotmail.com> Cc: Liviu Ionescu <i...@livius.net>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Building OpenOCD xPack Hi @Liviu, Hi @Tommy, I'm following the guide(s) on the xPack website. However, I got stuck when executing the fourth command on the Prerequisites page (see https://xpack.github.io/xbb/prerequisites/): $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" This is the output I get: Hit:1 http://be.archive.ubuntu.com/ubuntu eoan InRelease Hit:2 http://be.archive.ubuntu.com/ubuntu eoan-updates InRelease Hit:3 http://be.archive.ubuntu.com/ubuntu eoan-backports InRelease Get:4 http://security.ubuntu.com/ubuntu eoan-security InRelease [97,5 kB] Ign:5 https://download.docker.com/linux/ubuntu eoan InRelease Err:6 https://download.docker.com/linux/ubuntu eoan Release 404 Not Found [IP: 13.225.38.15 443] Reading package lists... Done E: The repository 'https://download.docker.com/linux/ubuntu eoan Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. What should I do? --------------- By the way, I note down every single step of my journey to get OpenOCD compiled on this page: https://forum.embeetle.com/t/building-openocd/137 this way - if the OpenOCD xPack build succeeds - I've got a trace back. --------------- Kind greetings, Kristof Mulier ________________________________ Van: "Tommy Murphy" <tommy_mur...@hotmail.com> Aan: "kristof mulier" <kristof.mul...@telenet.be>, "Liviu Ionescu" <i...@livius.net> Cc: "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Maandag 20 januari 2020 21:33:33 Onderwerp: Re: [OpenOCD-devel] Compliance with OpenOCD license The instructions definitely work on Ubuntu. I've been using Ubuntu 18 lately. Other distros probably work as well. Don't forget to read the "prerequisite" instructions for installing docker. Once that's done it should be trivial to pull and run the build process. As I mentioned earlier if you want to build from the upstream master openocd repo rather than Liviu's snapshots then you may need to pass additional options to build.sh or maybe edit even edit the scripts. I can't remember offhand but I could check later if necessary. Best to pipeclean the build process as is first before changing anything in any case. ________________________________ From: kristof.mul...@telenet.be <kristof.mul...@telenet.be> Sent: Monday, January 20, 2020 7:58:25 PM To: Liviu Ionescu <i...@livius.net> Cc: Tommy Murphy <tommy_mur...@hotmail.com>; openocd-devel <openocd-devel@lists.sourceforge.net> Subject: Re: [OpenOCD-devel] Compliance with OpenOCD license Hi @Liviu Ionescu, > The scripts have lots of configuration environment > variables, if you want to build a more recent version, > you need to tweak them. > [..] Uh oh... I have not even the foggiest idea how to "tweak" your build scripts. To be honest, I was hoping to simply run the build script and watch the OpenOCD Windows binaries showing up magically :-) Unfortunately it doesn't seem to be that simple. > However please note that the scripts are not specific > for generating production binaries, which have certain > requirements, and are less suitable for experimenting > with builds. When I'm "experimenting with a build" this is what I do: I connect the microcontroller and the probe. Then I start OpenOCD and feed it with the right config files. If OpenOCD connects to the chip and is able to flash a firmware, I consider the experiment to be successful. So for this kind of "experiments", a "production binary" is perfectly fine. I don't need a "debug binary". Many thanks for your help :-) ----- Oorspronkelijk bericht ----- Van: "Liviu Ionescu" <i...@livius.net> Aan: "kristof mulier" <kristof.mul...@telenet.be> Cc: "Tommy Murphy" <tommy_mur...@hotmail.com>, "openocd-devel" <openocd-devel@lists.sourceforge.net> Verzonden: Maandag 20 januari 2020 20:46:23 Onderwerp: Re: [OpenOCD-devel] Compliance with OpenOCD license > On 20 Jan 2020, at 21:36, kristof.mul...@telenet.be wrote: > > ... I conclude this particular OpenOCD executable was built last summer. That's correct. Since OpenOCD has no release schedule, I have no idea when to make xPack releases. > .. I suppose your > instructions to build the OpenOCD xPack will run smoothly in Ubuntu? Yes. The scripts have lots of configuration environment variables, if you want to build a more recent version, you need to tweak them. There is also a script to build native binaries, intended for debug sessions, but I'm not sure you can generate Windows binaries. However please note that the scripts are not specific for generating production binaries, which have certain requirements, and are less suitable for experimenting with builds. After playing with the scripts you'll probably prefer to use the already made binaries. FYI, I plan for a new release shortly. Regards, Liviu
_______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel