Wednesday, 2019-10-02

*** tpb has joined #tomu00:00
*** lathiat has quit IRC00:37
*** lathiat has joined #tomu00:38
mithroxobs: do you want me to show you how to set up a python environment so that you don't keep foorbaring yourself?01:36
xobsmithro: I also see bunnie experiencing the same issues.01:37
mithroBecause he learnt how to set it up from you it seems01:38
mithroBasically, if you are using the system Python environment you are going to have a bad time01:39
mithroHave you ever used npm or rvm?01:40
xobsAnd when you do a "pip" install, where does it go and how do you keep that under version control?  With lxbuildenv, the dependencies are all under `deps/`, and I just need to add my remote to it.01:43
auscompgeekyou would version control a requirements.txt, similarly to how people would version control a package.json and never a node_modules01:48
auscompgeekyou can generate a requirements.txt with pinned versions with pip freeze. people sometimes store that in version control as requirements-lock.txt or similar01:49
xobsauscompgeek: hmm... and that works offline? I could just give that to someone and they could use it?01:50
auscompgeekit wouldn't work offline, no, similar to how you can't `npm install` offline01:50
mithroxobs: So you want one "Python install" per project -- you shouldn't share Python installs between projects01:51
mithroxobs: This is mostly true even for multiple checkouts of the same project01:52
mithroxobs: There are many ways to get a "separate install per project" -- nobody agrees on the best way01:53
xobsmithro: Which one lets me do something like we have now, where I can give someone a USB drive and they can start working right away?01:54
xobsWithout having an Internet connection.01:54
auscompgeeknothing does01:55
auscompgeekthere is no way to have a "portable" python environment currently01:56
mithroxobs: The closest is probably how litex-buildenv sets up conda...01:56
auscompgeekalthough there is
tpbTitle: PEP 582 -- Python local packages directory | (at
xobsauscompgeek: wow, that does seem perfect.01:58
auscompgeekother than the fact that it's not a thing yet yes01:59
mithroxobs: It is unclear to me the status of that thing...01:59
xobsmithro: One of the things I don't like about conda is that it seems to require you use its terminal window, which is based on cmd.exe and doesn't have things like non-square text selection.02:03
mithroxobs: Why do you think that?02:04
xobsmithro: Because when it installed itself, that's the only icon that it created.  And it didn't give any other information about how to use it.02:04
mithroxobs: That starts a terminal with the path set up correctly so conda is in it02:08
mithroIt looks like what that Anaconda Prompt does is02:10
mithro%windir%\System32\cmd.exe "/K" C:\Users\MY_USERNAME\Documents\ProgramFilesForSoftwareHatingSpaces\Continuum\miniconda3\Scripts\activate.bat C:\Users\MY_USERNAME\Documents\ProgramFilesForSoftwareHatingSpaces\Continuum\miniconda302:10
mithroApparently there is "conda-pack" @
tpbTitle: Conda-Pack conda-pack 0.3.0+8.g52daedd documentation (at
xobsmithro: that script does a lot of stuff, including setting the codepage if necessary. That seems like a good idea.02:13
mithroWhich script?02:13
xobsBut it's nice to know that "Anaconda Prompt" is just running cmd.exe with a given batch script.02:13
xobsactivate.bat, which calls conda.bat02:13
mithroTo "enter an isolated Python environment" almost all tools require you to "activate" it by sourcing a script of some type02:14
mithroit's almost always called something like "activate"02:14
xobsI guess that's kind of what I've been doing with lxbuildenv, except it automatically enters its own environment, and makes minimal assumptions about the base system.02:16
mithroxobs: See these lines?
tpbTitle: sphinxcontrib-verilog-diagrams/Makefile at master · SymbiFlow/sphinxcontrib-verilog-diagrams · GitHub (at
*** CarlFK has quit IRC02:17
xobsmithro: hmm... so what would the offline workshop install process look like using pip and virtualenv?02:18
mithroxobs: It is unlikely you can make such a thing happen02:19
xobsAnd how do you work on packages that get installed?02:20
xobsFor example, if I "pip install" litex, then I want to go and modify litex, how do I do that?02:20
mithroxobs: Basically virtualenv tried to add relocatable environments but it was a failure02:20
tpbTitle: User Guide virtualenv 16.7.5 documentation (at
mithroWARNING: The --relocatable option currently has a number of issues, and is not guaranteed to work in all circumstances. It is possible that the option will be deprecated in a future version of virtualenv.02:21
*** CarlFK has joined #tomu02:21
xobsHmm... virtualenv also makes it seem like I can't work in both Windows and Linux land at the same time.02:22
mithroxobs: You want to install the library in "development mode" or "editable" mode02:23
mithroxobs: What do you mean by can't work in both Windows and Linux land at the same time?02:23
xobsmithro: with lxbuildenv, I can run e.g. "python" from Windows, or "python3" from a Linux prompt and it works fine in both environments with the same dependencies.  With virtualenv, they would have their own virtualenv environments.02:24
xobsSo if I made a change to litex_boards in one, that change wouldn't get reflected in the other unless I did a push/pull/reinstall.  Or is that not the case?02:25
mithroxobs: "development mode" or "editable" mode is what you want02:27
mithropython develop || pip install -e path/to/SomeProject02:28
mithroxobs: See
tpbTitle: litex-buildenv/ at f2c790cc36d73781c63d7c89900281074608181c · timvideos/litex-buildenv · GitHub (at
mithro`pip install path/to/SomeProject` ~= `cd path/to/SomeProject; python install` -- except that pip will also get all the declared dependencies for SomeProject...02:30
mithro"editable" / "development mode" == install the files in a way that I can keep editing them in their original location02:32
mithroxobs: Which is why we use `python develop` for all the submodules in `third_party/xxxx`02:32
xobsThat's really good to know that exists.  In the past I've done "pip install" and then "git init" of the install directory under /usr/share which didn't seem like the right way to do it.02:34
mithroxobs: `python install` and `python develop` don't install dependencies -- `pip` does02:43
*** andi- has quit IRC02:44
xobsmithro: conda-pack looks like it might address the issues I'm having with pip/virtualenv/venv, and the latest version fixed powershell support.  Let me see how it works with "develop" mode.02:46
mithroxobs: You can think of conda verse virtualenv as `python packages + python binary packages + other binaries` verse `python packages`-- although that has changed a bit with the existence of binary wheels02:46
mithroxobs: conda was started back when virtualenv was really only working for pure-python packages02:47
*** andi- has joined #tomu02:51
xobsConda seems to have broken things very badly :(02:55
mithroxobs: In what way?02:55
xobsNow every terminal window I open looks like it's a Conda environment.02:55
xobsAll of my prompts now have "base" added to them.02:56
mithroxobs: How did you install conda?02:57
xobsI wanted to initialize a new conda directory, so I did "conda init" in a new directory (similar to how one does a "git init", I suppose?).  But that seems to have caused it to take over everything.02:57
xobsmithro: I went to and clicked the big "Python 3.7 version" download button.02:57
mithroxobs: It looks like `conda init`installs conda into your bash/shell/etc environment permanently...02:58
mithroI have never used conda init before02:59
xobsWhat's the conda equivalent to "git init" / "cargo init" / "npm init"?03:00
xobsAnd more importantly, how do I undo what it's done?03:00
mithroWow - `conda init` is exactly how you **shouldn't** use conda...03:01
mithroxobs: Looks like there is a `conda init --reverse` and a `conda init --dry-run --verbose`03:02
xobsThat does look like it's removed it from the default prompt.  Phew.03:04
mithroxobs: `conda create --name myenv`03:05
mithro`conda create --prefix ./envs jupyterlab=0.35 matplotlib=3.1 numpy=1.16`03:05
mithro`conda activate ./envs`03:05
mithroxobs: There isn't really an equivalent of `npm init` or `cargo init` from what I can see of those commands...03:06
xobsConda really wants me to run "conda init".03:10
mithroxobs: Oh?03:10
tpbTitle: conda activate. · GitHub (at
xobsIt works if I use the terrible cmd.exe window, and it works if I let it take over my system using "conda init".  But it looks like Conda only works if it's the only thing installed.03:12
mithroxobs: This seems to be something about windows setup03:13
mithroxobs: Try `conda config --set auto_activate_base false`03:14
mithroThis `conda init` crap seems to be a huge step backwards for conda...03:15
xobsWhat should I do after `conda config`?03:17
mithroxobs: Close and open the terminal?03:17
xobsNo change.03:18
mithroxobs: Conda still seems to have taken over your terminal?03:22
xobsOkay, so instead of providing "activate.ps1" on Windows, they provide the intuitively-named "shell/condabin/conda-hook.ps1" that needs to be run in order to get conda to work.03:22
xobsIf I run conda-hook.ps1 then conda starts to work.03:23
mithroxobs: activate is entering a specific environment03:23
mithroxobs: It seems like the conda-hook is about setting up conda so you can activate an environment?03:24
xobsmithro: but if I run Anaconda3\scripts\activate.bat then I can use conda.  It looks like it's activating conda itself?03:24
mithroxobs: As you are calling activate with no environment, it is probably activating conda's "default" environment03:25
xobsAnd I can run anaconda3\scripts\conda.exe but it doesn't work very well.03:25
mithroI'm still confused about what you are doing03:28
mithroYou start a new terminal03:28
xobsThe goal is to be able to use conda from a fresh terminal.03:29
xobsSo I open a terminal (ConEmu, Terminal Preview, etc.).  How do I use conda?03:29
xobsI can run `D:\Software\Anaconda3\Scripts\conda.exe` and get access to conda.  Well, it kind if works.  It blows up if I actually try to do anything.03:30
xobsIf I run `cmd.exe` then I can run `D:\Software\Anaconda3\Scripts\activate.bat` and gain access to conda.  I can create environments and things like that.03:30
xobsIf I want to use powershell, however, I first need to run `D:\Software\Anaconda3\shell\condabin\conda-hook.ps1`.  Then I'll be able to run `conda.exe`.  No need to run activate first.03:31
mithroWhat else is in `D:\Software\Anaconda3\shell\condabin\`03:32
xobsJust conda.psm1:
tpbTitle: conda/Conda.psm1 at 95e80f1487f3cc72bd57137af09377290fa2db64 · conda/conda · GitHub (at
mithroShould I add Anaconda to the Windows PATH? - When installing Anaconda, we recommend that you do not add Anaconda to the Windows PATH because this can interfere with other software. Instead, open Anaconda with the Start Menu and select Anaconda Prompt, or use Anaconda Navigator (Start Menu - Anaconda Navigator).03:34
xobsRight, I didn't add it to the PATH.  My goal was to use anaconda with something other than cmd.exe.  It worked in cmd.exe, which is how I was able to run "conda init".  The trick was getting it to work with a terminal other than cmd.exe.03:37
mithroxobs: So, you installed anaconda and it doesn't take over all your cmd.exe?03:39
xobsYes, I have conda installed now, and it hasn't taken over my system.  Hooray!03:40
mithroxobs: So do you need the `conda config --set auto_activate_base false` to fix it?03:40
xobsI don't think so.  I just need to run `conda-hook.ps1` first.03:40
xobsThough now I need to figure out how to get visual studio code to work with this environment.03:41
tpbTitle: Getting started with Anaconda Anaconda 2.0 documentation (at
tpbTitle: Python for Visual Studio Code Anaconda 2.0 documentation (at
xobsVisual Studio Code detected the conda environment nicely.  Hooray!03:51
xobsNow let's see if conda-pack works as advertised.  If it does, that would actually solve the packaging problem I have on Linux.03:54
tpbTitle: Windows Instructions for Conda · GitHub (at
mithroxobs: Why are you talking about Linux now?03:54
mithroxobs: This is a separate thing to the windows issue you where trying to solve?03:54
xobsmithro: If the goal is to replace `lxbuildenv` with something else, I'll need a way to get it working on other platforms.  The `fomu-toolchain` distributes a version of Python on Mac and Windows in order to make it easy for people to get started.03:55
xobsThe documentation for `conda pack` seems to indicate that it creates a similar, portable directory structure.  So that would be a nice way to package everything up.  And it would be a good excuse to merge the fomu toolchain stuff with conda.03:56
mithroxobs: Okay, your currently looking at `conda pack` for getting offline setup?03:59
mithroxobs: I'm pretty sure we have distributed litex-buildenv on USB keys04:00
xobsmithro: yes, and for creating single-file distributions.  Conda does seem to be installed now -- the big thing that was missing was the need to run `conda-hook.ps1` in a terminal before using `conda.exe`04:00
mithroxobs: For powershell?04:00
xobsYes.  Or running `activate.bat` from cmd.exe.04:01
*** rohitksingh has quit IRC04:02
mithroxobs: You can create a conda installer from an environment...04:03
xobsThough `conda pack` has created a broken tar file.04:09
xobsHuh.  The default conda environment includes libicu and qt.  That would explain why it's so huge.  Let me remove those.  Maybe it's hitting a 2GB barrier somewhere...04:11
mithroxobs: I assume you actually installed anaconda rather than miniconda04:14
xobsmithro: I went to and clicked Download, which took me to -- is that not the right one?04:15
mithroxobs: If you want the full anaconda which is conda+scientific packages04:17
mithroxobs: you probably wanted miniconda -
xobsOh.  Alright, let me uninstall conda and install that instead.04:18
xobsFun fact: Anaconda doesn't have an uninstaller.04:22
xobsMiniconda has one, Python 3.7 has one, but Anaconda doesn't have one.04:24
*** pepijndevos has quit IRC04:37
tpbTitle: Uninstalling Anaconda Anaconda 2.0 documentation (at
mithroTo uninstall Anaconda, you can do a simple remove of the program. This will leave a few files behind, which for most users is just fine. See Option A.04:37
mithroHoly crap...04:37
xobsYeah, I just removed the directory, since the uninstaller doesn't exist.04:38
*** feuerrot has quit IRC04:38
*** deltab has quit IRC04:38
*** eightdot has quit IRC04:38
xobsSo with miniconda, I can't just run `conda-hook.ps1`.04:40
*** feuerrot has joined #tomu04:40
xobsIf I activate an environment with `conda activate condaenv`, then my prompt changes.04:40
mithroxobs: What happens?04:40
*** deltab has joined #tomu04:40
xobsHowever, if I try to install something it breaks.  E.g. `pip install migen`04:40
xobs`Fatal error in launcher: Unable to create process using '"c:\python27\python.exe"  "C:\Python27\Scripts\pip.exe" install migen'`04:40
mithroWhat what were the exact steps you did?04:41
xobsconda create -p condaenv04:41
xobsconda activate condaenv04:41
xobspip install migen04:41
mithroxobs: Before that -- how did you install miniconda?04:41
xobsminiconda3 works if I use the cmd.exe version and run activate.bat like before.04:42
xobs(being forced to use cmd.exe on Windows is similar to being forced to use xterm on Linux)04:43
xobsAnyway.  I'll use their Anaconda shell, instead of using Windows Terminal Preview.04:43
mithroThat isn't telling me how you installed miniconda....04:43
*** pepijndevos has joined #tomu04:44
xobsI downloaded it from and ran the installer.  I installed it for all users, and placed it into D:\Software\miniconda304:44
*** eightdot has joined #tomu04:45
mithroxobs: When you installed, what settings did you use?04:51
xobsI used the defaults.  I didn't add it to PATH, nor did I register it as the system python.04:52
*** rohitksingh has joined #tomu04:54
mithroxobs: Okay, can you open the anaconda terminal and do a `conda init`and see what it says?04:55
mithroUsing pip wheel, you can bundle up all of a project’s dependencies, with any compilation done, into a single archive. This allows installation when index servers are unavailable and avoids time-consuming recompilation.04:57
xobsThat does seem to fix it so that I can now run "conda activate" from another terminal.04:57
mithroxobs: You might need to do `conda config --set auto_activate_base false`on a new windows05:01
xobsOh, so that's what that does.  Okay, that makes sense.05:02
mithroxobs: See the "General Conda Process" in the doc at
tpbTitle: conda notes - Google Docs (at
xobsI wonder why they don't provide `activate.ps1`.  It looks like what you have to do in miniconda is run `conda-hook.ps1; conda activate base`, which lets you use any terminal again, even without doing "conda init";05:11
mithroSee what I just pasted...05:15
xobsmithro: yes, and you can avoid running "conda init" entirely by first running "conda-hook.ps1" followed by "conda activate"05:17
xobsThat saves you from having to set the configuration flag, or modifying the environment at all.05:18
mithroxobs: But not luck with conda-pack?05:21
xobsmithro: not yet. conda-pack seems promising, and almost works. It definitely doesn't work quite as advertised, though.05:24
xobsIt looks like you still need to have conda installed on your system.05:24
mithroI think the conda constructor might be a better approach?05:24
xobsProbably! I'll take a look at that.05:26
xobsThis is a very complicated system and I'm still trying to figure out how I'm going to package it up.05:27
mithroxobs: What is a complicated system?05:28
xobsmithro: python packaging. Conda. Pip. Activating virtual environments. Making it not take over the system.05:30
xobsI'm wondering how it'll work now.05:31
xobsWill the installer create a directory that a user would run "activate" on, and then do the various activities in the workshop?05:31
*** futarisIRCcloud has quit IRC05:44
mithroxobs: Yes05:55
xobsOkay, perhaps `conda pack` will do what I'm looking for.  Or the installer you mentioned.  I'll take a closer look.05:56
mithroxobs: The important thing about conda is that it can include *both* the Python + extra binaries like yosys and co06:14
*** CarlFK has quit IRC06:38
*** CarlFK has joined #tomu07:44
*** kamil_r has joined #tomu09:09
xobsmithro: that's a concern I have. Will that force me to have one version of all the packages for all the different litex/migen projects on my system?  Or will it force me to have one copy of conda for each project?09:13
xobsHmm... it seems like conda allows you to nest exactly one environment, which is probably sufficient:
tpbTitle: Consider leaving root env on PATH with activate · Issue #2502 · conda/conda · GitHub (at
*** rohitksingh has quit IRC09:33
*** foosinn[m] has quit IRC11:07
*** AmosSam_ has quit IRC11:07
*** alexhw[m] has quit IRC11:07
*** ptotter[m] has quit IRC11:07
*** nrossi has quit IRC11:07
*** xobs has quit IRC11:07
*** manf[m] has quit IRC11:07
*** jimt[m] has quit IRC11:07
*** EmilKarlson has quit IRC11:07
*** kwauchope[m] has quit IRC11:07
*** shalzz has quit IRC11:07
*** synaption[m] has quit IRC11:07
*** alexhw[m] has joined #tomu11:17
*** shalzz has joined #tomu11:28
*** foosinn[m] has joined #tomu11:28
*** xobs has joined #tomu11:28
*** EmilKarlson has joined #tomu11:28
*** ptotter[m] has joined #tomu11:28
*** jimt[m] has joined #tomu11:28
*** manf[m] has joined #tomu11:28
*** nrossi has joined #tomu11:28
*** AmosSam_ has joined #tomu11:28
*** synaption[m] has joined #tomu11:28
*** kwauchope[m] has joined #tomu11:28
*** ademski has quit IRC12:25
*** xkapastel has joined #tomu12:38
*** alexhw has quit IRC13:28
*** alexhw_ has joined #tomu13:28
*** alexhw_ has quit IRC13:29
*** alexhw has joined #tomu13:29
*** chrissi^ has quit IRC13:35
*** ademski has joined #tomu13:39
*** emeb has joined #tomu13:47
*** chrissi^ has joined #tomu14:13
*** chrissi^ has quit IRC14:16
*** chrissi^ has joined #tomu14:18
synaption[m]I'm wondering if there has been any effort to port foboot over to any other boards.  Fomu is great and all,  but I'd love to play with some more io15:23
tntsynaption[m]: I have a DFU bootloader for the icebreaker-bitsy board and also for the upduino v1.   The fullsize icebreaker and upduino v2 don't need bootloader since they have ftdi on-board for programming.15:33
*** cedric has quit IRC16:44
pepijndevosxobs, mithro said on twitter you might know what's up with fomu crashing my keyboard and mouse via an usb hub?17:15
xobspepijndevos: What's probably happening is your hub has only one Transaction Translator for all FS/LS ports.  So the keyboard and mouse are effectively connected directly to Fomu.17:18
xobsIn the v1.8.7 release of Fomu, it ignored the `SET_ADDRESS` command and always responded to all packets it saw.  This behavior is incorrect when there is only one TT.17:19
pepijndevosWhat??? I have no idea how USB hubs work.17:19
xobsAs a workaround, you can try putting another hub in front of Fomu.  That might at least let you use it.17:19
xobsThen you can install Foboot v1.9.1.17:19
xobsIs this a production unit or a hacker board?17:20
pepijndevoshacker board17:21
pepijndevosHow do I install Foboot?17:21
xobsIf you have an external USB hub, try plugging Fomu into that before plugging it into your PC.  If that works and you can see Fomu with `dfu-util -l`, then you can update Foboot.17:22
pepijndevosI can free up one USB port directly on the laptop temporarily17:23
pepijndevosThat worked before17:23
xobsOkay.  Then download the Foboot v1.9.1 installer from
xobsFinally, install it with `dfu-util -D hacker-top-installable.dfu`17:24
xobsIt'll pause for about 10 seconds, then go all rainbow while it updates.  Afterwards, running `dfu-util -l` should show "Foboot Bootloader v1.9.1 running on Hacker Board"17:25
pepijndevosxobs, success rate of 50% it seems...17:33
pepijndevosOne of the two now gives a rainbow LED but is no longer found by dfu-util, the other does a green blinky and is listed as DFU bootloader 1.9.117:33
xobsThe "rainbow led" was the updater running.  It's now finished updating, and should work properly.17:34
pepijndevosohhh okay, all good.17:36
pepijndevosSo it loads into "user space" and then overwrites the bootloader?17:36
pepijndevosUhm... should I have been more carefull not to unplug it in the middle of things?17:37
xobsYeah.  It works very hard to make it so that even if you unplug it during an update, it will resume the update next time you plug it in.17:37
pepijndevosWell, I can confirm this works very well. I unplugged it like a dozen times alternating between the two and runing dfu-util -l17:38
xobsYay!  I'm glad that solves the issue.17:39
pepijndevosYea, working fine from the hub now17:39
pepijndevosLet's see if I can run the Micropython thing and play with the buttons and leds.17:41
pepijndevosSo there are two buttons on this thing, correct? Can I use those from the python shell? (or custom RISC-V or HDL code)17:47
xobsThere are four touchpads.  You can probably do something where you set two as outputs and two as inputs, and do a kind of "resistive touch".17:48
pepijndevosok thanks for the help17:52
xobsHappy to help!  Glad it's working better for you now.17:53
nurelinHello, is there a simple way to upload a modified foboot hw + a custom sw on a pvt fomu ?18:06
nurelinor shall I flash the hw and then use the DFU to upload the custom sofware ?18:09
*** rohitksingh has joined #tomu18:38
*** xkapastel has quit IRC18:48
*** xkapastel has joined #tomu18:54
*** rohitksingh has quit IRC19:30
*** rohitksingh has joined #tomu20:00
*** rohitksingh has quit IRC21:06
*** ademski has quit IRC21:13
*** rohitksingh has joined #tomu21:34
*** luis79 has joined #tomu22:15
*** luis79 is now known as luis8322:16
*** luis83 is now known as riskyfive22:16
riskyfiveHi. I have a fomu hacker edition with bootloader v1.7.3-1-g82cb20c. How can I upgrade the bootloader?22:16
*** im-tomu has left #tomu22:27
*** im-tomu has joined #tomu22:27
*** im-tomu has left #tomu22:28
*** im-tomu has joined #tomu22:28
*** kamil_r has quit IRC22:53
*** xkapastel has quit IRC22:58
*** CarlFK has quit IRC23:31
*** emeb has quit IRC23:47

Generated by 2.13.1 by Marius Gedminas - find it at!