Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix STM32G0 build. #2197

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Fix STM32G0 build. #2197

merged 1 commit into from
Aug 2, 2023

Conversation

HiFiPhile
Copy link
Collaborator

@HiFiPhile HiFiPhile commented Aug 1, 2023

Describe the PR
Fix complaining of missing HAL PWR & DMA source file.

Weird CI is passing...

python3 tools/build_family.py stm32g0
...
/Src/stm32g0xx_hal_rcc_ex.o: in function `??HAL_RCCEx_DisableLSCO_1':
/home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_rcc_ex.c:(.text+0xb2e): undefined reference to `HAL_PWR_DisableBkUpAccess'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: _build/stm32g0b1nucleo/obj/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.o: in function `??HAL_UART_Transmit_DMA_4':
/home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.c:(.text+0x68c): undefined reference to `HAL_DMA_Start_IT'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: _build/stm32g0b1nucleo/obj/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.o: in function `HAL_UART_DMAStop':
/home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.c:(.text+0x8c2): undefined reference to `HAL_DMA_Abort'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.c:(.text+0x8cc): undefined reference to `HAL_DMA_GetError'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.c:(.text+0x916): undefined reference to `HAL_DMA_Abort'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/tusb/tinyusb/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.c:(.text+0x922): undefined reference to `HAL_DMA_GetError'
/opt/arm-none-eabi-gcc/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: _build/stm32g0b1nucleo/obj/hw/mcu/st/stm32g0xx_hal_driver/Src/stm32g0xx_hal_uart.o: in function `??HAL_UART_Abort_0':

Additional context
There is another error when RTT logger is enabled, but I'm not sure the best way to fix it.

tusb@tusb:~/tinyusb/examples/device/cdc_dual_ports$ make BOARD=stm32g0b1nucleo LOGGER=rtt
CC SEGGER_RTT.o
/home/tusb/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c: In function '_DoInit':
/home/tusb/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c:323:10: error: cast discards 'volatile' qualifier from pointer target type [-Werror=cast-qual]
  323 |   memset((SEGGER_RTT_CB*)p, 0, sizeof(_SEGGER_RTT));         // Make sure that the RTT CB is always zero initialized.
      |          ^
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
make: *** [/home/tusb/tinyusb/tools/make/toolchain/arm_gcc_rules.mk:56: _build/stm32g0b1nucleo/obj/lib/SEGGER_RTT/RTT/SEGGER_RTT.o] Error 1

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look great, yeah. G0 is build with cmake on ci. CMake hasa fine-grain control for cflags, and it build all sdk driver as an lib without warning which is out of scope for tinyub. Maybe I should change make to build sdk as lib as well when having time.

@hathach hathach merged commit 2cf869c into hathach:master Aug 2, 2023
@HiFiPhile HiFiPhile deleted the fix_g0 branch April 26, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants