cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 trying to add GCC

jgauthier
Senior

Hello,

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.

5 REPLIES 5
Olivier GALLIEN
ST Employee

Hi @Community member​ 

Could you share python modules you need?

Thx

Olivier

Olivier GALLIEN
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
python3-can:
  Installed: (none)
  Candidate: 4.0.0-r0
  Version table:
     4.0.0-r0 500
        500 http://packages.openstlinux.st.com/4.1 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
  python3-wrapt
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 http://packages.openstlinux.st.com/4.1 kirkstone/untested armhf python3-aenum armhf 3.1.11-r0 [189 kB]
Get:2 http://packages.openstlinux.st.com/4.1 kirkstone/untested armhf python3-wrapt armhf 1.14.0-r0 [38.1 kB]
Get:3 http://packages.openstlinux.st.com/4.1 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
https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 
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,

--JM

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 (https://pypi.org/project/fastapi/ and https://pypi.org/project/uvicorn/)

Follow the wiki https://wiki.st.com/stm32mpu/wiki/How_to_add_a_customer_application to add the two recipes for each module python3-fastapi_0.92.0.bb and python3-uvicorn_0.20.0.bb (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,

--JM