Closed amirna2 closed 4 years ago
Unfortunately I don't think there's a simple fix for this - RadioLib assumes pinMode
is a function declared in the global scope, which is true for every single platform RadioLib supports, and there's a lot of them.
In the case of CubeCell, pinMode
is not a function, but rather a preprocessor macro - and to make things worse, it's using string concatenation operator on its argument. This will completely break current pinMode
handling in RadioLib.
If someone figures out how to fix this in RadioLib without breaking compatibility with currently supported platforms, I will accept that as a PR. However, I don't see it as a priority as CubeCell isn't a very wide-spread platform and already has its own internal SX126x driver.
Thanks. This makes sense, the fix shouldn't come from RadioLib. I was able to work around by commenting out the macro, but obviously this isn't a solution. Unfortunately the CubeCell Arduino core is missing a lot of other functions, making it impossible to use with RadioLib. Obviously Heltec is trying to promote their own implementation of LoRa and doing so in a way that may not make it easy for generic solutions.
RadioLib is currently used by the ClusterDuckProtocol (http://clusterduckprotocol.org/) open source wireless mesh network solution and I am helping with the integration of a broader range of devices, including Arm Cortex M0+ and SX1262 based platforms.
Thanks for the quick response. Amir.
This is probably no longer relevant, but since there was no reaction from the Heltec/CubeCell side, I decided it would be a fun excercise to try and hack around the issue. After a couple very ugly hacks, RadioLib can now build for CubeCell, despite the fact that:
pinMode
,tone
and to top it all offIt seems CubeCell doesn't compile again. I posted this yesterday, but deleted it because I realized I probably didn't need CubeCell support anyway. Here is the error message it shows in Arduino 2.0.3:
In file included from c:\Users\webma\Documents\Arduino\libraries\RadioLib\src/RadioLib.h:39:0,
from C:\Users\webma\AppData\Local\Temp\.arduinoIDE-unsaved202311-5084-8dl3ll.ict8c\SX126x_Settings\SX126x_Settings.ino:28:
c:\Users\webma\Documents\Arduino\libraries\RadioLib\src/Module.h:65:12: error: 'constexpr' does not name a type
static constexpr RfSwitchMode_t END_OF_MODE_TABLE = {MODE_END_OF_TABLE, {}};
^
c:\Users\webma\Documents\Arduino\libraries\RadioLib\src/Module.h:65:12: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
I am still able to build RadioLib for their AB01 and AB02S CubeCell boards with RadioLib version 5.6.0 and Heltec CubeCell Arduino version 1.5.0. The new hardware now has evolved to v2 (I am still using the older v1.1).
As per my previous comment:
It's using an outdated GCC
and constexpr
is only available in C++11. This was added as one of the changes for STM32WL support. @matthijskooijman is the constexpr
needed, or will a simple const
suffice?
It seems it's not strictly needed, but it needs a couple more changes. I'll confirm and prepare a PR.
@timmbogner this should be fixed now (by @matthijskooijman)
@jgromes Thanks! Great library, I'm implementing it on my FDRS project and it's really helped me a lot.
@matthijskooijman Thank you as well! I've been watching your STM32WLx work because I'm hoping it will enable me to use RadioLib on this E5 module. I'm still working on flashing it, though.
Hello,
I am hoping someone can help me. I am trying to build RadioLib (v4.0.4) for the
Heltec CubeCell Board AB01
Arduino compatible board. The board is an ASR650x SoC with an SX1262 (https://heltec.org/project/htcc-ab01/). When I try to build one of the examples (SX126x Channel Activity Detection Example) I get the following error:It seems the problem is the
Arduino.h
for the Heltec board re-definespinMode()
and that conflicts with the RadioLib override of the same method in Module.h Here is how the macro is defined in Arduino.hI tried to rename & replace
pinMode()
topinModeEx()
in RadioLib Module.h but this doesn't seem to solve the problem.Thanks in advance for your help. Amir.