catid / loraftp

File transfer between two Raspberry Pis using the LoRa Pi HAT from Waveshare
BSD 3-Clause "New" or "Revised" License
20 stars 4 forks source link

other raspberry pi compatibility - specifically armv6l #3

Closed Dukat-Gul closed 3 years ago

Dukat-Gul commented 3 years ago

Heya. Just trying to compile this cool program for a based armv6l raspberry pi. zero/w

and I've hit a pretty obvious issue.

[ 84%] Building CXX object CMakeFiles/loraftp.dir/src/tools.cpp.o
/home/pi/loraftp/src/tools.cpp: In function 'uint32_t lora::FastCrc32(const void*, int)':
/home/pi/loraftp/src/tools.cpp:176:15: error: '__crc32cd' was not declared in this scope
         crc = __crc32cd(crc, ReadU64_LE(data));
               ^~~~~~~~~
/home/pi/loraftp/src/tools.cpp:182:15: error: '__crc32cw' was not declared in this scope
         crc = __crc32cw(crc, ReadU32_LE(data));
               ^~~~~~~~~
/home/pi/loraftp/src/tools.cpp:187:15: error: '__crc32ch' was not declared in this scope
         crc = __crc32ch(crc, ReadU16_LE(data));
               ^~~~~~~~~
/home/pi/loraftp/src/tools.cpp:192:15: error: '__crc32cb' was not declared in this scope
         crc = __crc32cb(crc, *data);
               ^~~~~~~~~
make[2]: *** [CMakeFiles/loraftp.dir/build.make:102: CMakeFiles/loraftp.dir/src/tools.cpp.o] Error 1

DId some quick looking and the used of the various __crc32xx seems to be for the higher spec's arms according to this especially for some used.

6.5.8 CRC32 Extension
__ARM_FEATURE_CRC32 is defined to 1 if the CRC32 instructions are supported and the intrinsics defined in 9.7 are
available. These instructions include CRC32B, CRC32H etc. This is only available when __ARM_ARCH >= 8.

Any suggestions PLEASE how I might tweak this to compile without error?

catid commented 3 years ago

Ah good point. Lemme fix that real quick

catid commented 3 years ago

Okay I pushed something to master mind checking if that works?

Dukat-Gul commented 3 years ago

Thanks. Compile worked perfectly with the adjusted CRC code on the Raspberry Pi Zero (non-W), which is armv6l based. Obviously took a LOT longer - and I had to establish a swap file as I had before on the Rpi3B due to RAM available. But I am more than happy to wait :) as your program is very very helpful. I will now continue my testing with the Waveshare 433Mhz Hat Ebyte E22 400T22S enabled, which was fine on my Rpi3B and I suspect will be fine on the Zero....

I spoke too soon, whilst the compile seemed to work.... I have tried to send files between two units (a Rpi3 - which was working previously perfectly) and the new rpi0. no joy... lights flicker but fails. i re-clones the git repository on the old rpi3 and recompiled there too, incase the CRC code needed to be the same on both sides. no change still lights flicker and no echo for the echo-test or ftp.

interestingly, as a side test - I used tncattach on both after using the echo-test to set the channel on both sides. and I was able to ping and ssh between the units. So they are talking.