AES icon indicating copy to clipboard operation
AES copied to clipboard

Flags for Raspberry Pi (fixed, not pushed yet)

Open PabloGN opened this issue 6 years ago • 11 comments

Error in platform selection The if statement doesn't set the correct .h file: #if (defined(__linux) || defined(linux)) && !(defined(__ARDUINO_X86__) || defined(__arm__)) when doing in Raspberry Pi:

sudo make install
g++ -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -c AES.cpp
In file included from AES.h:4:0,
                 from AES.cpp:1:
AES_config.h:19:23: fatal error: Arduino.h: No such file or directory
   #include <Arduino.h>
                       ^
compilation terminated.
Makefile:40: recipe for target 'AES.o' failed
make: *** [AES.o] Error 1

Flags defined in my system:

cpp -dM ./dummy.hxx |\grep -i -e linux -e __arm__ -e __ARDUINO_X86__
#define __linux 1
#define __linux__ 1
#define __gnu_linux__ 1
#define linux 1
#define __arm__ 1

So it compiles when: #if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_X86__) || defined(__arm__)

OS

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

Taken from https://blog.hypriot.com/

PabloGN avatar Nov 22 '18 12:11 PabloGN

this is a bug and thank you for mentioning it! i cannot believe that this has slipped form the tests before merging!!

The correct code should be #if (defined(__linux) || defined(linux) || defined(__arm__) ) && !defined(__ARDUINO_X86__)

but i would need some confirmation with ARM Arduino devices that i do not have in order to optimize it. @FrancMunoz can you please try the library with the above code and report back compatibility with your devices? This is a major bug and will be fixed ASAP.

spaniakos avatar Nov 22 '18 12:11 spaniakos

BTW @PabloGN i see that you have RPI v2, if you own a V3 as well can you please compile it there as well? i have an open issue #30 that i cant solve before i buy a new RPi v3

spaniakos avatar Nov 22 '18 12:11 spaniakos

Hi! @spaniakos and @PabloGN, it was my fault. I will try with ARM arduino and suggest a condition to be appended to the one that works with other platforms, are you agree?

FrancMunoz avatar Nov 22 '18 14:11 FrancMunoz

sure :) And i will revise my test methods so this wont happen again :)

spaniakos avatar Nov 22 '18 14:11 spaniakos

BTW @PabloGN i see that you have RPI v2, if you own a V3 as well can you please compile it there as well? i have an open issue #30 that i cant solve before i buy a new RPi v3

I have a RPi3, I'll test as quick as possible :-)

PabloGN avatar Nov 22 '18 14:11 PabloGN

I confirm that the corrected code:

#if (defined(__linux) || defined(linux) || defined(__arm__) ) && !defined(__ARDUINO_X86__)

Works with Arduino MKRGSM1400 AND MKRVIDOR. I've compiled, encrypted and decrypted and worked fine.

FrancMunoz avatar Nov 22 '18 14:11 FrancMunoz

good, i will test with my arsenal of devices tonight or tomorrow and push the changes!

spaniakos avatar Nov 22 '18 14:11 spaniakos

@PabloGN Were you able to get it working on the Rpi 3?

jaggarwal96 avatar Dec 02 '18 18:12 jaggarwal96

A colleague of mine compiled and tested in RPi 3, so she only had to change the flags to set the libs. Quite faster than RPi2. So no core dumps, no freeze, no problem.

PabloGN avatar Dec 03 '18 15:12 PabloGN

So the only flag you had to change was the one mentioned above in the AES_config.h file or was there something else?

jaggarwal96 avatar Dec 03 '18 18:12 jaggarwal96

She only had to change that line#if (defined(__linux) || defined(linux) || defined(__arm__) ) && !defined(__ARDUINO_X86__) as far as I know.

PabloGN avatar Dec 04 '18 10:12 PabloGN