Showing results for 
Search instead for 
Did you mean: 

STM32MP1 trying to add GCC



I have several python modules I am trying to install that require building something in C. I've read through this and completed a build. I got to the part about adding layers and I'm lost. I've not built a distribution using these tools before and layers are a foreign concept. I can't tell a) what layer GCC is in, nor b) how to add that layer to the final image to be flashed.

Any advice? I've found an older thread but this method is not longer supported by bitbake.

ST Employee

Hi @Community member​ 

Could you share python modules you need?



In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I'm looking to add python-can which requires logging, which requires sqlite3, which requires building.

I am trying to add FastAPI, and it's web server (uvicorn) which also has build requirements.

I did not check if these are available through apt, because I assumed they werent.

I discovered that the syntax is actually:

IMAGE_INSTALL:append = " packagegroup-core-buildessential"

and I am trying to run my image again

Hi @Community member​ 

the package python3-can is available in our repository:

root@stm32mp1:~# apt-cache policy python3-can
  Installed: (none)
  Candidate: 4.0.0-r0
  Version table:
     4.0.0-r0 500
        500 kirkstone/untested armhf Packages

You can install it with the command apt-get install

root@stm32mp1:~# apt-get install python3-can --assume-yes
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  python3-aenum python3-pkg-resources python3-plistlib python3-sqlite3
The following NEW packages will be installed:
  python3-aenum python3-can python3-pkg-resources python3-plistlib
  python3-sqlite3 python3-wrapt
0 upgraded, 6 newly installed, 0 to remove and 1 not upgraded.
Need to get 517 kB/753 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 kirkstone/untested armhf python3-aenum armhf 3.1.11-r0 [189 kB]
Get:2 kirkstone/untested armhf python3-wrapt armhf 1.14.0-r0 [38.1 kB]
Get:3 kirkstone/untested armhf python3-can armhf 4.0.0-r0 [290 kB]
Fetched 517 kB in 1s (907 kB/s)
The software package is provided AS IS, and by downloading it, you agree to be
bound to the terms of the software license agreement (SLA).
The detailed content licenses can be found at
Selecting previously unselected package python3-aenum.
(Reading database ... 15212 files and directories currently installed.)
Preparing to unpack .../0-python3-aenum_3.1.11-r0_armhf.deb ...
Unpacking python3-aenum (3.1.11-r0) ...
Selecting previously unselected package python3-plistlib.
Preparing to unpack .../1-python3-plistlib_3.10.4-r0_armhf.deb ...
Unpacking python3-plistlib (3.10.4-r0) ...
Selecting previously unselected package python3-pkg-resources.
Preparing to unpack .../2-python3-pkg-resources_59.5.0-r0_armhf.deb ...
Unpacking python3-pkg-resources (59.5.0-r0) ...
Selecting previously unselected package python3-sqlite3.
Preparing to unpack .../3-python3-sqlite3_3.10.4-r0_armhf.deb ...
Unpacking python3-sqlite3 (3.10.4-r0) ...
Selecting previously unselected package python3-wrapt.
Preparing to unpack .../4-python3-wrapt_1.14.0-r0_armhf.deb ...
Unpacking python3-wrapt (1.14.0-r0) ...
Selecting previously unselected package python3-can.
Preparing to unpack .../5-python3-can_4.0.0-r0_armhf.deb ...
Unpacking python3-can (4.0.0-r0) ...
Setting up python3-aenum (3.1.11-r0) ...
Setting up python3-sqlite3 (3.10.4-r0) ...
Setting up python3-wrapt (1.14.0-r0) ...
Setting up python3-plistlib (3.10.4-r0) ...
Setting up python3-pkg-resources (59.5.0-r0) ...
Setting up python3-can (4.0.0-r0) ...

Does it fulfill your requirements?

Best regards,


Thank you. That does install the CAN module. As far as the FastAPI system, no.

I ended up building the whole distribution, which created a lot of debian files.

I made an internal APT repository and pointed my STM32MP1 device to it and installed gcc, g++, binutils, make, etc.

Obviously, building on a platform like this is not desirable and it's my hope that it is one and done.

I am currently in the middle of building the application. I had to add a temporary swapfile since the build consumed all the physical memory.

Hi @Community member​ 

The FastAPI and uvicorn are available as PyPI modules ( and

Follow the wiki to add the two recipes for each module and (current versions today).

The new recipes should roughly follow the pattern:

DESCRIPTION = "<blabla>"
HOMEPAGE = "<url to FastApi / unicorn>"
LICENSE = "<license of FastApi / unicorn>"
LIC_FILES_CHKSUM = "file://<LICENSE name>;md5=<licence md5>"
SRC_URI[sha256sum] = "<sha256sum of the component>"
inherit pypi setuptools3
RDEPENDS:${PN} += " \
  <all runtime dependencies required by the module>

Run the commands bitbake python3-fastapi and bitbake python3-uvicorn to build your packages.

Best regards,