suculent / thinx-aes-lib

AES wrapper for ESP8266/ESP32/Arduino/nRF5x
Other
113 stars 39 forks source link

Using with NRF51822 #69

Closed NgHieuPickon closed 1 year ago

NgHieuPickon commented 1 year ago

Hi everybody, I have a project with Generic NRF51 (NRF51822) under the Arduino Core of Sandeepmistry (https://github.com/sandeepmistry/arduino-nRF5) When I start the "simple" example, the console shows "AES_config.h:37:85: fatal error: pgmspace.h: No such file or directory". I understand that in the Arduino Core of Sandeepmistry there is no such file. But I think there must be a way to use it. Please help me!

suculent commented 1 year ago

It should work, as your Arduino core has this file in avr/pgmspace.h and that should be used if there is ´AVR´ defined, as per:

  #if (defined(__AVR__))
    #include <avr/pgmspace.h>
  #else

Try adding ´#define AVR´ at the beginning of this file as a workaround.

What compiler are you using?

suculent commented 1 year ago

I have succeeded to build for the Sandeep Mistry's Generic NRF51 after couple minor changes. Please, check out version >2.3.4 if it works for you (recently 2.3.5 with a base64 decode memleak fix). As I have no nRF5x hardware, the testing is up to you.

suculent commented 1 year ago

@NgHieuPickon unless this is not an issue anymore, I'd like to close it.

anhkhoaEmbedded commented 1 year ago

Hi, I try to compile my arduino sketch using AESlib.h for my Arduino PMC, but when I run compile it said not found . I have no clue about this. Does anyone find some solution this ? I really appreciate.

suculent commented 1 year ago

Well, this Lib has not yet been used on PMC. Generally, this requires couple ´#if defined()’ locations to be changed, because the pgmspace.h location is not currently defined for this architecture. It needs a bit of digging to find out in compiler output, which of the -D args contains the platform (currently AVR, ESP and NRF is supported out of the box).See latest nRF commits for required changes to add platform support. I can help with that, but I’m currently busy and have no such hardware. M. 31. 5. 2023 v 16:15, anhkhoa97 @.***>: Hi, I try to compile my arduino sketch using AESlib.h for my Arduino PMC, but when I run compile it said not found . I have no clue about this. Does anyone find some solution this ? I really appreciate.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

NgHieuPickon commented 1 year ago

Hi @suculent, I tested version 2.3.6 on NRF51822. It works fine with the "sample" example. Before you publish version 2.3.4, I used AES Electronic Code Book (ECB) on Arduino IDE and it worked fine. I haven't compared the efficiency of your library and ECB, but both are usable. Sincerely thank.