Installing GCC on STM32MP157

Spearitch

Member
Credits
412
Hello Everyone



I wanted to Install Buildroot on my STM32MP157-DK2 according to this website:

https://bootlin.com/blog/building-a-linux-system-for-the-stm32mp1-basic-system/



Unfortunately as a beginner with OpenST-Linux and Yocto I got stuck at that step where I couldn't find a way t install gcc like on ubuntu for exemple with the easy command "apt-get install ... " .

this is the message that I get

/bin/bash: gcc: command not found
/bin/bash: line 0: [: : integer expression expected
mkdir -p /home/root/buildroot/output/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="gcc" HOSTCC="gcc" \
obj=/home/root/buildroot/output/build/buildroot-config -C support/kconfig -f Makefile.br conf
make[1]: Entering directory '/home/root/buildroot/support/kconfig'
gcc -DCURSES_LOC="<curses.h>" -DLOCALE -DKBUILD_NO_NLS -I/home/root/buildroot/output/build/buildroot-config -DCONFIG_=\"\" -c conf.c -o /home/root/buildroot/output/build/buildroot-config/conf.o
/bin/sh: gcc: not found
make[1]: *** [Makefile.br:34: /home/root/buildroot/output/build/buildroot-config/conf.o] Error 127
make[1]: Leaving directory '/home/root/buildroot/support/kconfig'
make: *** [Makefile:926: /home/root/buildroot/output/build/buildroot-config/conf] Error 2

I flashed and Installed OpenST-Linux on my device according to this st.wiki page:

https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package

Everything worked fine.

I would also be interested in knowing if Installing Buildroot would cause some STM-Softwares inactive. We are working on an IoT Project and according to what I've read,Buildroot is suitable for it and besides the guy responsible for the Project wanted Buildroot installed and configured on the device.


Thank you all and thanks for helping me to get better
 
Last edited:


Alexzee

Well-Known Member
Credits
4,509
It looks like you have to install gcc first because it looks like it's having trouble compiling Buildroot. Than install Buildroot.

Does sudo apt install gcc work for you?

Do you have the distribution pkg installed?

Does Buildroot come as a tar.gz?

This may come in handy later. Here's the repo for your OpenSTLinux distro:


-::-When building and compiling make sure you are in the right directory so make won't return errors.-::-


Chapter 4. Buildroot quick start:

 

Spearitch

Member
Credits
412
Oh I Understand
It looks like you have to install gcc first because it looks like it's having trouble compiling Buildroot. Than install Buildroot.

Does sudo apt install gcc work for you?

Do you have the distribution pkg installed?

Does Buildroot come as a tar.gz?

This may come in handy later. Here's the repo for your OpenSTLinux distro:


-::-When building and compiling make sure you are in the right directory so make won't return errors.-::-


Chapter 4. Buildroot quick start:

Well first the steps in the buildroot configuration website hat I shared have to be done on a host pc with WSL Ubuntu 18.04. Meaning that every package you talked about is already installed and was updated. If you have a look at the website you will notice that a Buildroot file will be dowloaded from the git repository of Buildroot. after fetching, configure the make menuconfig and all that stuff I run the make command to build and install the rest of the folders. I always get the same error after 10 mn of compilation which is:

mv /home/mehdi/buildroot/output/build/toolchain-external-arm-arm-2018.11/* /home/mehdi/buildroot/output/host/opt/ext-toolchain/
mv: cannot move '/home/mehdi/buildroot/output/build/toolchain-external-arm-arm-2018.11/arm-linux-gnueabihf' to '/home/mehdi/buildroot/output/host/opt/ext-toolchain/arm-linux-gnueabihf': Permission denied
package/pkg-generic.mk:168: recipe for target '/home/mehdi/buildroot/output/build/toolchain-external-arm-arm-2018.11/.stamp_extracted' failed
make: *** [/home/mehdi/buildroot/output/build/toolchain-external-arm-arm-2018.11/.stamp_extracted] Error 1

I searched everywhere on the Internet and found nothing that could help me. Something is wrong with the make file maybe.
Again I'm doing that first on my Laptop then I'm going to upload the files to my MPU and flash it.
 

Spearitch

Member
Credits
412
Solved ! From all websites forums and people talking and talking only one guy solved my Problem. It seem like running a make command and building files ( the most important one images ) while running WSL is only possible if you upgraded WSL from WSL1 to WSL2.
 

Alexzee

Well-Known Member
Credits
4,509
Solved ! From all websites forums and people talking and talking only one guy solved my Problem. It seem like running a make command and building files ( the most important one images ) while running WSL is only possible if you upgraded WSL from WSL1 to WSL2.
Ok, glad you found that out.

And your right sometimes there is something wrong with the make file.

Is Buildroot installed now?
 

Spearitch

Member
Credits
412
Good, glad to hear it:-

Hello Alexzee

It's me again. I figured out how to install the package, flash my sd card and get different features working on my STM32 but the gcc package was not found. In fact when I
Code:
sudo make menuconfig --> Target Packages
I don't find all the packages listed here

One of them is GCC which is a primordial package and without it the MPU is useless
 

Alexzee

Well-Known Member
Credits
4,509
Hello Alexzee

It's me again. I figured out how to install the package, flash my sd card and get different features working on my STM32 but the gcc package was not found. In fact when I
Code:
sudo make menuconfig --> Target Packages
I don't find all the packages listed here

One of them is GCC which is a primordial package and without it the MPU is useless
GCC is on that page. You just have to scroll down to it. It's under gawk.



Also you may need to install build-essential first than install gcc.
That how it's done on a Debian system using apt.

 
Last edited:

Alexzee

Well-Known Member
Credits
4,509
Nope sadly it does not work .. but as far as I know it is possible to cross compile the file on a host machine running under ubuntu for example and upload the file on the MPU.
That's good news.

I wish you the best with this as it's getting to be beyond the scope of what I know or to be able to assist you.

Enjoy the weekend!
 


Members online


Top