Skip to main content
Sisyphus38
Associate II
November 12, 2020
Solved

Error in "Prepare the Linux® kernel source code"

  • November 12, 2020
  • 8 replies
  • 7659 views

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

This topic has been closed for replies.
Best answer by Olivier GALLIEN

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

8 replies

Sisyphus38
Associate II
November 12, 2020

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

Olivier GALLIEN
ST Technical Moderator
November 13, 2020

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.
Sisyphus38
Associate II
November 13, 2020

Thank you Olivier for your

Sisyphus38
Associate II
November 12, 2020

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 II
November 13, 2020

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

Olivier GALLIEN
Olivier GALLIENBest answer
ST Technical Moderator
November 13, 2020

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.
Sisyphus38
Associate II
November 13, 2020

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 II
January 14, 2021

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 II
January 15, 2021

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.

MSele.1
Associate II
January 21, 2021

Thanks @Sisyphus38​ , when I repeated the reinstallation, I kept a close eye on the messages fired back and I realized some of the modules were not being installed because of storage space. So I increased the virtual disk in my VMWare from 20GB to 50GB and everything went on smoothly to the end, the only problem still troubling me is that the board returns an IPv6 address only, while the instructions show as if I have to use IPv4.

So now I get stuck on this command trying to communicate between my laptop and the board0693W000007CFAmQAO.jpg 

Sisyphus38
Associate II
January 22, 2021

Hello MSele.1,

Good news !

I have noticied the same situation. That moment I thaugth the device is only IPv6 Compatible, but i was wrong.

If I am right your host developpement computer needs to attribute an ipv4 adress. So you have to adjust network parameters in the host computer like DHCP, subnetwork mask....

Maybe this link can help you.

https://www.cyberciti.biz/faq/linux-unix-ifconfig-does-not-show-ip-address/

Don't hesitate to give feedback for other users.

Regards

Sisyphus38
Associate II
January 22, 2021

Sorry MSele1, post sent twice.

Olivier GALLIEN
ST Technical Moderator
January 22, 2021

Hi @Sisyphus38​ ,

I deleted the duplicate comment.

@MSele.1​ ,

To get ipv4 address seems you have to set :

[Network]
 
DHCP=ipv4

in some conf file in /lib/systemd/network

See https://wiki.st.com/stm32mpu/wiki/How_to_configure_ethernet_interface

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.
MSele.1
Associate II
January 25, 2021

Hi @Community member​ I was unable to connect my pc to the board using ethernet, because of IP differences. Resolving between IPv4 and IPv6 has become too complicated for me since the board has no editor that I can use to edit the files indicated at the link you provided; in future I will use a router between my pc and the board, but I need this problem to be solved now before I get the router. My work around was by copying to a USB memory stick all files that were supposed to be sent by the command

PC $> scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot

in Section 5.2 here Modify, rebuild and reload the Linux® kernel - stm32mpu and transfer them to the board manually.

The problem comes again as a I move to Section 5.3 where the command

PC $> find install_artifact/ -name "*.ko" | xargs $STRIP --strip-debug --remove-section=.comment --remove-section=.note --preserve-dates

fires the following error

0693W000007CWOMQA4.jpgIf I ignore that error and proceed by copying all files intended by the command

PC $> scp -r install_artifact/lib/modules/* root@<ip of board>:/lib/modules

then I run into memory problems where many modules of the kernel cannot be installed because of insufficient space as shown below.

0693W000007CWVNQA4.jpgDo you have any ideas to go around it? Please @Community member​ and @Sisyphus38​ help with your expertise and experience with this board

MSele.1
Associate II
June 23, 2021

This part of modifying the kernel did not work, so I decided to ignore it.