Recent

Author Topic: Problems installing development environment for RP2040  (Read 1221 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Problems installing development environment for RP2040
« on: March 18, 2023, 08:24:39 am »
I'm currently investigating installing various RP2040 ("Pico") development tools in a Docker container on Linux, with a particular focus on having the PicoProbe work properly. Part of the incentive for this is that there appears to be a Trojan in VSCode which I'm trying to investigate, which provides a substantial incentive to never run this stuff on other than a sacrificial system.

When I last looked at the RP2040 target I was able to get FPC/Lazarus working, including single stepping etc. I can currently get the various demos working using CMake and VSCode, including debugging, so I'm happy that my Docker setup is OK.

However FPCUPdeluxe v2.2.0qp, running on x86_64 Linux (Debian "Bookworm") is giving me problems. Starting the program and going straight to the "Pico" button,  I get

Code: Text  [Select][+][-]
  1. Hmmm, something went wrong ... have a good look at the command screen !
  2. ...
  3. pcupdeluxe: ERROR: Lazarus Native Installer (GetModule: Lazarus): Could not get version of Lazarus sources. Expect severe errors.
  4. fpcupdeluxe: Executing: /usr/bin/git log -1 --pretty=format:%h (working dir: /home/markMLl/fpcupdeluxe/lazarus)
  5. fpcupdeluxe: Executing: /usr/bin/git describe --tags --long --always (working dir: /home/markMLl/fpcupdeluxe/lazarus)
  6. fpcupdeluxe: Executing: /usr/bin/git log -g -1 --pretty=oneline (working dir: /home/markMLl/fpcupdeluxe/lazarus)
  7. fpcupdeluxe: Executing: /usr/bin/git describe --tags --all --long --always (working dir: /home/markMLl/fpcupdeluxe/lazarus)
  8. fpcupdeluxe: info: Lazarus Native Installer (GetModule: Lazarus): Lazarus is at revision/hash: FRET_UNKNOWN_REVISION.
  9. fpcupdeluxe: info: Lazarus Native Installer (GetModule: Lazarus): No updates for Lazarus found.
  10. fpcupdeluxe: ERROR: Lazarus Native Installer (BuildModule: Lazbuild): /home/markMLl/fpcupdeluxe/lazarus/Makefile not found. Severe error. Should not happen. Aborting build Lazbuild.
  11.  
  12.  
  13. ERROR: Fpcupdeluxe fatal error !
  14. Sequencer (UserIDE): Failure running fpcupdeluxe: error executing sequence UserIDE
  15. Sequencer (Lazarus): Failure running fpcupdeluxe: error executing sequence Lazarus
  16. Sequencer (Default): Failure running fpcupdeluxe: error executing sequence Default
  17. ...
  18. fpcupdeluxe: info: Performing SVN/GIT/HG/FTP/URL checkout/download. Please wait, could take some time.
  19. fpcupdeluxe: Start of compile error summary.
  20. fpcupdeluxe: ERROR: Lazarus Native Installer (GetModule: Lazarus): Could not get version of Lazarus sources. Expect severe errors.
  21. fpcupdeluxe: info: Lazarus Native Installer (GetModule: Lazarus): Lazarus is at revision/hash: FRET_UNKNOWN_REVISION.
  22. fpcupdeluxe: info: Lazarus Native Installer (GetModule: Lazarus): No updates for Lazarus found.
  23. fpcupdeluxe: Start of compile error summary.
  24. fpcupdeluxe: ERROR: Lazarus Native Installer (BuildModule: Lazbuild): /home/markMLl/fpcupdeluxe/lazarus/Makefile not found. Severe error. Should not happen. Aborting build Lazbuild.
  25. fpcupdeluxe: Done !!
  26.  

Is there an obvious workaround?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Problems installing development environment for RP2040
« Reply #1 on: March 18, 2023, 08:49:54 am »
I just did a clean Pico install on Manjaro Linux. All ended without any error.
Your error indicates that the Lazarus sources did not get downloaded (cloned by GIT). There must be more in your log indicating a problem with GIT.

af0815

  • Hero Member
  • *****
  • Posts: 1288
Re: Problems installing development environment for RP2040
« Reply #2 on: March 18, 2023, 08:53:10 am »
It looks something goes wrong with the GIT. If you do the commands by yourself on the commandline, does it work or give some additional info? And does git status give you some information ?

regards
Andreas

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #3 on: March 18, 2023, 09:08:57 am »
Complete log attached. Git is certainly working well enough to handle all of the Pico SDK etc. from the same Docker session (i.e. absolutely no change to run parameters etc.).

I'm inclined to drop this and move on to the next target platform on my list, which is probably Eclipse for the RISCV.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Problems installing development environment for RP2040
« Reply #4 on: March 18, 2023, 09:14:51 am »
Problem is clear from your log. And was caused by a bad pre-release of fpcupdeluxe.
Please download the latest version from Github and you should be good to go.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0qp/fpcupdeluxe-x86_64-linux
If you succeed (please delete the Lazarus directory first, if any), I will release this pre-release as an official release.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #5 on: March 18, 2023, 09:28:31 am »
I'm on it. If- provided that- I can get it working I'll add some notes on using PicoProbe etc. with Docker to the wiki.

MarkMLl

Update: installation has apparently completed successfully. I hope to have some test results before the end of the morning GMT: I've done this before without Docker in the loop so should be able to rely on my notes and a script I wrote at the time to start OpenOCD.
« Last Edit: March 18, 2023, 09:54:27 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Problems installing development environment for RP2040
« Reply #6 on: March 18, 2023, 12:30:36 pm »
I have activated a sleeping feature of fpcupdeluxe.
You can now enable a scripting feature in Setup+. If enabled, a script will be generated that can be used with the command line version fpclazup. This script will do the same as fpcupdeluxe, but fully automated, without user input and command line only. Should be very suitable for docker use.
For Pico it generates 2 scripts.
Quote
fpclazup-i386-win32.exe --installdir=C:\fpcupsystems\pico --fpcURL=https://gitlab.com/michael-ring/freepascal-sources --lazURL=https://gitlab.com/freepascal.org/lazarus/lazarus --include=develtools4fpc --skip=HelpFPC,HelpLazarus --lazBranch=main --lazRevision=5b0ed449f3 --fpcsplit --noconfirm --autotools
And.
Quote
fpclazup-i386-win32.exe --installdir=C:\fpcupsystems\pico --cputarget=arm --ostarget=embedded --fpcsplit --noconfirm --autotools

You might test.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0qp/fpcupdeluxe-x86_64-linux

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #7 on: March 18, 2023, 12:57:47 pm »
Here's where I'm at so far. The build stuff certainly works, and I've got a file which I'm fairly confident I could upload using OpenOCD which is now running as a detached daemon.

The debugging side needs a bit more work, basically as described in the earlier https://forum.lazarus.freepascal.org/index.php/topic,59458.0.html thread.

I think that the significant thing from FPCUPdeluxe's POV is that it doesn't set up a symlink for gdb-multiarch.

I'll try to do a bit of work on a wiki page at some point over the weekend, but the "magic incantation" needed to get a PicoProbe (or similar debugger for other targets, e.g. the WCH-Link for RISC-V) visible inside a Docker container is to have the "docker run" command include something like

Code: Text  [Select][+][-]
  1. $ docker run -it --privileged -v /dev/bus/usb/:/dev/bus/usb \
  2.     container_name
  3.  

That privileged option unlocks additional kernel capabilities relating to e.g. the USB bus tree, this does mean however that anything run inside the container has even more latitude to screw the entire host: set up decent passwords etc. as appropriate.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #8 on: March 18, 2023, 01:02:34 pm »
You might test.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0qp/fpcupdeluxe-x86_64-linux

I'll try to find time later, but I have no trouble running FPCUPdeluxe or the full Lazarus IDE from inside Docker since I'm using SSH to give myself multiple shell sessions with X11 tunneling.

MarkMLl
« Last Edit: March 18, 2023, 01:44:23 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Problems installing development environment for RP2040
« Reply #9 on: March 18, 2023, 04:58:53 pm »
You can now enable a scripting feature in Setup+. If enabled, a script will be generated that can be used with the command line version fpclazup. This script will do the same as fpcupdeluxe, but fully automated, without user input and command line only. Should be very suitable for docker use.
+1  :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problems installing development environment for RP2040
« Reply #10 on: March 19, 2023, 06:25:09 am »
I have been using Michael's Pico setup here on a small project (a controller for a solar hotwater system) and it works really well. But it does worry me a bit that its based on snapshots of both FPC and Lazarus, in FPC's case a heavily modified version of the snapshot at that.

Michael indicated he was going to try and push his mods back up to FPC but, I guess, time ....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #11 on: March 19, 2023, 08:33:09 am »
When I first had the problem my assumption was that the cause was a temporary inconsistency, so I paused for a few days before raising it. It would have been very unfortunate if that had allowed a buggy version of FPCUPdeluxe to escape.

I'm now halfway through setting up a RISC-V Eclipse-based development environment in Docker specifically to check whether my configuration allows me to get at the programming device. I like what I see so far, but am too far down the learning curve (and too busy) to volunteer to follow Michael's good example :-)

