Forfatterarkiv: Morten

How to Install Lazarus on Manjaro 22.06 with your VIM3


This is a pretty easy install, some bug fixes have to be done and you have to change some files – then you are up and running with the beautiful Lazarus – a programming language that never dies.

Written by Morten Steenberg. 2022 AUG

We assume you have installed Manjaro 22.06 distro on your Khadas VIM3 (I have my own help for this for you) and updated the system, so this is up to date!

1. Install Fpc, Fpc-src, and Lazarus via the regular Software manager built in Manjaro. For the moment this is version 3.2.2 for Fpc and 2.2.0 for the Lazarus (Lazarus-qt5 version). I mean, there is no point in struggling to get the latest version, very small changes, so you should accept these versions – work and compile fine!

2. The compiler is broken, so you have to fix up something. You have to locate the file cprt0.as on your computer. Be aware, that you have 10’s of these files in your system – so NOT search for this file, go to the right folder, explained under here!

3. Travel/goto to this folder on your Manjaro with console, first:

cd /usr/lib/fpc/src/rtl/linux/aarch64

4. Enter this in your console:

sudo nano ./cprt0.as

Or if you prefer Kate instead: kate ./cprt0.as…

5. Then goto about line 40 from the top in the file, you will find this section :

/* __libc_start_main(main, argc, argv,
init, fini, rtld_fini, stack_end) */
adrp x0,:got:PASCALMAIN
ldr x0,[x0,#:got_lo12:PASCALMAIN]
adrp x3,:got:__libc_csu_init
ldr x3,[x3,#:got_lo12:__libc_csu_init]
adrp x4,:got:__libc_csu_fini
ldr x4,[x4,#:got_lo12:__libc_csu_fini]
bl __libc_start_main

Mark this section over in the file, and replace it with this :

/* __libc_start_main(main, argc, argv,
init, fini, rtld_fini, stack_end) */
adrp x0,:got:PASCALMAIN
ldr x0,[x0,#:got_lo12:PASCALMAIN]
mov x3,xzr
mov x4,xzr
bl __libc_start_main

Then save the file and leave the nano or kate editor and return to the console!

6. Then travel one folder back/up

cd ..

7. And enter this (this will compile this C/ASM code in the file cprt0.as):

sudo make CPU_TARGET=aarch64 OS_TARGET=linux cprt0.o

8. Then copy the file to this location, like this:

sudo cp /usr/lib/fpc/src/rtl/units/aarch64-linux/cprt0.o /usr/lib/fpc/3.2.2/units/aarch64-linux/rtl/

You should now have the ability to Compile in Lazarus!

9. Fix the crtbegin/crtend warning when you compile. Be sure you have installed the GCC compiler before you proceed here (Install gcc – The GNU Compiler Collection -C and C++ frontend in Manjaro Software Manager, if you have not):

Then, check what version of gcc that’s installed in your system:

cd /usr/lib/gcc/aarch64-unknown-linux-gnu/

Then type

ls

Probably you see a folder with the name 12.1.0. This is the folder you should get fpc to look after. This will get rid of the crtbegin/crtend warning! To fix this you have to update the fpc.cfg file. You should find the file in /etc. Goto this folder:

cd /etc

Then edit the file:

kate ./fpc.cfg

Travel/goto about line 178 in the fpc.cfg file, you will find a header with the name # path to the gcclib – here is the error/problem! Add a new line after the last -Fl line and before #endif, with (about line 182 in the fpc.cfg file…) this line of text:

-Fl/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0

Save the file. Important if your system has another version of gcc, you have to alter/change the -Fl line to the right version/number!

Now you can compile without any strange warnings!

10. A better dook container for Lazarus. At last, I prefer a docking system in the Lazarus Ide, activate the already light preinstalled packages with (Lazarus Ide→Package→Install/uninstall packages) :
AnchorDocking 1.0
AnchorDockingDsgn 1.0
Then “Save and rebuild IDE”

Happy programming with Fpc/Lazarus.

How to install a new fresh Manjaro KDE Plasma 22.06 on your VIM3

Download the file here: https://minibase.no/khadasfiles/Manjaro-ARM-kde-plasma-vim3-22.06.img.xz -Or if you prefer to do it the hard way by yourself, download the image from  www.manjaro.org – Select Download, KDE Plasma version and select Khadas VIM3 computer then read the guidelines here to create the file:
https://github.com/khadas/krescue/blob/master/docs/README_how_to_make_simple_krescue_image_xz.md

OR

We do the hard work for you, and you install only – it is easy!

There are many ways to install OS images on your Vim. But there is a lack of what is important and what is a bad way to install. We think Khadas gives us many ways to install OS on your lovely VIM3.

We have downloaded, compressed, and tagged the latest image of Manjaro KDE Plasma 22.06 for (late summer 2022) for your VIM3 all ready for you – and it’s ready for installation direct via oowow. We strongly recommend the newest release of oowow and not the old Krescue system. Be aware if you use the old Krescue program, it has a strange behavior to empty the xz-file and the Krescue’s says the file is “broken”, we don’t know why – but with oowow we have no problems at all. You will find the newest version here for oowow:
https://dl.khadas.com/firmware/oowow/system/vim3-oowow-latest-sd.img.gz
This works fine with Khadas VIM3 and the image we have created for you. For the moment there is only a very old 22.01 image of Manjaro, sadly on Khadas’s dl.khadas.com site. This is wrong, Manjaro images for Khadas VIM 3 are updated! On this link, you will find all versions of Manjaro the last 2 years direct for Khadas VIM3 – Great!

Here is the way

Download the image from our server. Then:

  1. Before you begin. Use a USB Stick (>16Gb) NOT MS-DOS formatted (only 4Gb files max on MS-DOS, the Manjaro OS decompressed is about 5Gb) but a Linux ext4, or similar formatted!
  2. Put the image we have prepared for you, on this USB stick. Remember you must only copy the file, not create an image on the USB Stick.
  3. Before proceeding have oowow ready on an SD Card (here you have to create an image with Gnome Disk or similar) also since the VIM3 has a non-internal SPI memory to store oowow internal.
  4. Turn off power on your VIM3 – be sure to take a backup before you proceed here – all old data from EMMC will be lost – important!!!
  5. Put SD Card in back and plug in the USB Stick, power on. Oowow should start.
  6. Select Write image to EMMC.
  7. Travel thru folders to find the USB Stick – and be sure to click on <<VIM3 only>> so ALL files in the USB Stick will be shown, otherwise only files that begin with VIM3. will be shown!
  8. Select the file Manajro-ARM-kde-plasma-vim3-22.06.img.xz you have put on the USB Stick.
  9. Click Install.
  10. After finishing, remove the booth SD Card and USB Stick and turn off the power then turn the power on again. The new system will begin to boot. This OS takes a few minutes the first time, we don’t know why, but after 2-3 boots, this is speeding up.
  11. Problem with sound/video on Manjaro 22.06. This is an easy fix: Start software manager and remove/install this:
    Remove plasma-pa
    Remove pipewire-pulse
    Install pulseaudio
    Perhaps a reboot here before proceeding?
    re-install plasma-pa
    reboot again.
  12. Problem with video playback in Chromium on the new Manjaro install? This is also an easy fix: Open Chromium and go to chrome://flags In the browser, then set this:
    Set WebRTC PipeWire support to Enabled.
    Set Preferred Ozone platform til Wayland.
    Relaunch your browser, Youtube video will now play smoothly.

You should now get a video playback in HD quality, preferably with a connected Bluetooth speaker with a CPU load of approximately 25 percent. NICE!

You have now an updated Manjaro 22.06 on your Khadas VIM3. Happy Computing!

 

Khadas VIM 3 

Written by Morten Steenberg
Aug 2022

Permalink to this article: https://minibase.no/?p=1602

Logitech MX Keys mini

Jeg har vært så heldig å få prøve ut et nytt tastatur fra Logitech. Logitech er vel kjent for de fleste som et meget godt valg innenfor tastaturer i mange år. Har den klart det igjen?

Forord
Et suverent tastatur. Her er egentlig tastaturet funnet opp på nytt. Dette skal jeg forklare litt nærmere med hva jeg mener med dette. Først litt om meg. Jeg er programmerer, og har holdt på med dette i rundt 30 år, så jeg veit hva jeg snakker om. Jeg har en Windows PC, en 21.5 tommer Mac med 4K skjerm og jeg har en Raspberry Pi 4 ettkortsdatamaskinen – jeg bruker dette nye vidunderlige tastaturet på alle 3 maskinene til samme tid (yes!) og kan «rydde» skrivebordet mitt for 3 tastaturer og erstatte dette med dette nye tastaturet fra Logitech – og det gjør jeg med en fryd og glede.

La oss gå litt mer i dybden på hva som betyr noe for deg:

Fysikken
Noe av det viktigste med et tastatur er at det har vekt. Hvorfor det? Jo, sitter du med tastaturet i fanget og det vipper til den ene og andre siden blir det bare tull. Her stiller Logitech opp med et svært tungt tastatur som ligger stabilt uansett hvor du setter dette. Jeg har aldri hatt et mer stabilt tastatur enn dette.
Tastaturet har også bakgrunnbelysning som aktiviserer seg før du berører en tast (? jepp, du leste riktig). Dette gjelder uansett hvor du nærmer deg tastaturet. Meget behagelig, da du også enkelt kan bestemme lysstyrken også. Allerede her forsvart mitt trådløse Mac tastatur ned i en skuff (kanskje for godt?). Ellers har tastaturet alle de vanlige «snarveiene» til å regulere lyd og avspilling av musikk.

Tilkobling
Dette er uten tvil en av de sterkeste funksjonene på dette tastaturet. Hvorfor det? Jo, fordi dette tastaturet kan enkelt koble seg opp en flere enheter på en gang. Det vil si, du kan ha inntil 3 enheter (enheter er f.eks. Pc, mobil, nettbrett etc..) på en gang og bare velske mellom disse med et tastetrykk. Viktig å få med seg er, skulle du behøve knytte til en enhet til (utover 3) er det bare å holde en av de 3 knappene inne, hvor du velger enhet inne en liten stud og vips kan du parre denne til ønsket enhet. Denne funksjonen virker utrolig stabil og solid. Jeg benytter i min hverdag både Linux, Windows og Mac Os og har overhodet INGEN problemer med dette tastaturet jeg nå sitter å skriver dette du nå leser på. Understreker også at Bluetooth fungerer 100% på dette tastaturet på alle mulige systemer!

Sluttord
Dette tastaturet er bare nydelig. På en måte er tastaturet funnet opp på nytt. Hvordan er dette mulig? Jo, de vesentlige funksjonene hos mange andre leverandører av tastatur er glemt ; som vekt, konstruksjon og funksjonalitet. Jeg finner ingen negative forhold tilknyttet dette tastaturet. Logitech MX Keys Mini er og vil være en vinner hos meg for mange år fremover.

  • Anbefales på det varmeste dette tastaturet. Jeg gir dette maks i kvalitet og brukervenlighet.
  • Prøv gjerne Prisjakt.no for å finne hvor tastaturet selges og en god pris.

Mvh
Morten Steenberg
Programmerer IOS, MacOS, Windows og Linux.

Informasjon om våre plast produkter vi lager selv

 

PLA – Polymelkesyre (kalles også PLA fra engelsk: polylactic acid)

Litt informasjon om produkter vi selger som inneholder PLA plastikk:

PLA er en biologisk nedbrytbar plast og kan dermed ses på som et miljøvennlig alternativ, og er som regel laget av enten mais-stivelse, sukkerrør eller planter. For eksempel vil en printet gjenstand som ligger i varm og fuktig jord eller kompost typisk være nedbrutt i løpet av 6-12 måneder.

Den krever også mindre energi for å smelte enn tradisjonell, oljebasert plast.

PLA er ofte brukt til modeller, byster, pyntegjenstander, prototyper, leker som ikke trenger å tåle hard bruk, generelle deler og beholdere, ofte i mat emballasje, for eksempel sjokoladepapir, og biologisk nedbrytbare, medisinske implantater, slik som sting.

PLA Produkter håndvaskes.

Du gjør et godt miljøvalg ved å handle PLA plastprodukter fra oss.

 

StampleIt – Upcoming Linux program

Yes, after many years of programming apps for Windows, MacOs and IOS – now I enter the Linux world.

This first app out is StampleIt – a great and delicious program for creating text and image on images. Take a look at the too samples under here:

 

This program can in a batch job add images and/or text to images. For the moment this app is in beta, and not released to the public yet. The plan is release in December this year (2020). Visit minibase.no later and check out. Some images from the program (this is the Linux/Aarch/Arm release for Raspberry Pi 4):

First MultiOs program
This is my first Multi Os program. This program will be released for a lot of Linux distros first, then Windows 64 bit and at last MacOs.

The first release will be for Linux distros in December 2020.

Install a good Spotify player on Raspberry Pi 4 with Manjaro

Yes, there is a Spotify player who works on Manjaro 20.06 and with Raspberry Pi 4!

You find it in the software manager with the name ncspot. The version I installed (Aug 2020) is 0.2.0-1. This is in the AUR file system, so you have to have enabled this before your search.

Install it from scratch and rebuild it. It’s written in Rust – it takes time, but it’s worth it.

After du have installed it, there is no creepy .conf file to edit. Just type in your username and password and find a song and hit play straight away.

– Then it plays on your Raspberry Pi 4 without any problems.

It’s extremely fast relative to the original Spotify app. Some tricky keyboard shortcuts, but it plays all your playlists and everything you find on Spotify right away on your Raspberry Pi 4 with Manjaro 20.06.

Remember the ncspot has no GUI, only a text screen in the console. But it presents music – you did not look at the music, you hear. Works great for me. And it update Manjaro’s internal player with cover etc.


Written by Morten Steenberg
August 2020

Permalink to this article: https://minibase.no/?p=1610

How to Install new apps that are not supported by Arm architecture on Manjaro 20.06 on Pi 4

Yes, you find new program in the AUR archive, and try to install and got an error that the architecture is not supported. You give up? Don’t!!

Most of these programs can be recompiled to work with the arm architectures with only change one line! Not all but mostly.

You see most off the program in the AUR achieve is mostly supported by x86 or int386, and not arm. But since most Linux apps have source code, you can just recompile the package/program from scratch. That’s all, easy. Try it before you give up!

You have to enable AUR packages in settings in the software manager first – If you not already have done that.

This is a sample to rebuild Balena Etcher for you!

  1. Search for “balena” in the software manager in Manjaro on your Pi 4.
  2. Select balena-etcher (for the moment v. 2:1.5.102-1 in July 2020).
  3. After you have started the build of this package/program you got an error who tells you that this package/program is not build for ‘aarch64’ architectures. Don’t give up. You only need rebuild the package. Continue reading under.
  4. Select go/do again. Then you got a window up who tells you to quit or change construction/build files (rightmost icon). Click this icon.
  5. Then you got an editor up, first with the textfile PKGBUILD (forgot the others). Lock here? See something strange? Look for the line arch=(x86_64).
  6. Here is the fix. Change the text x86_64 to aarch64. Then save.
  7. Next (after save) start to build again.
  8. Now the complete package will be rebuild to hopefully support aarch64 structure, and not any x86 structure.
  9. This can take awhile.
  10. Sit down and take a coffee – you got a new fresh build of Balena Etcher, who works on Manjaro on your Raspberry Pi 4.

Written by Morten Steenberg
July 2020

Permalink to this article: https://minibase.no/?p=1602

How to install Lazarus 2.0.10 & FPC 3.2.0 on Manjaro 20.06 with Raspberry Pi 4

Yes, the new version of Manjaro 20.06 with Raspberry Pi 4 works great together, and the performance is just amazing with a small Raspberry Pi 4.
Here is a little guideline to install Lazarus on your Pi 4.

But I can’t find any install on this Aarch system for Lazarus 2.0.10. Only older outdated versions. So : I had to do it the manual way. Hard? not! – It only looks nasty with all the shell scripts to run – Don’t be afraid, go on! It’s not too hard.

Here we go

  1. Install FPC: Download the file fpc-3.2-0.aarch64-linux.tar from (you find the file other places to) the site under:
    – Download the file from http://freepascal.org/down/aarch64/linux-canada.var – This is binary files, and it will install quickly.
  2. Unpack the file to a temporary folder first, somewhere. You will have the option later to select the destination folder, so don’t worry.
  3. Open the console and cd to the folder where you extract the files. Find the file install.sh and run it with ./install.sh
    – Select the default folder. Like /home/yourusername/fpc-3.2.0 (Hit Enter)
    – Select Yes to install the documentation (Hit y and Enter)
    – Select install demos (Hit y and Enter)
    – Also, hit Enter again to install demos in the default folder (Hit Enter)
    – Also, Hit Y to insert the right version in fpc.cfg file (Hit Y and Enter)
  4. Install FPC source. This you can do via the Software manager here in Manjaro, just search for fpc-src and you find the file and install it.
  5. Install Make. You find it under the software manager, install the file/program Make.
  6. Install gtk2 (GUI toolkit, needed when compiling Lazarus). You find this in the software manager. Version i use is 2.24.32-2.
  7. Install Lazarus. Download this file via http://sourceforge.net/projects/lazarus/files/ and select/click on Lazarus Zip_GZip (this is the source) Then select Lazarus 2.0.10 and then download lazarus-2.0.10-2.zip (newest July 2020!).
    – Unzip this Zip file to a place you want in your home folder hierarchy. Perhaps try (from home) Lazarus? Remember after you have compiled the Lazarus, this will also be the home folder for Lazarus. So think twice when you unzip the Lazarus source.
  8. Next is to set the path so you can compile the source code of Lazarus, if you use “fpc-3.2.0” as folder name from your home folder, you enter this in the console :
    export PATH=”$PATH:/home/yourusername/fpc-3.2.0/bin”
    – Note: Don’t copy/paste the line over direct, use your keyboard to get the right
    – Remember to change yourusername to you right username (name before @ i console).
  9. You can now use fpc compiler in your home folder or anywhere, try to enter fpc in the console, and then press Ctrl+C to exit. If you start the fpc compiler, you are ready for step 10 here, else something is wrong! try check over again…
  10. Now go to the folder where you unzipped the Lazarus and enter this in the console:
    make clean bigide
    – This shod start the compiling of Lazarus, and take about 10-20 minutes…
  11. Double-tap (in the Lazarus folder) in Dolphin file-browser, the file startlazarus – not the startlazarus.app. Then the window “Configure Lazarus IDE” opens with an error it can’t find the fpc binaries. Click browse and go to your fpc folder, then the bin folder, then select the fpc file.
    – Important you select THE file fpc, and not the complete folder!
    – This will return to the window with no errors.
    – Click button “Start IDE”
  12. Create a small project with a button etc, and then try to compile/build (hit F9). You probably get some errors:
    – Not found FPCRES – Add this line under the last -FD line in the hidden file in your home folder, with the name “fpc.cfg” and edit this with Kate. Add a new the line under the -FD line:
    -FD/home/yourusername/fpc-$fpcversion/bin
    – If you got an error that the compiler not found crtbegin and crtend files are missing. Add a new line after et last -Fl line with:
    -Fl/usr/lib/gcc/aarch64-unknown-linux-gnu/9.3.0
    – Then add a package in the software manager with the name gcc and gcc-libs – if it not already is installed. This gives you the crtbegin.o and crtend.o file.
  13. At last, I prefer a docking system in the Lazarus Ide, activate the already light preinstalled packages with (Lazarus Ide→Package→Install/uninstall packages) :
    AnchorDocking 1.0 or Sparta_DockedFormEdtiro 0.0
    AnchorDockingDsgn 1.0
    … And you can uninstall an older package how is only create trouble later for you, that is the package: Chmhelppkg… (Old help file system on Windows?). You don’t need it and it also has a bug when you try to recompile Lazarus with this package included!
  14. You are done. Happy programming with fpc/lazarus.

Freepascal.org updated for arm - aarch Lazarus

As of 15 August 2020, there is also a new guideline on freepascal.org. Very similar to my original guide over, from July. Check this out : https://wiki.freepascal.org/Install_on_aarch64_Arch_or_Manjaro

BONUS TIPS
Wish to support QT5 Widgets controls in your apps in Pi/Lazarus/Manjaro?
– No problem!


Super easy to «add» support for QT5 style in your apps. This also follows the default theme.

  • Install in software manager in Manjaro the file qt5pas.
  • In your program you create/In Lazarus : In menu Project→Project Options→Scroll down to “Additions and Overrides”.
  • Click on the button “Set LCLWidgetType”, select “Value gt5
  • Press OK button.
  • You’re done. God Luck.

Written by Morten Steenberg
July 2020

Permalink to this article: https://minibase.no/?p=1530

Latest news

New page for Raspberry PI 4 and my new power management board XPI
I have created my own page regarding only Raspberry PI 4 and my new power management board, called XPI. Check out my page and download files to enhance your PI now! Click here