matthijskooijman / arduino-lmic

:warning: This library is deprecated, see the README for alternatives.
705 stars 651 forks source link

Cortex M3 Fails to Compile #89

Open will2hew opened 7 years ago

will2hew commented 7 years ago

Trying to use the following module: url, which required a downgrade to Arduino 1.6.0 to use the compiler it required.

However this puts it below the 1.6.6 minimum for arduino-lmic, if I try to add the c++11 flag to the platforms.txt, it fails to compile as 'Cortex M3 is not valid for --params'

Any suggestions?

matthijskooijman commented 7 years ago

I have no clue about this M3 platform and the things needed for that, so I can't come up with anything off-hand. Your report is missing some details, such as links to the exact core/platform.txt you are using, the exact changes you made to add c++11, or the full verbose compiler output, which would help to get an idea of what's happening.

matthijskooijman commented 7 years ago

Also, you messed up the markdown for the link, you had the link text and link url reversed. I fixed that for you.

will2hew commented 7 years ago

See below for the error report WITHOUT attempting to change to a C++11 compiler

Using library IBM LMIC framework in folder: /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master 

/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7153785696326729011.tmp/sketch_apr14c.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7153785696326729011.tmp/sketch_apr14c.cpp.o 
/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/lmic.c -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7153785696326729011.tmp/IBM LMIC framework/aes/lmic.c.o 
/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7153785696326729011.tmp/IBM LMIC framework/aes/other.c.o 
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c: In function 'os_aes_cmac':
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c:64:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (u1_t i = 0; i < 16; ++i, ++buf, --len) {
         ^
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c:64:9: note: use option -std=c99 or -std=gnu99 to compile your code
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c:99:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for (u1_t i = 0; i < sizeof(final_key); ++i)
             ^
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c: In function 'os_aes_ctr':
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c:118:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (u1_t i = 0; i < 16 && len > 0; i++, len--, buf++)
         ^
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c: In function 'os_aes':
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/aes/other.c:134:13: error: 'for' loop initial declarations are only allowed in C99 mode
             for (u1_t i = 0; i < len; i += 16)
             ^
Error compiling.

This is the platform.txt used to try and set the C++11 compiler:

#
#
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

name=Radino32
version=0.1.0

# compiler variables
# ----------------------
build.gcc_ver=gcc-arm-none-eabi-4.8.3-2014q1
compiler.path={runtime.ide.path}/hardware/tools/{build.gcc_ver}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-std=gnu11 -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -DBOARD_{build.variant} -D{build.vect} -DERROR_LED_PORT={build.error_led_port} -DERROR_LED_PIN={build.error_led_pin}
compiler.c.elf.cmd=arm-none-eabi-g++
compiler.c.elf.flags=-Os -Wl,--gc-sections
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c -g -x assembler-with-cpp -MMD
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.flags=-c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_{build.variant} -D{build.vect} -DERROR_LED_PORT={build.error_led_port} -DERROR_LED_PIN={build.error_led_pin}
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O binary
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=
compiler.size.cmd=arm-none-eabi-size
compiler.define=-DARDUINO=

# this can be overriden in boards.txt
build.cpu_flags=
build.hs_flag=
build.common_flags=
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}

# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags="-L{build.variant.path}/ld"
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=

##compiler.libsam.c.flags="-I{build.system.path}/libsam" "-I{build.system.path}/CMSIS/CMSIS/Include/" "-I{build.system.path}/CMSIS/Device/ATMEL/"

##compiler.libs.c.flags="-I{build.system.path}/libmaple" "-I{build.system.path}/libmaple/include" "-I{build.system.path}/libmaple/stm32f1/include" "-I{build.system.path}/libmaple/stm32f1/include/series" "-I{build.system.path}/libmaple/usb/stm32f1" "-I{build.system.path}/libmaple/usb/usb_lib"
compiler.libs.c.flags="-I{build.system.path}/libopenstm32l1" "-I{build.system.path}/libmaple" "-I{build.system.path}/libmaple/include" "-I{build.system.path}/libmaple/stm32f1/include"                                                           "-I{build.system.path}/libmaple/usb/stm32f1" "-I{build.system.path}/libmaple/usb/usb_lib"

