Lora-net / LoRaMac-node

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

AU915 compilation - CMakeLists.txt needs changing #1409

Open coratron opened 1 year ago

coratron commented 1 year ago

Description

AU915 will not compile due to a missing line (it uses a function in RegionBaseUS.c)

Steps to reproduce

Command:

cmake -DCMAKE_BUILD_TYPE=Release \                                                                                                   ✔  idf4.4_py3.8_env  
        -DTOOLCHAIN_PREFIX="BLABLABLABLA/arm-none-eabi-gcc/11.3.1-1.1.2/.content" \
        -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchain-arm-none-eabi.cmake" \
        -DAPPLICATION="LoRaMac" \
        -DMODULATION="LORA" \
        -DREGION_EU868="OFF" \
        -DREGION_US915="OFF" \
        -DREGION_CN779="OFF" \
        -DREGION_EU433="OFF" \
        -DREGION_AU915="ON" \
        -DREGION_AS923="OFF" \
        -DREGION_CN470="OFF" \
        -DREGION_KR920="OFF" \
        -DREGION_IN865="OFF" \
        -DREGION_RU864="OFF" \
        -DBOARD="NucleoL073" \
        -DMBED_RADIO_SHIELD="SX1262MBXCAS" \
        -DUSE_RADIO_DEBUG="ON" ..

Output after building:

../src/mac/region/RegionAU915.c:870: undefined reference to `RegionBaseUSComputeNext125kHzJoinChannel'

Proposed solution:

Modify CmakeLists.txt inside the "mac" folder, line 73

if(REGION_AU915 STREQUAL ON)
set( MAC_BUILD_SOURCES
     ${MAC_BUILD_SOURCES}
     "${CMAKE_CURRENT_SOURCE_DIR}/region/RegionBaseUS.c"
     "${CMAKE_CURRENT_SOURCE_DIR}/region/RegionAU915.c" )
endif()

I have yet to test that the system works on the hardware.

ndiddy99 commented 4 months ago

I also ran into this situation and did the same fix. It makes me wonder if Semtech ever tested AU915 functionality on the LoRaMac-node stack.

ndiddy99 commented 4 months ago

BTW I tested the device on an AU915 gateway and it did seem to work correctly, so that's good at least.