Skip to content

Commit

Permalink
Merge pull request wolfSSL#7559 from gojimmypi/PR-PlatformIO-FreeRTOS
Browse files Browse the repository at this point in the history
Update PlatformIO README and Examples
  • Loading branch information
dgarske authored May 20, 2024
2 parents 0987bf4 + 22af731 commit fc172e9
Show file tree
Hide file tree
Showing 9 changed files with 457 additions and 246 deletions.
78 changes: 11 additions & 67 deletions IDE/PlatformIO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,25 @@

Follow the [instructions](https://docs.platformio.org/en/latest/core/installation/methods/index.html) to install PlatformIO.

Note there are two options:
Note there are two options for using PlatformIO:

- [Core CLI](https://docs.platformio.org/en/latest/core/index.html)
- [VSCode IDE](https://docs.platformio.org/en/latest/integration/ide/vscode.html#ide-vscode)

There are two types wolfSSL libraries for PlatformIO:

## Publishing

The PlatformIO Core CLI is needed to publish wolfSSL:

See also the [Arduino](../ARDUINO/README.md) publishing notes.


### Publish PlatformIO Arduino Library with Windows

The wolfSSL publishing is done from the `scripts`. Here are somple examples:

Setup the PlatformIO CLI:

```dos
set PATH=%PATH%;C:\Users\%USERNAME%\.platformio\penv\Scripts\
pio --help
pio account show
```

Publish

```dos
pio pkg publish --owner wolfSSL C:\workspace\Arduino-wolfSSL
```

### Publish with Linux
- Regular (release): https://registry.platformio.org/libraries/wolfssl/wolfssl
- Arduino (release): https://registry.platformio.org/libraries/wolfssl/Arduino-wolfSSL

```bash
set PATH=%PATH%;C:\Users\%USERNAME%\.platformio\penv\Scripts\
pio --help
pio account show
```
There are staging / preview libraries for each of the two types wolfSSL libraries for PlatformIO:

```bash
pio pkg publish --owner wolfSSL ~\workspace\Arduino-wolfSSL
```
- Regular (staging / preview): https://registry.platformio.org/libraries/wolfssl-staging/wolfSSL
- Arduino (staging / preview): https://registry.platformio.org/libraries/wolfssl-staging/Arduino-wolfSSL

### Create a staging / preview wolfssl org
# Examples

See
See the [examples directory](./examples/)

```
pio org create wolfssl-staging --email [email protected] --displayname "testing preview wolfssl"
```

### Add user to org

The creator of an org is automatically added as user / owner at org creation time. Others can be added:

```
pio org add wolfssl-staging gojimmypi
```

### Publish Arduino wolfSSL to staging / preview site:

```
pio pkg publish --owner wolfssl-staging C:\workspace\Arduino-wolfSSL
```

### Publish Regular wolfSSL to staging / preview site:

```
pio pkg publish --owner wolfssl-staging C:\workspace\wolfssl-gojimmypi\IDE\PlatformIO\PlatformIO_wolfSSL
```

### Remove published version from staging site:

`pio pkg unpublish [<organization>/]<pkgname>[@<version>] [OPTIONS]`
## Publishing

```
pio pkg unpublish wolfssl-staging/[email protected]
```
The wolfSSL publishing is performed from the `scripts`.
286 changes: 188 additions & 98 deletions IDE/PlatformIO/examples/wolfssl_benchmark/README.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions IDE/PlatformIO/examples/wolfssl_benchmark/include/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* PlatformIO wolfssl_benchmark main.c
*
* Copyright (C) 2006-2024 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef _MAIN_H_
#define _MAIN_H_

#endif
4 changes: 2 additions & 2 deletions IDE/PlatformIO/examples/wolfssl_benchmark/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
platform = espressif32
board = esp32dev
framework = espidf
upload_port = COM82
monitor_port = COM82
upload_port = COM19
monitor_port = COM19
monitor_speed = 115200
build_flags = -DWOLFSSL_USER_SETTINGS, -DWOLFSSL_ESP32
monitor_filters = direct
Expand Down
53 changes: 27 additions & 26 deletions IDE/PlatformIO/examples/wolfssl_benchmark/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,31 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include "main.h"

#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ESPIDF
#include <esp_log.h>
#include <rtc_wdt.h>
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
#endif

#include <wolfssl/version.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfcrypt/benchmark/benchmark.h>

#define TAG "demo"

void app_main() {
int ret = 0;
#ifdef WOLFSSL_ESPIDF
ESP_LOGI(TAG, "Found WOLFSSL_ESPIDF!");
#endif
printf("Hello World wolfSSL Version %s", LIBWOLFSSL_VERSION_STRING);

#if defined(HAVE_VERSION_EXTENDED_INFO) && defined(WOLFSSL_ESPIDF)
esp_ShowExtendedSystemInfo();
#endif
ret = benchmark_test(NULL);
printf("benchmark_test result %d", ret);
}
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ESPIDF
#include <esp_log.h>
#include <rtc_wdt.h>
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
#endif

#include <wolfssl/version.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfcrypt/benchmark/benchmark.h>

#define TAG "wolfSSL demo"

void app_main() {
int ret = 0;
#ifdef WOLFSSL_ESPIDF
ESP_LOGI(TAG, "Found WOLFSSL_ESPIDF!");
#endif
printf("\nHello World wolfSSL Version %s\n", LIBWOLFSSL_VERSION_STRING);

#if defined(HAVE_VERSION_EXTENDED_INFO) && defined(WOLFSSL_ESPIDF)
esp_ShowExtendedSystemInfo();
#endif
ret = benchmark_test(NULL);
printf("\nbenchmark_test complete! result code: %d\n", ret);
}
Loading

0 comments on commit fc172e9

Please sign in to comment.