cancel
Showing results for 
Search instead for 
Did you mean: 

Error in "Prepare the Linux® kernel source code"

Sisyphus38
Associate III

Hello,

I tried to apply the step by step "Modify, rebuild and reload the Linux® kernel" form wiki.st .

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Modify,_rebuild_and_reload_the_Linux%C2%AE_kernel

Everything works fine from the first step of the "Getting started " until i uncoutered the error bellow.

Unfortunately i am a complete beginner on these tools and don't understand whats happen.

Thank you by advance for any help.

@PC:~/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.31-r0/linux-5.4.31$ make ARCH=arm multi_v7_defconfig "fragment*.config"

 HOSTCC scripts/basic/fixdep

 HOSTCC scripts/kconfig/conf.o

 HOSTCC scripts/kconfig/confdata.o

 HOSTCC scripts/kconfig/expr.o

 LEX    scripts/kconfig/lexer.lex.c

/bin/sh: 1: flex: not found

scripts/Makefile.host:9: recipe for target 'scripts/kconfig/lexer.lex.c' failed

make[2]: *** [scripts/kconfig/lexer.lex.c] Error 127

Makefile:567: recipe for target 'multi_v7_defconfig' failed

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

Makefile:326: recipe for target '__build_one_by_one' failed

make: *** [__build_one_by_one] Error 2

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Sisyphus38​ 

Open a new shell and source again the SDK.

If one of my comments answer your need, please mark it "Best answer"

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

22 REPLIES 22
Sisyphus38
Associate III

Hello,

A little web search solves the issue. I needed to install two extra packages with

-apt-get install flex

-apt-get install bison

For information, my computer was running i Ubuntu 18.04 fresh install.

Regards

Sisyphus38
Associate III

Next issue......

when running make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040

.....

.......

 WRAP   arch/arm/include/generated/asm/trace_clock.h

 WRAP   arch/arm/include/generated/asm/simd.h

 UPD    include/config/kernel.release

 UPD    include/generated/uapi/linux/version.h

 UPD    include/generated/utsrelease.h

 SYSNR  arch/arm/include/generated/asm/unistd-nr.h

 GEN    arch/arm/include/generated/asm/mach-types.h

 SYSTBL arch/arm/include/generated/calls-oabi.S

 SYSTBL arch/arm/include/generated/calls-eabi.S

 CC     scripts/mod/empty.o

gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’

gcc: note: valid arguments to ‘-mabi=’ are: ms sysv

gcc: error: unrecognized command line option ‘-mlittle-endian’; did you mean ‘-fconvert=little-endian’?

gcc: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?

scripts/Makefile.build:265: recipe for target 'scripts/mod/empty.o' failed

make[1]: *** [scripts/mod/empty.o] Error 1

Makefile:1110: recipe for target 'prepare0' failed

make: *** [prepare0] Error 2

Thank you by advance for any help.

Sisyphus38
Associate III

Some think completely broke my SDK install.

The "Hello World" does'nt compile any more.

$CC --version -> unknown command

echo $CROSS_COMPILE -> gives empty string.

I will reinstall the SDK and give you feedback.

Regards

Hi @Sisyphus38​ 

Yes you have to proceed carefully to installation of all extra package as mentionned here :

https://wiki.st.com/stm32mpu/wiki/PC_prerequisites#Install_extra_packages

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.

Hi @Sisyphus38​ 

Open a new shell and source again the SDK.

If one of my comments answer your need, please mark it "Best answer"

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.

Thank you Olivier for your

Hello Olivier,

You right. When I source again all env variables are retrieved and the "Hello world" compile again !

I launched make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040 and compiling is still proceeding .

Good signal !

Thank you again Olivier.

MSele.1
Associate III

Hi @Sisyphus38​ and @Community member​ How do you fix this problem; it has taken me more than three days now; I delete the whole Linux system from my virtual machine, and reinstall it again by following all steps outlined at the WIKI. But no success; I keep getting the same error

0693W000007BLUWQA4.jpg 

Sisyphus38
Associate III

Hello MSele.1,

I have applied the process on an Ubuntu 18.04 fresh install.

All compilation module installed are those of the step by step Stm wiki . No one more.

Be aware that when you source the compiler, it's only available the currently opened linux shell.

All modules installed are in the exact version adviced in the wiki.

Be confident. The setup works well....

Back to you if some details come back to the mind.

Regards.