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

Compiling under OSX #14

Open
apowers313 opened this issue Jan 2, 2017 · 1 comment
Open

Compiling under OSX #14

apowers313 opened this issue Jan 2, 2017 · 1 comment

Comments

@apowers313
Copy link

I'm trying to compile under OSX. After modifying stm32.mak (update TOOLCHAIN_ROOT, remove .exe from tools, change tool names to arm-none-eabi-*... I'll submit a PR once I get something working), the compile runs all the way to linking.

Then I get this error:

/Users/apowers/Projects/ctap-stm32/gcc-arm-none-eabi-5_4-2016q3//bin/arm-none-eabi-g++ -o Debug/stm32-u2f.elf -Wl,-gc-sections -TBSP/STM32F407VG_flash.lds -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Wl,--start-group Debug/startup_stm32f407xx.o Debug/stm32f4xx_hal.o Debug/stm32f4xx_hal_adc.o Debug/stm32f4xx_hal_adc_ex.o Debug/stm32f4xx_hal_can.o Debug/stm32f4xx_hal_cec.o Debug/stm32f4xx_hal_cortex.o Debug/stm32f4xx_hal_crc.o Debug/stm32f4xx_hal_cryp.o Debug/stm32f4xx_hal_cryp_ex.o Debug/stm32f4xx_hal_dac.o Debug/stm32f4xx_hal_dac_ex.o Debug/stm32f4xx_hal_dcmi.o Debug/stm32f4xx_hal_dcmi_ex.o Debug/stm32f4xx_hal_dma.o Debug/stm32f4xx_hal_dma2d.o Debug/stm32f4xx_hal_dma_ex.o Debug/stm32f4xx_hal_dsi.o Debug/stm32f4xx_hal_eth.o Debug/stm32f4xx_hal_flash.o Debug/stm32f4xx_hal_flash_ex.o Debug/stm32f4xx_hal_flash_ramfunc.o Debug/stm32f4xx_hal_fmpi2c.o Debug/stm32f4xx_hal_fmpi2c_ex.o Debug/stm32f4xx_hal_gpio.o Debug/stm32f4xx_hal_hash.o Debug/stm32f4xx_hal_hash_ex.o Debug/stm32f4xx_hal_hcd.o Debug/stm32f4xx_hal_i2c.o Debug/stm32f4xx_hal_i2c_ex.o Debug/stm32f4xx_hal_i2s.o Debug/stm32f4xx_hal_i2s_ex.o Debug/stm32f4xx_hal_irda.o Debug/stm32f4xx_hal_iwdg.o Debug/stm32f4xx_hal_lptim.o Debug/stm32f4xx_hal_ltdc.o Debug/stm32f4xx_hal_ltdc_ex.o Debug/stm32f4xx_hal_nand.o Debug/stm32f4xx_hal_nor.o Debug/stm32f4xx_hal_pccard.o Debug/stm32f4xx_hal_pcd.o Debug/stm32f4xx_hal_pcd_ex.o Debug/stm32f4xx_hal_pwr.o Debug/stm32f4xx_hal_pwr_ex.o Debug/stm32f4xx_hal_qspi.o Debug/stm32f4xx_hal_rcc.o Debug/stm32f4xx_hal_rcc_ex.o Debug/stm32f4xx_hal_rng.o Debug/stm32f4xx_hal_rtc.o Debug/stm32f4xx_hal_rtc_ex.o Debug/stm32f4xx_hal_sai.o Debug/stm32f4xx_hal_sai_ex.o Debug/stm32f4xx_hal_sd.o Debug/stm32f4xx_hal_sdram.o Debug/stm32f4xx_hal_smartcard.o Debug/stm32f4xx_hal_spdifrx.o Debug/stm32f4xx_hal_spi.o Debug/stm32f4xx_hal_sram.o Debug/stm32f4xx_hal_tim.o Debug/stm32f4xx_hal_tim_ex.o Debug/stm32f4xx_hal_uart.o Debug/stm32f4xx_hal_usart.o Debug/stm32f4xx_hal_wwdg.o Debug/stm32f4xx_ll_fmc.o Debug/stm32f4xx_ll_fsmc.o Debug/stm32f4xx_ll_sdmmc.o Debug/stm32f4xx_ll_usb.o Debug/usbd_hid.o Debug/usbd_core.o Debug/usbd_ctlreq.o Debug/usbd_ioreq.o Debug/main.o Debug/aes.o Debug/aesni.o Debug/arc4.o Debug/asn1parse.o Debug/asn1write.o Debug/base64.o Debug/bignum.o Debug/blowfish.o Debug/camellia.o Debug/ccm.o Debug/certs.o Debug/cipher.o Debug/cipher_wrap.o Debug/ctr_drbg.o Debug/debug.o Debug/des.o Debug/dhm.o Debug/ecdh.o Debug/ecdsa.o Debug/ecjpake.o Debug/ecp.o Debug/ecp_curves.o Debug/entropy.o Debug/entropy_poll.o Debug/error.o Debug/gcm.o Debug/havege.o Debug/hmac_drbg.o Debug/md.o Debug/md2.o Debug/md4.o Debug/md5.o Debug/md_wrap.o Debug/memory_buffer_alloc.o Debug/oid.o Debug/padlock.o Debug/pem.o Debug/pk.o Debug/pkcs11.o Debug/pkcs12.o Debug/pkcs5.o Debug/pkparse.o Debug/pkwrite.o Debug/pk_wrap.o Debug/platform.o Debug/ripemd160.o Debug/rsa.o Debug/sha1.o Debug/sha256.o Debug/sha512.o Debug/ssl_cache.o Debug/ssl_ciphersuites.o Debug/ssl_cli.o Debug/ssl_cookie.o Debug/ssl_srv.o Debug/ssl_ticket.o Debug/ssl_tls.o Debug/threading.o Debug/timing.o Debug/version.o Debug/version_features.o Debug/x509.o Debug/x509write_crt.o Debug/x509write_csr.o Debug/x509_create.o Debug/x509_crl.o Debug/x509_crt.o Debug/x509_csr.o Debug/xtea.o Debug/stm32f4xx_hal_msp.o Debug/stm32f4xx_it.o Debug/stm32_entropy.o Debug/system_stm32f4xx.o Debug/u2f_messages.o Debug/uart_printf.o Debug/usbd_conf.o Debug/usbd_desc.o Debug/usbd_u2fhid.o Debug/usbd_u2f_hid_if.o Debug/usb_device.o -lcompactcpp -Wl,--end-group
/Users/apowers/Projects/ctap-stm32/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: cannot find -lcompactcpp
collect2: error: ld returned 1 exit status