# USB Flags
# ---------
## build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'

# Default usb manufacturer will be replaced at compile time using
# numeric vendor ID if available or by board's specific value.
## build.usb_manufacturer="Unknown"

# build patterns
# ---------------------

## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}"

## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}"
#recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" "{source_file}" -o "{object_file}"

## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"

## Combine gc-sections, archives, and objects
##recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group
#-Wl,--entry=__start__
#recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive -Wl,--end-group

## Create eeprom
recipe.objcopy.eep.pattern=

## Create hex
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
#recipe.size.regex=\.text\s+([0-9]+).*
recipe.size.regex=^(?:\.text|\.rodata|\.ARM.exidx)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*

# Uploader tools
# -------------------

# Upload using Maple bootloader over DFU
tools.maple_upload.cmd=maple_upload
tools.maple_upload.cmd.windows=maple_upload.bat
#tools.maple_upload.cmd.linux=maple_upload
tools.maple_upload.path={runtime.hardware.path}/tools/win
tools.maple_upload.path.macosx={runtime.hardware.path}/tools/macosx
tools.maple_upload.path.linux={runtime.hardware.path}/tools/linux

tools.maple_upload.upload.params.verbose=-d
tools.maple_upload.upload.params.quiet=
tools.maple_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"

#Added tool for generic STM32 upload via serial to Serial Port 1 (pins PA9 and PA10) - note. Boot0 line needs to high on board reset to enable upload via serial
# at the end up the upload the program is automatically run, without the board being reset

tools.serial_upload.cmd=serial_upload
tools.serial_upload.cmd.windows=serial_upload.bat
tools.serial_upload.cmd.macosx=serial_upload
tools.serial_upload.path={runtime.hardware.path}/tools/win
tools.serial_upload.path.macosx={runtime.hardware.path}/tools/macosx
tools.serial_upload.path.linux={runtime.hardware.path}/tools/linux

tools.serial_upload.upload.params.verbose=-d
tools.serial_upload.upload.params.quiet=
tools.serial_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"

tools.upload_router.cmd=upload_router
tools.upload_router.cmd.windows=upload_router.bat
#tools.upload_router.cmd.linux=
tools.upload_router.path={runtime.hardware.path}/tools/win

tools.upload_router.upload.params.verbose=-d
tools.upload_router.upload.params.quiet=
tools.upload_router.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}" {upload.protocol} {build.debuggingMode} "{runtime.ide.path}/hardware/tools/{build.gcc_ver}/bin/"

# stlink upload
tools.stlink_upload.cmd=stlink_upload
tools.stlink_upload.cmd.windows=stlink_upload.bat
tools.stlink_upload.path.windows={runtime.hardware.path}/tools/win
tools.stlink_upload.path.macosx={runtime.hardware.path}/tools/macosx
tools.stlink_upload.path.linux={runtime.hardware.path}/tools/linux

tools.stlink_upload.upload.params.verbose=-d
tools.stlink_upload.upload.params.quiet=
tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"

It seems to have successfully set the C11 compiler now, as I am not getting issues with creating variables in the for loop headers, however, am getting the following compiler errors now:

Arduino: 1.6.1 (Mac OS X), Board: "Radino32 USB-Load"

Using library SPI in folder: /Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI (legacy)
Using library IBM LMIC framework in folder: /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master 

/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/sketch_apr14c.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/sketch_apr14c.cpp.o 
/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI/utility /Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI/SPI.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/SPI/SPI.cpp.o 
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/IBM LMIC framework/aes/lmic.c.o
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/IBM LMIC framework/aes/other.c.o
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/IBM LMIC framework/aes/ideetron/AES-128_V10.cpp.o
/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/F42A92CD-796D-4FDE-B3A8-D4B0C08F8825/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build7055871646421731635.tmp/IBM LMIC framework/hal/hal.cpp.o 
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp: In function 'u4_t hal_ticks()':
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp:136:30: error: 'micros' was not declared in this scope
     uint32_t scaled = micros() >> US_PER_OSTICK_EXPONENT;
                              ^
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp:154:115: error: 'static_assert' was not declared in this scope
     static_assert(US_PER_OSTICK_EXPONENT > 0 && US_PER_OSTICK_EXPONENT < 8, "Invalid US_PER_OSTICK_EXPONENT value");
                                                                                                                   ^
Error compiling.

Perhaps to do with the version of the Arduino IDE being older?

matthijskooijman commented 7 years ago

Seems you added c11 support, but not c++11. Try adding -std=gnu++11 (IIRC) to compiler.cpp.flags.

will2hew commented 7 years ago

Solved every single issue but the fact that the micros() function is still unavailable.

I tested it just by setting the relevant variable equal to millis(), which is definitely supported, and it compiled fine. Are there any alternative functions to micros?

See the error report:

Arduino: 1.6.1 (Mac OS X), Board: "Radino32 USB-Load"

Using library IBM LMIC framework in folder: /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master 
Using library SPI in folder: /Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI (legacy)

/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/5D768DED-CD0D-4CFE-B30F-5BEAA2FD3DA5/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -std=gnu++11 -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/ttn-abp.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/ttn-abp.cpp.o 
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/IBM LMIC framework/aes/lmic.c.o
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/IBM LMIC framework/aes/other.c.o
Using previously compiled file: /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/IBM LMIC framework/aes/ideetron/AES-128_V10.cpp.o
/private/var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/AppTranslocation/5D768DED-CD0D-4CFE-B30F-5BEAA2FD3DA5/d/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -std=gnu++11 -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_radino32 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=24000000L -DARDUINO=10601 -DARDUINO_RADINO32 -DARDUINO_ARCH_STM32L1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32L1__ -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libopenstm32l1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/stm32f1/include -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/stm32f1 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/system/libmaple/usb/usb_lib -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/cores/radino32 -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/variants/radino32 -I/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src -I/Users/hewittwill/Documents/Arduino/hardware/ICT_Boards/stm32l1/libraries/SPI /Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp -o /var/folders/wc/dfpc_z2j779517nsdnj0l2_w0000gn/T/build1609351609630272981.tmp/IBM LMIC framework/hal/hal.cpp.o 
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp: In function 'u4_t hal_ticks()':
/Users/hewittwill/Documents/Arduino/libraries/arduino-lmic-master/src/hal/hal.cpp:136:30: error: 'micros' was not declared in this scope
     uint32_t scaled = micros() >> US_PER_OSTICK_EXPONENT;
                              ^
Error compiling.
Oliv4945 commented 7 years ago

I tested it just by setting the relevant variable equal to millis(), which is definitely supported, and it compiled fine. Are there any alternative functions to micros? On the STM32L151 you can use the SysTick.

Also I am a bit surprised by the flag "-DMCU_STM32F103CB" as the module embed an STM32L151 You should consider to use Semtech or mBed stacks, they have been developed on you uC.

will2hew commented 7 years ago

Cheers @Oliv4945

I've yet to test it, but the plan thus far is to use the Timers to create a manual micros() function and implement that in the library.

I was hoping I'd be able to use this module and then not have to learn how to use the mBed platform, as I haven't had any experience with it, so we shall see!

rk125 commented 7 years ago

Hi, I was having same errors trying to compile for STM32F103C board with original stm32duino and arduino-lmic. Try this good guy's work from here https://github.com/tomtor/Arduino_STM32 and https://github.com/tomtor/arduino-lmic - after changing compile is good so far.