Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
IronWaffle
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

Good day!

This thread is a continuation from this post

I am writing an abstraction layer to interface the RadioLib Library with the XMC2Go in Arduino IDE (2.3.2) for LoraWAN connectivity.  My abstraction layer is based on PiHal.h from the non-Arduino example in RadioLib. When trying to compile the code, I get this error message:

 

 

c:\Users\XXX\Documents\Arduino\libraries\RadioLib\src\ArduinoHal.cpp:6:10: fatal error: EEPROM.h: No such file or directory
    6 | #include <EEPROM.h>
      |          ^~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

 

 

I added the abstraction layer code to the main code, which mean that the RadioLib library shouldn't be referencing ArduinoHal anymore.  Moreover, looking deeper into RadioLib, it is possible to use the library without EEPROM as there is a defined "RADIOLIB_EEPROM_UNSUPPORTED" as shown in the compatible board definitions here. I tried defining it in my XMCHal.h but the error persists. 

The same issue was also raised here, but it remained unsolved without considering the usage of an abstraction layer.

How can I circumvent this error?

I would also like to ask some advice on my XMCHal.h. I have some programming experience, but I am unfamiliar with XMC architecture and how to write an abstraction layer.  I looked through XMC-for-Arduino to find the variables as it bridges the XMC to the Arduino IDE. I realized that since this library enables Arduino functions to work in XMC boards, I could simply use the Arduino functions themselves for some of the GPIO needs in the abstraction layer (Like pinMode, DigitalWrite, DigitalRead). Because of this I won't need the "PI_INPUT, PI_OUTPUT, PI_LOW, PI_HIGH, RISING_EDGE, FALLING_EDGE" in RadioLibHal(). However, for the SPI I used XMC_SPI.h (still in the XMC-for-Arduino).

Are these assumptions correct? Would my abstraction layer work without the error? I am also not sure what spi channel to use for the XMC in my XMC2Go_RadioLib_main.ino. 

 

Any help or advice is appreciated. Thank you very much for your time!


My code:

XMC2Go_RadioLib_main.ino - Pastebin.com

XMCHal.h - Pastebin.com

 

 

0 Likes
1 Solution
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @IronWaffle ,

XMC is unsupported platform , so you need to start from build options . Modify src/BuildOpt.h to add and build XMC platform .
You need to define macros which can be applicable only for XMC platform . There is no EEPROM support for XMC so make sure you define RADIOLIB_EEPROM_UNSUPPORTED to 1 which will resolve current compilation error. You need to understand memory layout of XMC and map EEPROM data to XMC emulated EEPROM section.

Please go through XMC architecture which will make porting easier .

Thanks
Sujata

View solution in original post

0 Likes
3 Replies
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @IronWaffle ,

XMC is unsupported platform , so you need to start from build options . Modify src/BuildOpt.h to add and build XMC platform .
You need to define macros which can be applicable only for XMC platform . There is no EEPROM support for XMC so make sure you define RADIOLIB_EEPROM_UNSUPPORTED to 1 which will resolve current compilation error. You need to understand memory layout of XMC and map EEPROM data to XMC emulated EEPROM section.

Please go through XMC architecture which will make porting easier .

Thanks
Sujata

0 Likes

Hello!

Got it! I was able to fix the error and I'm working on the other macros I need to define and now trying to implement the EEPROM. I will come back to the thread when I have more questions.

Thank you so much for your help! Our team appreciates you help.

0 Likes
sujatapatil
Moderator
Moderator
Moderator
250 replies posted 50 solutions authored 10 likes received

Hi @IronWaffle ,

Thanks for updating , keep posting progress and doubts. 

 

Thanks

Sujata

0 Likes