Lora-net / LoRaMac-node

Reference implementation and documentation of a LoRa network node.
Other
1.87k stars 1.09k forks source link

No hex and bin files output #576

Closed Lozeonjyu closed 5 years ago

Lozeonjyu commented 5 years ago

Hi,

I was trying to use my L073+SX1261 shield to load the code but I couldn't find the bin file. When I trace back the makefile under "apps" I can see

create_bin_output(${PROJECT_NAME}-${CLASS}) create_hex_output(${PROJECT_NAME}-${CLASS})

Should these two commands generate the hex and bin files? If not, how can I generate the bin file or load the code to L073?

Thanks

djaeckle commented 5 years ago

Hi Lozeonjyu,

Should these two commands generate the hex and bin files?

Yes. After a succssful build, you will find the binaries in directory (e.g. LoRaMac Class A) build/src/apps/LoRaMac.

Lozeonjyu commented 5 years ago

Hi Lozeonjyu,

Should these two commands generate the hex and bin files?

Yes. After a succssful build, you will find the binaries in directory (e.g. LoRaMac Class A) build/src/apps/LoRaMac.

That's wired. I didn't see it. Could that be the setup problem? I was told that I should see a map file after generate but I couldn't find that either. I am sure I am looking at the right directory.

ConnyBusy commented 5 years ago

Hi Lozeonjyu, which commands did you run. Generally, you have to run CMake and after that run Make to generate/build the bin and hex files. Could you also provide which tools you are using to build the executables?

Lozeonjyu commented 5 years ago

Hi Lozeonjyu, which commands did you run. Generally, you have to run CMake and after that run Make to generate/build the bin and hex files. Could you also provide which tools you are using to build the executables?

Actually, I used CMake-GUI. specified toolchain-arm-none-eabi.cmake as toolchain, configured, then generated.

Before that I make sure I have tools installed (windows): Cmake GNU Arm Embedded Toolchain MinGW OpenOCD

ConnyBusy commented 5 years ago

Please, could you also provide a screenshot of your CMake-GUI settings and your paths. This will be useful to figure out if it's a configuration issue. Are you able to run generate without any errors?

djaeckle commented 5 years ago

Hi,

plase take a look at the Wiki: Development-environment. The easiest way to verify if your build system is setup correctly is to run cmake on the console. After you have cloned the repository, you could do:

$: cd LoRaMac-node $: mkdir build $: cd build $: cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" -DTOOLCHAIN_PREFIX="/path/to/the/toolchain" -G "MinGW Makefiles" ..

mluis1 commented 5 years ago

In plus of the commands provided by @djaeckle you need to run the make command. $: make

Please find below an example provided on issue #504

MSYS /c/loramac-node$
MSYS /c/loramac-node$ mkdir build
MSYS /c/loramac-node$ cd build
MSYS /c/loramac-node/build$ cmake -DCMAKE_BUILD_TYPE=Debug \
           -DTOOLCHAIN_PREFIX="/c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major" \
           -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchain-arm-none-eabi.cmake" \
           -DAPPLICATION="LoRaMac" \
           -DCLASS="classA" \
           -DCLASSB_ENABLED="OFF" \
           -DACTIVE_REGION="LORAMAC_REGION_EU868" \
           -DREGION_EU868="ON" \
           -DREGION_US915="OFF" \
           -DREGION_CN779="OFF" \
           -DREGION_EU433="OFF" \
           -DREGION_AU915="OFF" \
           -DREGION_AS923="OFF" \
           -DREGION_CN470="OFF" \
           -DREGION_KR920="OFF" \
           -DREGION_IN865="OFF" \
           -DREGION_RU864="OFF" \
           -DBOARD="NucleoL073" \
           -DMBED_RADIO_SHIELD="SX1262DVK1CAS"  ..

-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: /c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc
-- Check for working C compiler: /c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-g++
-- Check for working CXX compiler: /c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Linker script: /c/loramac-node/src/boards/NucleoL073/cmsis/arm-gcc/stm32l073xx_flash.ld
-- The ASM compiler identification is GNU
-- Found assembler: /c/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /c/loramac-node/build

MSYS /c/loramac-node/build$ make -j 4

