Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArduinoBearSSLConfig.h in sketch folders not accessible to library #86

Open
IraSch opened this issue Mar 23, 2024 · 4 comments
Open

ArduinoBearSSLConfig.h in sketch folders not accessible to library #86

IraSch opened this issue Mar 23, 2024 · 4 comments
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@IraSch
Copy link

IraSch commented Mar 23, 2024

I installed the BearSSL library latest version. I put the ArduinoBearSSLConfig.h file in the same directory as my sketch, and modified it to uncomment the line:

#define ARDUINO_DISABLE_ECCX08

In my sketch I have

#include "ArduinoBearSSLConfig.h"
#include <ArduinoBearSSL.h>

But I get a compile error:

Error compiling for board Arduino/Genuino MKR1000

I also tried adding the #define at the top of my sketch, but still get the compile error.

I thought I saw someone else using this library with MKR1000, so I must be missing something.

@per1234 per1234 changed the title Question - trying to use with MKR1000 getting "Error compiling for board Arduino/Genuino MKR1000 Trying to use with MKR1000 getting "Error compiling for board Arduino/Genuino MKR1000 Mar 24, 2024
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 24, 2024
@per1234
Copy link
Contributor

per1234 commented Mar 24, 2024

Hi @IraSch. I'm going to ask you to post the full output from a compilation. Please do this:

  1. Open the sketch that uses the ArduinoBearSSL library in Arduino IDE.
  2. Select Tools > Board > Arduino SAMD Boards (32-bits ARM Cortex-M0+) > Arduino MKR 1000 WiFi from the Arduino IDE menus.
  3. Select Sketch > Verify/Compile from the Arduino IDE menus.
  4. Wait for the compilation to fail.
  5. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  6. Paste the error messages in a comment here on the GitHub thread.
    In order to ensure the text is not corrupted, please use code fencing.
  7. Click the "Comment" button to post the output.

@per1234 per1234 added the status: waiting for information More information must be provided before work can proceed label Mar 24, 2024
@IraSch
Copy link
Author

IraSch commented Mar 24, 2024

I am able to get my sketch to compile now. What I did was to put ArdruinoBearSSLConfig.h (with the DEFINE uncommented) in with the other Bear library files instead of having it in the same folder as my sketch.

@IraSch IraSch closed this as completed Mar 24, 2024
@IraSch

This comment was marked as off-topic.

@per1234 per1234 changed the title Trying to use with MKR1000 getting "Error compiling for board Arduino/Genuino MKR1000 ArduinoBearSSLConfig.h in sketch folders not accessible to library Mar 24, 2024
@per1234
Copy link
Contributor

per1234 commented Mar 24, 2024

I suspected this was the problem. Unfortunately #45 was not tested. The system of putting the ArduinoBearSSLConfig.h in the sketch folder as demonstrated in the library examples is fatally flawed because, at least in the official boards platforms (the situation is different for the 3rd party "STM32 MCU based boards" platform and perhaps some other 3rd party platforms), the sketch folder is intentionally not added to the the compiler's "search path", so this conditional will always evaluate as false:

# if __has_include (<ArduinoBearSSLConfig.h>)

and thus an ArduinoBearSSLConfig.h in the sketch folder will have no effect on the library, as was previously reported three years ago at #45 (comment), but never acted on.

In order to avoid other users suffering from the same poor experience caused by this defect, the pointless ArduinoBearSSLConfig.h files must be removed from the examples and the correct way to use the ArduinoBearSSLConfig.h system documented. We will use this issue to track that task so it must remain open even though you are no longer suffering from it.

@per1234 per1234 reopened this Mar 24, 2024
@per1234 per1234 added topic: documentation Related to documentation for the project and removed status: waiting for information More information must be provided before work can proceed labels Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants