cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly compile linux kernel for stm32mp157c-dk2 ?

La1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

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

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.

View solution in original post

4 REPLIES 4
Olivier GALLIEN
ST Employee

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

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.
La1
Associate III

Thanks so much ! Everything now works 🙂

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

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.