Scanning dependencies of target peripherals
Scanning dependencies of target NucleoL073
Scanning dependencies of target radio
Scanning dependencies of target system
[  1%] Building C object src/radio/CMakeFiles/radio.dir/sx126x/radio.c.obj
[  2%] Building C object src/peripherals/CMakeFiles/peripherals.dir/gpio-ioe.c.obj
[  3%] Building C object src/system/CMakeFiles/system.dir/adc.c.obj
[  5%] Building C object src/radio/CMakeFiles/radio.dir/sx126x/sx126x.c.obj
[  6%] Building C object src/system/CMakeFiles/system.dir/delay.c.obj
[  7%] Building C object src/peripherals/CMakeFiles/peripherals.dir/mag3110.c.obj
[  8%] Building C object src/system/CMakeFiles/system.dir/eeprom.c.obj
[  8%] Built target radio
[ 10%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/board.c.obj
[ 11%] Building C object src/peripherals/CMakeFiles/peripherals.dir/mma8451.c.obj
Scanning dependencies of target mac
[ 12%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMac.c.obj
[ 13%] Building C object src/system/CMakeFiles/system.dir/fifo.c.obj
[ 15%] Building C object src/peripherals/CMakeFiles/peripherals.dir/mpl3115.c.obj
[ 16%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/delay-board.c.obj
[ 17%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacAdr.c.obj
[ 18%] Building C object src/system/CMakeFiles/system.dir/gpio.c.obj
[ 20%] Building C object src/peripherals/CMakeFiles/peripherals.dir/pam7q.c.obj
[ 21%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/eeprom-board.c.obj
[ 22%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacClassB.c.obj
[ 24%] Building C object src/system/CMakeFiles/system.dir/gps.c.obj
[ 25%] Building C object src/peripherals/CMakeFiles/peripherals.dir/sx1509.c.obj
[ 26%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/gpio-board.c.obj
[ 27%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacCommands.c.obj
[ 29%] Building C object src/system/CMakeFiles/system.dir/i2c.c.obj
[ 30%] Building C object src/peripherals/CMakeFiles/peripherals.dir/sx9500.c.obj
[ 31%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/lpm-board.c.obj
[ 32%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacConfirmQueue.c.obj
[ 34%] Building C object src/system/CMakeFiles/system.dir/nvmm.c.obj
[ 35%] Building C object src/peripherals/CMakeFiles/peripherals.dir/soft-se/aes.c.obj
[ 36%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/rtc-board.c.obj
[ 37%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacCrypto.c.obj
[ 39%] Building C object src/system/CMakeFiles/system.dir/systime.c.obj
[ 40%] Building C object src/peripherals/CMakeFiles/peripherals.dir/soft-se/cmac.c.obj
[ 41%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/spi-board.c.obj
[ 43%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacFCntHandler.c.obj
[ 44%] Building C object src/system/CMakeFiles/system.dir/timer.c.obj
[ 45%] Building C object src/peripherals/CMakeFiles/peripherals.dir/soft-se/soft-se.c.obj
[ 46%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/uart-board.c.obj
[ 48%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacParser.c.obj
[ 49%] Building C object src/system/CMakeFiles/system.dir/uart.c.obj
[ 49%] Built target peripherals
[ 50%] Building C object src/mac/CMakeFiles/mac.dir/LoRaMacSerializer.c.obj
[ 51%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/sysIrqHandlers.c.obj
[ 51%] Built target system
[ 53%] Building C object src/mac/CMakeFiles/mac.dir/region/Region.c.obj
[ 54%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/utilities.c.obj
[ 55%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionAS923.c.obj
[ 56%] Building ASM object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/cmsis/arm-gcc/startup_stm32l073xx.s.obj
[ 58%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionAU915.c.obj
[ 59%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/cmsis/system_stm32l0xx.c.obj
[ 60%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionCN470.c.obj
[ 62%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c.obj
[ 63%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionCN779.c.obj
[ 64%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_adc.c.obj
[ 65%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionCommon.c.obj
[ 67%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_adc_ex.c.obj
[ 68%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionEU433.c.obj
[ 69%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.c.obj
[ 70%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionEU868.c.obj
[ 72%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c.obj
[ 73%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionIN865.c.obj
[ 74%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.c.obj
[ 75%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionKR920.c.obj
[ 77%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ex.c.obj
[ 78%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionRU864.c.obj
[ 79%] Building C object src/mac/CMakeFiles/mac.dir/region/RegionUS915.c.obj
[ 81%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_gpio.c.obj
[ 82%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c.c.obj
[ 83%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_i2c_ex.c.obj
[ 83%] Built target mac
[ 84%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr.c.obj
[ 86%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr_ex.c.obj
[ 87%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc.c.obj
[ 88%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc_ex.c.obj
[ 89%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rtc.c.obj
[ 91%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rtc_ex.c.obj
[ 92%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_spi.c.obj
[ 93%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart.c.obj
[ 94%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/__/mcu/stm32/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart_ex.c.obj
[ 96%] Building C object src/boards/NucleoL073/CMakeFiles/NucleoL073.dir/sx1262dvk1cas-board.c.obj
[ 96%] Built target NucleoL073
Scanning dependencies of target LoRaMac-classA
[ 97%] Building C object src/apps/LoRaMac/CMakeFiles/LoRaMac-classA.dir/common/NvmCtxMgmt.c.obj
[ 98%] Building C object src/apps/LoRaMac/CMakeFiles/LoRaMac-classA.dir/classA/NucleoL073/main.c.obj
[100%] Linking C executable LoRaMac-classA
   text    data     bss     dec     hex filename
  74536     408    6928   81872   13fd0 LoRaMac-classA
[100%] Built target LoRaMac-classA
Scanning dependencies of target LoRaMac-classA.hex
Scanning dependencies of target LoRaMac-classA.bin
[100%] Built target LoRaMac-classA.hex
[100%] Built target LoRaMac-classA.bin
Lozeonjyu commented 5 years ago

Please, could you also provide a screenshot of your CMake-GUI settings and your paths. This will be useful to figure out if it's a configuration issue. Are you able to run generate without any errors?

Please check the pics below: 1 2

Config: 3

Generate: 4

It seems all right according to the message window. No warning/error pop-ups during config and generate.

Environment variable on my laptop: 5

Thanks a lot. 😃

Lozeonjyu commented 5 years ago

Hi,

plase take a look at the Wiki: Development-environment. The easiest way to verify if your build system is setup correctly is to run cmake on the console. After you have cloned the repository, you could do:

$: cd LoRaMac-node $: mkdir build $: cd build $: cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" -DTOOLCHAIN_PREFIX="/path/to/the/toolchain" -G "MinGW Makefiles" ..

Thanks guys @djaeckle @mluis1 I will try on the console. I used GUI at the first place because it is easier for me to do the config.

mluis1 commented 5 years ago

You must execute the make command after using your GUI. The cmake-gui only generates the makefiles. The make command is the one that performs the compilation tasks based on the cmake-gui generated makefiles.

Lozeonjyu commented 5 years ago

You must execute the make command after using your GUI. The cmake-gui only generates the makefiles. The make command is the one that performs the compilation tasks based on the cmake-gui generated makefiles.

Got it! Problem solved. On windows with MinGW the make command is ming32-make.exe Thanks for reminding, it saves me a lot of time.