All I see is that stm32.mak adds compactcpp to LIBRARY_NAMES... I'm not quite sure where to pick up this library so that I can link it in.

Any hints would be appreciated.

@apowers313
Copy link
Author

Turns out you can just drop compactcpp... looks like it's a VisualGDB library.

Here's a working stm32.mak for OSX:

#This file is generated by VisualGDB.
#It contains GCC settings automatically derived from the board support package (BSP).
#DO NOT EDIT MANUALLY. THE FILE WILL BE OVERWRITTEN. 
#Use VisualGDB Project Properties dialog or modify Makefile or per-configuration .mak files instead.

#VisualGDB provides BSP_ROOT and TOOLCHAIN_ROOT via environment when running Make. The line below will only be active if GNU Make is started manually.
BSP_ROOT ?= BSP
EFP_BASE ?= ../../../../Users/Aviv Greenberg/AppData/Local/VisualGDB/EmbeddedEFPs
TOOLCHAIN_ROOT ?= /Users/apowers/Projects/ctap-stm32/gcc-arm-none-eabi-5_4-2016q3/

#Embedded toolchain
CC := $(TOOLCHAIN_ROOT)/bin/arm-none-eabi-gcc
CXX := $(TOOLCHAIN_ROOT)/bin/arm-none-eabi-g++
LD := $(CXX)
AR := $(TOOLCHAIN_ROOT)/bin/arm-none-eabi-ar
OBJCOPY := $(TOOLCHAIN_ROOT)/bin/arm-none-eabi-objcopy

#Additional flags
PREPROCESSOR_MACROS += ARM_MATH_CM4 STM32F407VG USE_USB_FS stm32_flash_layout STM32F407xx
INCLUDE_DIRS += . $(BSP_ROOT)/STM32_USB_Device_Library/Core/Inc $(BSP_ROOT)/STM32_USB_Device_Library/Class/HID/Inc $(BSP_ROOT)/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc $(BSP_ROOT)/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc/Legacy $(BSP_ROOT)/STM32F4xxxx/CMSIS_HAL/Device/ST/STM32F4xx/Include $(BSP_ROOT)/STM32F4xxxx/CMSIS_HAL/Include $(BSP_ROOT)/STM32F4xxxx/CMSIS_HAL/RTOS/Template
LIBRARY_DIRS += 
#LIBRARY_NAMES += compactcpp
#-specs=nono.specs
ADDITIONAL_LINKER_INPUTS += -specs=nosys.specs --specs=rdimon.specs -lc -lrdimon
MACOS_FRAMEWORKS += 
LINUX_PACKAGES += 

CFLAGS += --specs=rdimon.specs -lc -lrdimon
CXXFLAGS += 
ASFLAGS += -mfpu=fpv4-sp-d16
LDFLAGS +=  
COMMONFLAGS += -mcpu=cortex-m4 -mthumb -mfloat-abi=soft
LINKER_SCRIPT := $(BSP_ROOT)/STM32F407VG_flash.lds

I'd submit a PR, but it looks like this file might be automatically generated / overwritten by VisualGDB.

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

No branches or pull requests

1 participant