Skip to main content
MKana.1
Associate
Jan 15, 2020 21:17 UTC
Question

Compilation error while rebuild kernel

Hi hope you're well. 

I got stuck on part 6.Compile kernel source code->Compile and install on the current source code directory->make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040 giving an error as below. Thanks in advance!

 CC     drivers/usb/dwc2/core.o

 CC     drivers/usb/dwc2/core_intr.o

 CC     drivers/usb/dwc2/platform.o

 CC     drivers/usb/dwc2/drd.o

drivers/usb/dwc2/drd.c: In function ‘dwc2_drd_update’:

drivers/usb/dwc2/drd.c:86:35: error: ‘struct dwc2_hsotg’ has no member named ‘test_mode’; did you mean ‘dr_mode’?

 if (!avalid && !bvalid && hsotg->test_mode) {

                                  ^~~~~~~~~

                                  dr_mode

drivers/usb/dwc2/drd.c:123:4: error: implicit declaration of function ‘dwc2_hsotg_core_disconnect’; did you mean ‘dwc2_hsotg_core_connect’? [-Werror=implicit-function-declaration]

   dwc2_hsotg_core_disconnect(hsotg);

   ^~~~~~~~~~~~~~~~~~~~~~~~~~

   dwc2_hsotg_core_connect

cc1: some warnings being treated as errors

scripts/Makefile.build:303: recipe for target 'drivers/usb/dwc2/drd.o' failed

make[3]: *** [drivers/usb/dwc2/drd.o] Error 1

scripts/Makefile.build:544: recipe for target 'drivers/usb/dwc2' failed

make[2]: *** [drivers/usb/dwc2] Error 2

scripts/Makefile.build:544: recipe for target 'drivers/usb' failed

make[1]: *** [drivers/usb] Error 2

Makefile:1044: recipe for target 'drivers' failed

make: *** [drivers] Error 2

This topic has been closed for replies.

8 replies

Olivier GALLIEN
ST Technical Moderator
Jan 16, 2020 11:47 UTC

Hi @MKana.1​ 

Did you made change in kernel source before to compile ?

Did you properly apply patches ?

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.
MKana.1
MKana.1Author
Associate
Jan 17, 2020 07:32 UTC

1- No I didn't change anything even I didn't use git part if there is change that I might not know. Even it doesnt change if I use git.

2- I think I do everything as written. I know I did something wrong because it's tested and validated.

So you say the problem can be caused by unproper patch apply or changing kernel source codes. Could it be caused because of compiler or virtualbox or something else?

koan
Associate II
Jan 22, 2020 13:51 UTC

Hi @MKana.1​ which document are you following?

MKana.1
MKana.1Author
Associate
Jan 24, 2020 08:38 UTC

Sorry for late response. I'm following STM32MP1 Developer Package of Development zone. Link: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

koan
Associate II
Jan 24, 2020 09:45 UTC

Hi @MKana.1​ ,

as @Community member​ already told you, just after you uncompressed the tarball you have to apply the patches included in the tarball.

Read carefully the file README.HOW_TO.txt

I don't know why ST is releasing sources in a so fragmented way instead of pre-applying the patches in the kernel.

Distinti Saluti / Best Regards

--

Marco Cavallini | KOAN sas | Bergamo - Italia

embedded software engineering

Phone:+39 035-255.235

https://KoanSoftware.com

VCvet.1
Visitor II
Jun 12, 2020 23:02 UTC

del this parameter and comment function 123: dwc2_hsotg_core_disconnect(hsotg);

all build and work :)

AmelieD
Visitor II
Jul 29, 2020 13:33 UTC

Hi @MKana.1​ ,

This build issue occurs if you're compiling the kernel with CONFIG_DWC2_HOST.

Normally, if you apply OpenSTLinux fragments (also available here: https://github.com/STMicroelectronics/meta-st-stm32mp/tree/thud/recipes-kernel/linux/linux-stm32mp/4.19) in addition to multi_v7_defconfig, kernel should be compiled with CONFIG_USB_DWC2_DUAL_ROLE and you shouldn't have build issue.

Anyway, a patch has been released on github to fix this build issue with drivers/usb/dwc2/drd.c : https://github.com/STMicroelectronics/linux/commit/2065bb653d0dfdcc7c5200512f00128685c9a0ca

Regards,

Amelie

NPal.2
Associate III
Nov 27, 2021 14:53 UTC

Hi ,

thanks for the response. But even after applying everything on the latest tarball I am running into this error. 5.10.16 - Kernel Version

drivers/usb/dwc2/params.c: In function ‘dwc2_set_param_otg_cap’:
drivers/usb/dwc2/params.c:245:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.hnp_support = true;
 ^~
drivers/usb/dwc2/params.c:246:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.srp_support = true;
 ^~
drivers/usb/dwc2/params.c:252:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.hnp_support = false;
 ^~
drivers/usb/dwc2/params.c:253:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.srp_support = true;
 ^~
drivers/usb/dwc2/params.c:257:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.hnp_support = false;
 ^~
drivers/usb/dwc2/params.c:258:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.srp_support = false;
 ^~
drivers/usb/dwc2/params.c:263:7: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.otg_rev = hsotg->params.otg_rev;
 ^~
drivers/usb/dwc2/params.c: In function ‘dwc2_get_device_properties’:
drivers/usb/dwc2/params.c:472:53: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 of_usb_update_otg_caps(hsotg->dev->of_node, &hsotg->dw_otg_caps);
 ^~
drivers/usb/dwc2/params.c: In function ‘dwc2_check_param_otg_cap’:
drivers/usb/dwc2/params.c:493:9: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.hnp_support = false;
 ^~
drivers/usb/dwc2/params.c:502:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.hnp_support = false;
 ^~
drivers/usb/dwc2/params.c:503:8: error: ‘struct dwc2_hsotg’ has no member named ‘dw_otg_caps’
 hsotg->dw_otg_caps.srp_support = false;

Trying to figure out for few days now. Any inputs will be appreciated.