https://www.aliexpress.com/item/1005004895791296.html

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problems installing development environment for RP2040
« Reply #12 on: March 19, 2023, 08:49:09 am »
OK, just so I understand. You started talking Raspi Pico, have you abandoned that in favor of the CH32...  ?

It looks like it has some good specs, I was particularly frustrated that the Pico only has 2 usable A/D channels, claims 5 but ....

But you will be developing all your own libraries from there, 1-Wire etc ?  And how long will that device be on the market ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #13 on: March 19, 2023, 09:41:18 am »
OK, just so I understand. You started talking Raspi Pico, have you abandoned that in favor of the CH32...  ?

No. At the moment the exercise is to move a handful of development environments off my main system into Docker containers: a couple of microcontrollers, a couple of FPGAs and so on.

Part of the incentive for this is because affordable FPGAs are often picky about exactly what version of the development environment they require and might have time limitations, it's far easier to manage that sort of thing in a container or VM. But I've also been bitten by what appears to be a Trojan in VSCode, and there's absolutely no way I'm exposing myself to that again.

There's almost certainly going to be some bigger derivatives of the RP2040, look e.g. at the bit in the documentation where it describes 32 GPIOs as being available to the PIOs but only has pins for ~30. And RPi Inc is already known to be making a bit of extra money from special boards which have been found in e.g. Far-Eastern appliances https://hackaday.com/2021/07/03/a-custom-raspberry-pi-spotted-in-the-wild/ : the next obvious step is diversifying their chips.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problems installing development environment for RP2040
« Reply #14 on: March 20, 2023, 12:37:22 pm »
I'm now halfway through setting up a RISC-V Eclipse-based development environment in Docker specifically to check whether my configuration allows me to get at the programming device. I like what I see so far, but am too far down the learning curve (and too busy) to volunteer to follow Michael's good example :-)

https://www.aliexpress.com/item/1005004895791296.html

Overall verdict is positive. However realistically I think it needs their own "MounRiver" Eclipse-based IDE to provide OpenOCD as a downloader etc., and it's also possible to brick the WCH-LinkE programmer albeit with recovery described at https://www.eevblog.com/forum/microcontrollers/reflashing-a-bricked-wch-linke/msg4767923/#msg4767923

Working from those starting points it should be possible to get alternative tools i.e. FPC etc. to do the job, although I'm left worried by the programmer's friability.

This leaves the RP2040 competing by virtue of its PIOs, not because of its low price.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018