Skip to main content
La1
Associate III
Aug 21, 2019 06:47 UTC
Solved

How to properly compile linux kernel for stm32mp157c-dk2 ?

Hi,

I want to compile linux kernel for stm32mp157c-dk2, i followed guide in README.HOW_TO.txt and when i run command "make ARCH=arm O="$PWD/../build" multi_v7_defconfig fragment*.config" in point 5. I get following errors:

/opt/st/stm32mp1/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9/scripts/kconfig/Makefile:109: *** No configuration exists for this target on this architecture. Stop.

/opt/st/stm32mp1/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9/Makefile:539: recipe for target 'fragment*.config' failed

make[2]: *** [fragment*.config] Error 2

/opt/st/stm32mp1/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9/Makefile:286: recipe for target '__build_one_by_one' failed

make[1]: *** [__build_one_by_one] Error 2

make[1]: Opuszczenie katalogu '/opt/st/stm32mp1/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/build'

Makefile:146: recipe for target 'sub-make' failed

make: *** [sub-make] Error 2

I did everything before without point 4 (cuz i think it is optional) and without applying patches in point 3. because i don't know where to find this patches.

Besides this errors, some files are generated in ../build directory. Including .config and i am able to compile kernel, but when i deploy it on board, system crashes. And i think thats because of this previous errors.

Please tell me what I am doing wrong and how can i make it work

This topic has been closed for replies.
Olivier GALLIEN
Olivier GALLIENBest answer
ST Technical Moderator
Aug 21, 2019 09:08 UTC

Hi @La​ 

README.HOW_TO.txt procedure has been carefully validated/tested and works.

If you have properly source the SDK environnement step 2, I guess problem come from the fact you drop step 3.

Patches are present in folder sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0

So command to apply from sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9 is :

for p in `ls -1 ../*.patch`; do patch -p1 < $p; done

Hope it help

Olivier

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.

4 replies

Olivier GALLIEN
Olivier GALLIENBest answer
ST Technical Moderator
Aug 21, 2019 09:08 UTC

Hi @La​ 

README.HOW_TO.txt procedure has been carefully validated/tested and works.

If you have properly source the SDK environnement step 2, I guess problem come from the fact you drop step 3.

Patches are present in folder sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0

So command to apply from sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9 is :

for p in `ls -1 ../*.patch`; do patch -p1 < $p; done

Hope it help

Olivier

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.
SigmaPrime
Associate III
Dec 4, 2020 13:13 UTC

Hello I got the same issue but when I go to the patch directory and I do

for p in `ls -1 ../*.patch`; do patch -p1 < $p; done

cannot access '../*.patch': No such file or directory

La1
La1Author
Associate III
Dec 7, 2020 08:40 UTC

You need to be in sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/linux-4.19.9 directory, not in patch directory.

La1
La1Author
Associate III
Aug 21, 2019 10:41 UTC

Thanks so much ! Everything now works :)