Fix linking when building without WebUSB support#1109
Open
dgburr wants to merge 1 commit intoARMmbed:mainfrom
Open
Fix linking when building without WebUSB support#1109dgburr wants to merge 1 commit intoARMmbed:mainfrom
dgburr wants to merge 1 commit intoARMmbed:mainfrom
Conversation
…lds will fail with linking errors like: /usr/lib/gcc/arm-none-eabi/14.2.1/../../../arm-none-eabi/bin/ld: build/usbd_core_hid.o: in function `USBD_ReqGetDescriptor_HID': /tmp/DAPLink/projectfiles/make_gcc_arm/stm32f103xb_stm32h743zi_if/../../../source/usb/hid/usbd_core_hid.c:64:(.text.USBD_ReqGetDescriptor_HID+0x78): undefined reference to `usbd_webusb_if_num' /usr/lib/gcc/arm-none-eabi/14.2.1/../../../arm-none-eabi/bin/ld: build/usbd_core_hid.o: in function `USBD_EndPoint0_Setup_HID_ReqToIF': /tmp/DAPLink/projectfiles/make_gcc_arm/stm32f103xb_stm32h743zi_if/../../../source/usb/hid/usbd_core_hid.c:148:(.text.USBD_EndPoint0_Setup_HID_ReqToIF+0x9c): undefined reference to `usbd_webusb_if_num' /usr/lib/gcc/arm-none-eabi/14.2.1/../../../arm-none-eabi/bin/ld: build/usbd_core_hid.o: in function `USBD_EndPoint0_Out_HID_ReqToIF': /tmp/DAPLink/projectfiles/make_gcc_arm/stm32f103xb_stm32h743zi_if/../../../source/usb/hid/usbd_core_hid.c:166:(.text.USBD_EndPoint0_Out_HID_ReqToIF+0x38): undefined reference to `usbd_webusb_if_num' The reason for this is because usbd_core_hid still checks for usbd_webusb_if_num even when USBD_WEBUSB_ENABLE is not defined. This PR addresses this issue, as well as eliminating an unnecessary definition of usbd_webusb_vendor_code when USBD_WEBUSB_ENABLE is not defined.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If
records/usb/usb-webusb.yamlis removed fromprojects.yamlthen builds will fail with linking errors like:The reason for this is because
usbd_core_hid.cstill checks forusbd_webusb_if_numeven whenUSBD_WEBUSB_ENABLEis not defined. This PR addresses this issue, as well as eliminating an unnecessary definition ofusbd_webusb_vendor_codewhenUSBD_WEBUSB_ENABLEis not defined.