Problems running mbed-os-example-lorawan on SFE_ARTEMIS_THING_PLUS Target

megasupermaxi
Fri, 11 Jun 2021 13:05:06 +0000
Bug Reports / Issues

Hello,

I am trying to get the mbed-os-example-lorawan to run on the SparkFun LoRa Thing Plus.

The SparkFun LoRa Thing Plus is based on the NM180100 system in package which consists of an SX1262 LoRa Modem and the Ambiq Apollo 3.

The Board is very similiar to the SparkFun Artemis Thing Plus, except for the LoRa Modem. I want to use the “SFE_ARTEMIS_THING_PLUS” Target (should I rather create a new target?), therefore I added the LoRa Modem Pin Connections at

 \mbed-os\targets\TARGET_Ambiq_Micro\TARGET_Apollo3\TARGET_SFE_ARTEMIS_THING_PLUS\PinNames.h

according to the NM180100 Datasheet :

    //SX1262 LoRa Interface Pins (Added by me)
	LORA_MOSI = 38,
	LORA_MISO = 43,
	LORA_SCK = 42,
	LORA_NSS = 36,
	LORA_RESET = 44,
	LORA_BUSY = 39,
	LORA_DIO1 = 40,
	LORA_DIO3 = 47,

I have imported the mbed-os-example-lorawan github repository to my workspace with a new mbed os instance and added my board to the mbed_app.json file:

        },
            "SFE_ARTEMIS_THING_PLUS": {
            "target.components_add":            ["SX126X"],
            "SX126X-lora-driver.spi-mosi":       "LORA_MOSI",
            "SX126X-lora-driver.spi-miso":       "LORA_MISO",
            "SX126X-lora-driver.spi-sclk":       "LORA_SCK",
            "SX126X-lora-driver.spi-cs":         "LORA_NSS",
            "SX126X-lora-driver.reset":          "LORA_RESET",
            "SX126X-lora-driver.dio1":           "LORA_DIO1",
            "SX126X-lora-driver.busy":           "LORA_BUSY"
        }

Unfortunately I am getting the following compiler error:

[Error] SX126X_LoRaRadio.h@310,11: no type named 'AnalogIn' in namespace 'mbed'
[Error] SX126X_LoRaRadio.h@313,11: no type named 'AnalogIn' in namespace 'mbed'
[Error] main.cpp@83,25: no matching constructor for initialization of 'LoRaWANInterface'
[Warning] main.cpp@180,26: 'call_in' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[Warning] main.cpp@180,26: 'call_in<void (*)()>' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[Warning] main.cpp@224,26: 'call_every' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[Warning] main.cpp@224,26: 'call_every<void (*)()>' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[ERROR] In file included from .\main.cpp:26:
In file included from ./lora_radio_helper.h:66:
./mbed-os/connectivity/drivers/lora/COMPONENT_SX126X\SX126X_LoRaRadio.h:310:11: error: no type named 'AnalogIn' in namespace 'mbed'
mbed::AnalogIn _freq_select;
~~~~~~^
./mbed-os/connectivity/drivers/lora/COMPONENT_SX126X\SX126X_LoRaRadio.h:313:11: error: no type named 'AnalogIn' in namespace 'mbed'
mbed::AnalogIn _dev_select;
~~~~~~^
.\main.cpp:83:25: error: no matching constructor for initialization of 'LoRaWANInterface'
static LoRaWANInterface lorawan(radio);
^       ~~~~~
./mbed-os/connectivity/lorawan/include\lorawan/LoRaWANInterface.h:39:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'SX126X_LoRaRadio' to 'const LoRaWANInterface' for 1st argument
class LoRaWANInterface {
^
./mbed-os/connectivity/lorawan/include\lorawan/LoRaWANInterface.h:52:5: note: candidate constructor not viable: no known conversion from 'SX126X_LoRaRadio' to 'LoRaRadio &' for 1st argument
LoRaWANInterface(LoRaRadio &radio);
^
./mbed-os/connectivity/lorawan/include\lorawan/LoRaWANInterface.h:59:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
LoRaWANInterface(LoRaRadio &radio, LoRaPHY &phy);
^
.\main.cpp:180:26: warning: 'call_in' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
ev_queue.call_in(3000, send_message);
^
./mbed-os/events/include\events/EventQueue.h:926:9: note: 'call_in' has been explicitly marked deprecated here
int call_in(int ms, F f)
^
.\main.cpp:180:26: warning: 'call_in<void (*)()>' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
ev_queue.call_in(3000, send_message);
^
./mbed-os/events/include\events/EventQueue.h:925:5: note: 'call_in<void (*)()>' has been explicitly marked deprecated here
MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`.")
^
./mbed-os/platform/include\platform/mbed_toolchain.h:424:37: note: expanded from macro 'MBED_DEPRECATED_SINCE'
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
^
./mbed-os/platform/include\platform/mbed_toolchain.h:405:43: note: expanded from macro 'MBED_DEPRECATED'
#define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
^
.\main.cpp:224:26: warning: 'call_every' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
ev_queue.call_every(TX_TIMER, send_message);
^
./mbed-os/events/include\events/EventQueue.h:1083:9: note: 'call_every' has been explicitly marked deprecated here
int call_every(int ms, F f)
^
.\main.cpp:224:26: warning: 'call_every<void (*)()>' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
ev_queue.call_every(TX_TIMER, send_message);
^
./mbed-os/events/include\events/EventQueue.h:1082:5: note: 'call_every<void (*)()>' has been explicitly marked deprecated here
MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`.")
^
./mbed-os/platform/include\platform/mbed_toolchain.h:424:37: note: expanded from macro 'MBED_DEPRECATED_SINCE'
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
^
./mbed-os/platform/include\platform/mbed_toolchain.h:405:43: note: expanded from macro 'MBED_DEPRECATED'
#define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
^
4 warnings and 3 errors generated.

I am suspecting the DEVICE_ANALOGIN Flag to not be set. The code compiles if I choose one of the other targets listed at mbed_app.json. Where would this flag be set? Why isnt’t it? Is AnalogIn not supported with the SFE_ARTEMIS_THING_PLUS Target? Where could I check if this is the case?

Thanks in advance

4 posts - 2 participants