Wolfssl [version 0.0.2; documenting]

Hi,
I’m working on getting WolfSSL up and running for Photon/P1, but I keep running into problems that I’m having a hard time solving. They have a really good guide for how to do this and I’ve solved most of the configuration issues up until now.

I don’t have anything that works yet though and I’m suspecting this has to do with the fact that WolfSSL is C and the Particle compiler have a preference for CPP? I’m pretty sure that the error above indicates a larger problem (unknown type name ‘class’) but I don’t know where to dig to resolve this.

I’d appreciate some pointers as to where I go next based this output (split into two posts due to limit):

j$ particle compile p1 wolfssl-test.ino ../lib/wolfssl/

Compiling code for p1

Including:
    wolfssl-test.ino
    ../lib/wolfssl/cyassl/callbacks.h
    ../lib/wolfssl/cyassl/certs_test.h
    ../lib/wolfssl/cyassl/crl.h
    ../lib/wolfssl/cyassl/ctaocrypt/aes.h
    ../lib/wolfssl/cyassl/ctaocrypt/arc4.h
    ../lib/wolfssl/cyassl/ctaocrypt/asn_public.h
    ../lib/wolfssl/cyassl/ctaocrypt/asn.h
    ../lib/wolfssl/cyassl/ctaocrypt/blake2-impl.h
    ../lib/wolfssl/cyassl/ctaocrypt/blake2-int.h
    ../lib/wolfssl/cyassl/ctaocrypt/blake2.h
    ../lib/wolfssl/cyassl/ctaocrypt/camellia.h
    ../lib/wolfssl/cyassl/ctaocrypt/chacha.h
    ../lib/wolfssl/cyassl/ctaocrypt/coding.h
    ../lib/wolfssl/cyassl/ctaocrypt/compress.h
    ../lib/wolfssl/cyassl/ctaocrypt/des3.h
    ../lib/wolfssl/cyassl/ctaocrypt/dh.h
    ../lib/wolfssl/cyassl/ctaocrypt/dsa.h
    ../lib/wolfssl/cyassl/ctaocrypt/ecc.h
    ../lib/wolfssl/cyassl/ctaocrypt/error-crypt.h
    ../lib/wolfssl/cyassl/ctaocrypt/fips_test.h
    ../lib/wolfssl/cyassl/ctaocrypt/hc128.h
    ../lib/wolfssl/cyassl/ctaocrypt/hmac.h
    ../lib/wolfssl/cyassl/ctaocrypt/integer.h
    ../lib/wolfssl/cyassl/ctaocrypt/logging.h
    ../lib/wolfssl/cyassl/ctaocrypt/md2.h
    ../lib/wolfssl/cyassl/ctaocrypt/md4.h
    ../lib/wolfssl/cyassl/ctaocrypt/md5.h
    ../lib/wolfssl/cyassl/ctaocrypt/memory.h
    ../lib/wolfssl/cyassl/ctaocrypt/misc.h
    ../lib/wolfssl/cyassl/ctaocrypt/mpi_class.h
    ../lib/wolfssl/cyassl/ctaocrypt/mpi_superclass.h
    ../lib/wolfssl/cyassl/ctaocrypt/pkcs7.h
    ../lib/wolfssl/cyassl/ctaocrypt/poly1305.h
    ../lib/wolfssl/cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h
    ../lib/wolfssl/cyassl/ctaocrypt/pwdbased.h
    ../lib/wolfssl/cyassl/ctaocrypt/rabbit.h
    ../lib/wolfssl/cyassl/ctaocrypt/random.h
    ../lib/wolfssl/cyassl/ctaocrypt/ripemd.h
    ../lib/wolfssl/cyassl/ctaocrypt/rsa.h
    ../lib/wolfssl/cyassl/ctaocrypt/settings_comp.h
    ../lib/wolfssl/cyassl/ctaocrypt/settings.h
    ../lib/wolfssl/cyassl/ctaocrypt/sha.h
    ../lib/wolfssl/cyassl/ctaocrypt/sha256.h
    ../lib/wolfssl/cyassl/ctaocrypt/sha512.h
    ../lib/wolfssl/cyassl/ctaocrypt/tfm.h
    ../lib/wolfssl/cyassl/ctaocrypt/types.h
    ../lib/wolfssl/cyassl/ctaocrypt/visibility.h
    ../lib/wolfssl/cyassl/ctaocrypt/wc_port.h
    ../lib/wolfssl/cyassl/error-ssl.h
    ../lib/wolfssl/cyassl/internal.h
    ../lib/wolfssl/cyassl/ocsp.h
    ../lib/wolfssl/cyassl/openssl/asn1.h
    ../lib/wolfssl/cyassl/openssl/bio.h
    ../lib/wolfssl/cyassl/openssl/bn.h
    ../lib/wolfssl/cyassl/openssl/conf.h
    ../lib/wolfssl/cyassl/openssl/crypto.h
    ../lib/wolfssl/cyassl/openssl/des.h
    ../lib/wolfssl/cyassl/openssl/dh.h
    ../lib/wolfssl/cyassl/openssl/dsa.h
    ../lib/wolfssl/cyassl/openssl/ec.h
    ../lib/wolfssl/cyassl/openssl/ec25519.h
    ../lib/wolfssl/cyassl/openssl/ecdh.h
    ../lib/wolfssl/cyassl/openssl/ecdsa.h
    ../lib/wolfssl/cyassl/openssl/ed25519.h
    ../lib/wolfssl/cyassl/openssl/engine.h
    ../lib/wolfssl/cyassl/openssl/err.h
    ../lib/wolfssl/cyassl/openssl/evp.h
    ../lib/wolfssl/cyassl/openssl/hmac.h
    ../lib/wolfssl/cyassl/openssl/lhash.h
    ../lib/wolfssl/cyassl/openssl/md4.h
    ../lib/wolfssl/cyassl/openssl/md5.h
    ../lib/wolfssl/cyassl/openssl/ocsp.h
    ../lib/wolfssl/cyassl/openssl/opensslconf.h
    ../lib/wolfssl/cyassl/openssl/opensslv.h
    ../lib/wolfssl/cyassl/openssl/ossl_typ.h
    ../lib/wolfssl/cyassl/openssl/pem.h
    ../lib/wolfssl/cyassl/openssl/pkcs12.h
    ../lib/wolfssl/cyassl/openssl/rand.h
    ../lib/wolfssl/cyassl/openssl/ripemd.h
    ../lib/wolfssl/cyassl/openssl/rsa.h
    ../lib/wolfssl/cyassl/openssl/sha.h
    ../lib/wolfssl/cyassl/openssl/ssl.h
    ../lib/wolfssl/cyassl/openssl/ssl23.h
    ../lib/wolfssl/cyassl/openssl/stack.h
    ../lib/wolfssl/cyassl/openssl/ui.h
    ../lib/wolfssl/cyassl/openssl/x509.h
    ../lib/wolfssl/cyassl/openssl/x509v3.h
    ../lib/wolfssl/cyassl/options.h
    ../lib/wolfssl/cyassl/sniffer_error.h
    ../lib/wolfssl/cyassl/sniffer.h
    ../lib/wolfssl/cyassl/ssl.h
    ../lib/wolfssl/cyassl/test.h
    ../lib/wolfssl/cyassl/version.h
    ../lib/wolfssl/examples/client/client.h
    ../lib/wolfssl/examples/echoclient/echoclient.h
    ../lib/wolfssl/examples/echoserver/echoserver.h
    ../lib/wolfssl/examples/server/server.h
    ../lib/wolfssl/IDE/HEXIWEAR/wolfSSL_HW/user_settings.h
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/custom_port/custom_port_user_settings/user_settings.h
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_simple_example.h
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_verbose_example.h
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings.h
    ../lib/wolfssl/IDE/IAR-EWARM/Projects/user_settings.h
    ../lib/wolfssl/IDE/INTIME-RTOS/user_settings.h
    ../lib/wolfssl/IDE/INTIME-RTOS/wolfExamples.h
    ../lib/wolfssl/IDE/iOS/user_settings.h
    ../lib/wolfssl/IDE/LPCXPRESSO/lib_wolfssl/user_settings.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-BARE-METAL.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-RTX-TCP-FS.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-WOLFLIB.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h
    ../lib/wolfssl/IDE/MDK5-ARM/Conf/config-Crypt.h
    ../lib/wolfssl/IDE/MDK5-ARM/Conf/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Inc/config.h
    ../lib/wolfssl/IDE/MDK5-ARM/Inc/wolfssl_MDK_ARM.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/wolfSSL-Full/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/wolfSSL-Lib/RTE/wolfSSL/user_settings.h
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/hw.h
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/user_settings.h
    ../lib/wolfssl/IDE/WIN/user_settings.h
    ../lib/wolfssl/mcapi/crypto.h
    ../lib/wolfssl/mcapi/PIC32MZ-serial.h
    ../lib/wolfssl/mplabx/PIC32MZ-serial.h
    ../lib/wolfssl/mqx/util_lib/Sources/util.h
    ../lib/wolfssl/mqx/wolfcrypt_benchmark/Sources/main.h
    ../lib/wolfssl/mqx/wolfcrypt_test/Sources/main.h
    ../lib/wolfssl/mqx/wolfssl_client/Sources/main.h
    ../lib/wolfssl/tests/unit.h
    ../lib/wolfssl/wolfcrypt/async.h
    ../lib/wolfssl/wolfcrypt/benchmark/benchmark.h
    ../lib/wolfssl/wolfcrypt/test/test.h
    ../lib/wolfssl/wolfcrypt/user-crypto/include/user_rsa.h
    ../lib/wolfssl/wolfssl.h
    ../lib/wolfssl/wolfssl/callbacks.h
    ../lib/wolfssl/wolfssl/certs_test.h
    ../lib/wolfssl/wolfssl/crl.h
    ../lib/wolfssl/wolfssl/error-ssl.h
    ../lib/wolfssl/wolfssl/internal.h
    ../lib/wolfssl/wolfssl/io.h
    ../lib/wolfssl/wolfssl/ocsp.h
    ../lib/wolfssl/wolfssl/openssl/aes.h
    ../lib/wolfssl/wolfssl/openssl/asn1.h
    ../lib/wolfssl/wolfssl/openssl/bio.h
    ../lib/wolfssl/wolfssl/openssl/bn.h
    ../lib/wolfssl/wolfssl/openssl/conf.h
    ../lib/wolfssl/wolfssl/openssl/crypto.h
    ../lib/wolfssl/wolfssl/openssl/des.h
    ../lib/wolfssl/wolfssl/openssl/dh.h
    ../lib/wolfssl/wolfssl/openssl/dsa.h
    ../lib/wolfssl/wolfssl/openssl/ec.h
    ../lib/wolfssl/wolfssl/openssl/ec25519.h
    ../lib/wolfssl/wolfssl/openssl/ecdh.h
    ../lib/wolfssl/wolfssl/openssl/ecdsa.h
    ../lib/wolfssl/wolfssl/openssl/ed25519.h
    ../lib/wolfssl/wolfssl/openssl/engine.h
    ../lib/wolfssl/wolfssl/openssl/err.h
    ../lib/wolfssl/wolfssl/openssl/evp.h
    ../lib/wolfssl/wolfssl/openssl/hmac.h
    ../lib/wolfssl/wolfssl/openssl/lhash.h
    ../lib/wolfssl/wolfssl/openssl/md4.h
    ../lib/wolfssl/wolfssl/openssl/md5.h
    ../lib/wolfssl/wolfssl/openssl/ocsp.h
    ../lib/wolfssl/wolfssl/openssl/opensslconf.h
    ../lib/wolfssl/wolfssl/openssl/opensslv.h
    ../lib/wolfssl/wolfssl/openssl/ossl_typ.h
    ../lib/wolfssl/wolfssl/openssl/pem.h
    ../lib/wolfssl/wolfssl/openssl/pkcs12.h
    ../lib/wolfssl/wolfssl/openssl/rand.h
    ../lib/wolfssl/wolfssl/openssl/ripemd.h
    ../lib/wolfssl/wolfssl/openssl/rsa.h
    ../lib/wolfssl/wolfssl/openssl/sha.h
    ../lib/wolfssl/wolfssl/openssl/ssl.h
    ../lib/wolfssl/wolfssl/openssl/ssl23.h
    ../lib/wolfssl/wolfssl/openssl/stack.h
    ../lib/wolfssl/wolfssl/openssl/ui.h
    ../lib/wolfssl/wolfssl/openssl/x509.h
    ../lib/wolfssl/wolfssl/openssl/x509v3.h
    ../lib/wolfssl/wolfssl/options.h
    ../lib/wolfssl/wolfssl/sniffer_error.h
    ../lib/wolfssl/wolfssl/sniffer.h
    ../lib/wolfssl/wolfssl/ssl.h
    ../lib/wolfssl/wolfssl/test.h
    ../lib/wolfssl/wolfssl/version.h
    ../lib/wolfssl/wolfssl/wolfcrypt/aes.h
    ../lib/wolfssl/wolfssl/wolfcrypt/arc4.h
    ../lib/wolfssl/wolfssl/wolfcrypt/asn_public.h
    ../lib/wolfssl/wolfssl/wolfcrypt/asn.h
    ../lib/wolfssl/wolfssl/wolfcrypt/async.h
    ../lib/wolfssl/wolfssl/wolfcrypt/blake2-impl.h
    ../lib/wolfssl/wolfssl/wolfcrypt/blake2-int.h
    ../lib/wolfssl/wolfssl/wolfcrypt/blake2.h
    ../lib/wolfssl/wolfssl/wolfcrypt/camellia.h
    ../lib/wolfssl/wolfssl/wolfcrypt/chacha.h
    ../lib/wolfssl/wolfssl/wolfcrypt/chacha20_poly1305.h
    ../lib/wolfssl/wolfssl/wolfcrypt/cmac.h
    ../lib/wolfssl/wolfssl/wolfcrypt/coding.h
    ../lib/wolfssl/wolfssl/wolfcrypt/compress.h
    ../lib/wolfssl/wolfssl/wolfcrypt/curve25519.h
    ../lib/wolfssl/wolfssl/wolfcrypt/des3.h
    ../lib/wolfssl/wolfssl/wolfcrypt/dh.h
    ../lib/wolfssl/wolfssl/wolfcrypt/dsa.h
    ../lib/wolfssl/wolfssl/wolfcrypt/ecc.h
    ../lib/wolfssl/wolfssl/wolfcrypt/ed25519.h
    ../lib/wolfssl/wolfssl/wolfcrypt/error-crypt.h
    ../lib/wolfssl/wolfssl/wolfcrypt/fe_operations.h
    ../lib/wolfssl/wolfssl/wolfcrypt/fips_test.h
    ../lib/wolfssl/wolfssl/wolfcrypt/ge_operations.h
    ../lib/wolfssl/wolfssl/wolfcrypt/hash.h
    ../lib/wolfssl/wolfssl/wolfcrypt/hc128.h
    ../lib/wolfssl/wolfssl/wolfcrypt/hmac.h
    ../lib/wolfssl/wolfssl/wolfcrypt/idea.h
    ../lib/wolfssl/wolfssl/wolfcrypt/integer.h
    ../lib/wolfssl/wolfssl/wolfcrypt/logging.h
    ../lib/wolfssl/wolfssl/wolfcrypt/md2.h
    ../lib/wolfssl/wolfssl/wolfcrypt/md4.h
    ../lib/wolfssl/wolfssl/wolfcrypt/md5.h
    ../lib/wolfssl/wolfssl/wolfcrypt/mem_track.h
    ../lib/wolfssl/wolfssl/wolfcrypt/memory.h
    ../lib/wolfssl/wolfssl/wolfcrypt/misc.h
    ../lib/wolfssl/wolfssl/wolfcrypt/mpi_class.h
    ../lib/wolfssl/wolfssl/wolfcrypt/mpi_superclass.h
    ../lib/wolfssl/wolfssl/wolfcrypt/pkcs12.h
    ../lib/wolfssl/wolfssl/wolfcrypt/pkcs7.h
    ../lib/wolfssl/wolfssl/wolfcrypt/poly1305.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/atmel/atmel.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/intel/quickassist_mem.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/intel/quickassist.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/nrf51.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/nxp/ksdk_port.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/ti/ti-ccm.h
    ../lib/wolfssl/wolfssl/wolfcrypt/port/ti/ti-hash.h
    ../lib/wolfssl/wolfssl/wolfcrypt/pwdbased.h
    ../lib/wolfssl/wolfssl/wolfcrypt/rabbit.h
    ../lib/wolfssl/wolfssl/wolfcrypt/random.h
    ../lib/wolfssl/wolfssl/wolfcrypt/ripemd.h
    ../lib/wolfssl/wolfssl/wolfcrypt/rsa.h
    ../lib/wolfssl/wolfssl/wolfcrypt/settings.h
    ../lib/wolfssl/wolfssl/wolfcrypt/sha.h
    ../lib/wolfssl/wolfssl/wolfcrypt/sha256.h
    ../lib/wolfssl/wolfssl/wolfcrypt/sha512.h
    ../lib/wolfssl/wolfssl/wolfcrypt/signature.h
    ../lib/wolfssl/wolfssl/wolfcrypt/srp.h
    ../lib/wolfssl/wolfssl/wolfcrypt/tfm.h
    ../lib/wolfssl/wolfssl/wolfcrypt/types.h
    ../lib/wolfssl/wolfssl/wolfcrypt/visibility.h
    ../lib/wolfssl/wolfssl/wolfcrypt/wc_encrypt.h
    ../lib/wolfssl/wolfssl/wolfcrypt/wc_port.h
    ../lib/wolfssl/wolfssl/wolfcrypt/wolfevent.h
    ../lib/wolfssl/wolfssl/wolfcrypt/wolfmath.h
    ../lib/wolfssl/IDE/ARDUINO/sketches/wolfssl_client/wolfssl_client.ino
    ../lib/wolfssl/aes.c
    ../lib/wolfssl/arc4.c
    ../lib/wolfssl/asm.c
    ../lib/wolfssl/asn.c
    ../lib/wolfssl/async.c
    ../lib/wolfssl/blake2b.c
    ../lib/wolfssl/camellia.c
    ../lib/wolfssl/chacha.c
    ../lib/wolfssl/chacha20_poly1305.c
    ../lib/wolfssl/cmac.c
    ../lib/wolfssl/coding.c
    ../lib/wolfssl/compress.c
    ../lib/wolfssl/crl.c
    ../lib/wolfssl/ctaocrypt/src/aes.c
    ../lib/wolfssl/ctaocrypt/src/des3.c
    ../lib/wolfssl/ctaocrypt/src/fips_test.c
    ../lib/wolfssl/ctaocrypt/src/fips.c
    ../lib/wolfssl/ctaocrypt/src/hmac.c
    ../lib/wolfssl/ctaocrypt/src/misc.c
    ../lib/wolfssl/ctaocrypt/src/random.c
    ../lib/wolfssl/ctaocrypt/src/rsa.c
    ../lib/wolfssl/ctaocrypt/src/sha.c
    ../lib/wolfssl/ctaocrypt/src/sha256.c
    ../lib/wolfssl/ctaocrypt/src/sha512.c
    ../lib/wolfssl/ctaocrypt/src/wolfcrypt_first.c
    ../lib/wolfssl/ctaocrypt/src/wolfcrypt_last.c
    ../lib/wolfssl/curve25519.c
    ../lib/wolfssl/des3.c
    ../lib/wolfssl/dh.c
    ../lib/wolfssl/dsa.c
    ../lib/wolfssl/ecc_fp.c
    ../lib/wolfssl/ecc.c
    ../lib/wolfssl/ed25519.c
    ../lib/wolfssl/error.c
    ../lib/wolfssl/examples/client/client.c
    ../lib/wolfssl/examples/echoclient/echoclient.c
    ../lib/wolfssl/examples/echoserver/echoserver.c
    ../lib/wolfssl/examples/sctp/sctp-client-dtls.c
    ../lib/wolfssl/examples/sctp/sctp-client.c
    ../lib/wolfssl/examples/sctp/sctp-server-dtls.c
    ../lib/wolfssl/examples/sctp/sctp-server.c
    ../lib/wolfssl/examples/server/server.c
    ../lib/wolfssl/fe_low_mem.c
    ../lib/wolfssl/fe_operations.c
    ../lib/wolfssl/ge_low_mem.c
    ../lib/wolfssl/ge_operations.c
    ../lib/wolfssl/hash.c
    ../lib/wolfssl/hc128.c
    ../lib/wolfssl/hmac.c
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/custom_port/wolfcrypt_benchmark_custom_port/Application/runBenchmarks.c
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/custom_port/wolfcrypt_test_custom_port/Application/runWolfcryptTests.c
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c
    ../lib/wolfssl/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c
    ../lib/wolfssl/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c
    ../lib/wolfssl/IDE/IAR-EWARM/Projects/benchmark/current_time.c
    ../lib/wolfssl/IDE/IAR-EWARM/Projects/common/minimum-startup.c
    ../lib/wolfssl/IDE/IAR-EWARM/Projects/test/test-main.c
    ../lib/wolfssl/IDE/INTIME-RTOS/libwolfssl.c
    ../lib/wolfssl/IDE/INTIME-RTOS/wolfExamples.c
    ../lib/wolfssl/IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c
    ../lib/wolfssl/IDE/LPCXPRESSO/wolf_example/src/lpc_18xx_startup.c
    ../lib/wolfssl/IDE/LPCXPRESSO/wolf_example/src/wolfssl_example.c
    ../lib/wolfssl/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/Retarget.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c
    ../lib/wolfssl/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c
    ../lib/wolfssl/IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/CryptBenchmark/time-CortexM3-4.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/CryptTest/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/EchoClient/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/EchoServer/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleClient/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleClient/time-CortexM3-4.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/SimpleServer/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c
    ../lib/wolfssl/IDE/MDK5-ARM/Projects/wolfSSL-Full/time-CortexM3-4.c
    ../lib/wolfssl/IDE/MDK5-ARM/Src/ssl-dummy.c
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/retarget.c
    ../lib/wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c
    ../lib/wolfssl/idea.c
    ../lib/wolfssl/integer.c
    ../lib/wolfssl/internal.c
    ../lib/wolfssl/io.c
    ../lib/wolfssl/keys.c
    ../lib/wolfssl/logging.c
    ../lib/wolfssl/mcapi/crypto.c
    ../lib/wolfssl/mcapi/mcapi_test.c
    ../lib/wolfssl/md2.c
    ../lib/wolfssl/md4.c
    ../lib/wolfssl/md5.c
    ../lib/wolfssl/memory.c
    ../lib/wolfssl/misc.c
    ../lib/wolfssl/mplabx/benchmark_main.c
    ../lib/wolfssl/mplabx/test_main.c
    ../lib/wolfssl/mqx/util_lib/Sources/util.c
    ../lib/wolfssl/mqx/wolfcrypt_benchmark/Sources/main.c
    ../lib/wolfssl/mqx/wolfcrypt_test/Sources/main.c
    ../lib/wolfssl/mqx/wolfssl_client/Sources/main.c
    ../lib/wolfssl/ocsp.c
    ../lib/wolfssl/pkcs12.c
    ../lib/wolfssl/pkcs7.c
    ../lib/wolfssl/poly1305.c
    ../lib/wolfssl/pwdbased.c
    ../lib/wolfssl/rabbit.c
    ../lib/wolfssl/random.c
    ../lib/wolfssl/ripemd.c
    ../lib/wolfssl/rsa.c
    ../lib/wolfssl/sha.c
    ../lib/wolfssl/sha256.c
    ../lib/wolfssl/sha512.c
    ../lib/wolfssl/signature.c
    ../lib/wolfssl/sniffer.c
    ../lib/wolfssl/src/bio.c
    ../lib/wolfssl/src/crl.c
    ../lib/wolfssl/src/internal.c
    ../lib/wolfssl/src/io.c
    ../lib/wolfssl/src/keys.c
    ../lib/wolfssl/src/ocsp.c
    ../lib/wolfssl/src/sniffer.c
    ../lib/wolfssl/src/ssl.c
    ../lib/wolfssl/src/tls.c
    ../lib/wolfssl/srp.c
    ../lib/wolfssl/ssl.c
    ../lib/wolfssl/sslSniffer/sslSnifferTest/snifftest.c
    ../lib/wolfssl/swig/wolfssl_adds.c
    ../lib/wolfssl/tests/api.c
    ../lib/wolfssl/tests/hash.c
    ../lib/wolfssl/tests/srp.c
    ../lib/wolfssl/tests/suites.c
    ../lib/wolfssl/tests/unit.c
    ../lib/wolfssl/testsuite/testsuite.c
    ../lib/wolfssl/tfm.c
    ../lib/wolfssl/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/main.c
    ../lib/wolfssl/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/main.c
    ../lib/wolfssl/tls.c
    ../lib/wolfssl/wc_encrypt.c
    ../lib/wolfssl/wc_port.c
    ../lib/wolfssl/wolfcrypt/benchmark/benchmark.c
    ../lib/wolfssl/wolfcrypt/src/aes.c
    ../lib/wolfssl/wolfcrypt/src/arc4.c
    ../lib/wolfssl/wolfcrypt/src/asm.c
    ../lib/wolfssl/wolfcrypt/src/asn.c
    ../lib/wolfssl/wolfcrypt/src/async.c
    ../lib/wolfssl/wolfcrypt/src/blake2b.c
    ../lib/wolfssl/wolfcrypt/src/camellia.c
    ../lib/wolfssl/wolfcrypt/src/chacha.c
    ../lib/wolfssl/wolfcrypt/src/chacha20_poly1305.c
    ../lib/wolfssl/wolfcrypt/src/cmac.c
    ../lib/wolfssl/wolfcrypt/src/coding.c
    ../lib/wolfssl/wolfcrypt/src/compress.c
    ../lib/wolfssl/wolfcrypt/src/curve25519.c
    ../lib/wolfssl/wolfcrypt/src/des3.c
    ../lib/wolfssl/wolfcrypt/src/dh.c
    ../lib/wolfssl/wolfcrypt/src/dsa.c
    ../lib/wolfssl/wolfcrypt/src/ecc_fp.c
    ../lib/wolfssl/wolfcrypt/src/ecc.c
    ../lib/wolfssl/wolfcrypt/src/ed25519.c
    ../lib/wolfssl/wolfcrypt/src/error.c
    ../lib/wolfssl/wolfcrypt/src/evp.c
    ../lib/wolfssl/wolfcrypt/src/fe_low_mem.c
    ../lib/wolfssl/wolfcrypt/src/fe_operations.c
    ../lib/wolfssl/wolfcrypt/src/ge_low_mem.c
    ../lib/wolfssl/wolfcrypt/src/ge_operations.c
    ../lib/wolfssl/wolfcrypt/src/hash.c
    ../lib/wolfssl/wolfcrypt/src/hc128.c
    ../lib/wolfssl/wolfcrypt/src/hmac.c
    ../lib/wolfssl/wolfcrypt/src/idea.c
    ../lib/wolfssl/wolfcrypt/src/integer.c
    ../lib/wolfssl/wolfcrypt/src/logging.c
    ../lib/wolfssl/wolfcrypt/src/md2.c
    ../lib/wolfssl/wolfcrypt/src/md4.c
    ../lib/wolfssl/wolfcrypt/src/md5.c
    ../lib/wolfssl/wolfcrypt/src/memory.c
    ../lib/wolfssl/wolfcrypt/src/misc.c
    ../lib/wolfssl/wolfcrypt/src/pkcs12.c
    ../lib/wolfssl/wolfcrypt/src/pkcs7.c
    ../lib/wolfssl/wolfcrypt/src/poly1305.c
    ../lib/wolfssl/wolfcrypt/src/port/arm/armv8-aes.c
    ../lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha256.c
    ../lib/wolfssl/wolfcrypt/src/port/atmel/atmel.c
    ../lib/wolfssl/wolfcrypt/src/port/cavium/cavium_nitrox.c
    ../lib/wolfssl/wolfcrypt/src/port/intel/quickassist_mem.c
    ../lib/wolfssl/wolfcrypt/src/port/intel/quickassist.c
    ../lib/wolfssl/wolfcrypt/src/port/nrf51.c
    ../lib/wolfssl/wolfcrypt/src/port/nxp/ksdk_port.c
    ../lib/wolfssl/wolfcrypt/src/port/pic32/pic32mz-hash.c
    ../lib/wolfssl/wolfcrypt/src/port/ti/ti-aes.c
    ../lib/wolfssl/wolfcrypt/src/port/ti/ti-ccm.c
    ../lib/wolfssl/wolfcrypt/src/port/ti/ti-des3.c
    ../lib/wolfssl/wolfcrypt/src/port/ti/ti-hash.c
    ../lib/wolfssl/wolfcrypt/src/pwdbased.c
    ../lib/wolfssl/wolfcrypt/src/rabbit.c
    ../lib/wolfssl/wolfcrypt/src/random.c
    ../lib/wolfssl/wolfcrypt/src/ripemd.c
    ../lib/wolfssl/wolfcrypt/src/rsa.c
    ../lib/wolfssl/wolfcrypt/src/sha.c
    ../lib/wolfssl/wolfcrypt/src/sha256.c
    ../lib/wolfssl/wolfcrypt/src/sha512.c
    ../lib/wolfssl/wolfcrypt/src/signature.c
    ../lib/wolfssl/wolfcrypt/src/srp.c
    ../lib/wolfssl/wolfcrypt/src/tfm.c
    ../lib/wolfssl/wolfcrypt/src/wc_encrypt.c
    ../lib/wolfssl/wolfcrypt/src/wc_port.c
    ../lib/wolfssl/wolfcrypt/src/wolfevent.c
    ../lib/wolfssl/wolfcrypt/src/wolfmath.c
    ../lib/wolfssl/wolfcrypt/test/test.c
    ../lib/wolfssl/wolfcrypt/user-crypto/src/rsa.c
    ../lib/wolfssl/wolfevent.c
    ../lib/wolfssl/wolfmath.c
1 Like
 attempting to compile firmware 
    Compile failed. Exiting.
    Processing  IDE/ARDUINO/sketches/wolfssl_client/wolfssl_client.ino
    Processing  wolfssl-test.ino
    make -C ../modules/photon/user-part all
    make[1]: Entering directory '/firmware/modules/photon/user-part'
    make -C ../../../user 
    make[2]: Entering directory '/firmware/user'
    Building c file: ed25519.c
    Invoking: ARM GCC C Compiler
    mkdir -p ../build/target/user/platform-8-m
    arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=8 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD008 -DUSBD_PID_CDC=0xC008 -DSPARK_PLATFORM -DFLASHEE_EEPROM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=8 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.6.2 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -I -I./libraries -I -I -I -I -I. -MD -MP -MF ../build/target/user/platform-8-med25519.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=BCM9WCDUSI14 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSE_THREADING=0 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_THREADING=0 -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=4 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,108 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -Wno-pointer-sign -std=gnu99 -c -o ../build/target/user/platform-8-med25519.o ed25519.c

    Building c file: chacha.c
    Invoking: ARM GCC C Compiler
    mkdir -p ../build/target/user/platform-8-m
    arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=8 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD008 -DUSBD_PID_CDC=0xC008 -DSPARK_PLATFORM -DFLASHEE_EEPROM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=8 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.6.2 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -I -I./libraries -I -I -I -I -I. -MD -MP -MF ../build/target/user/platform-8-mchacha.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=BCM9WCDUSI14 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSE_THREADING=0 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_THREADING=0 -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=4 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,108 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -Wno-pointer-sign -std=gnu99 -c -o ../build/target/user/platform-8-mchacha.o chacha.c

    Building c file: keys.c
    Invoking: ARM GCC C Compiler
    mkdir -p ../build/target/user/platform-8-m
    arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=8 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD008 -DUSBD_PID_CDC=0xC008 -DSPARK_PLATFORM -DFLASHEE_EEPROM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=8 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.6.2 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -I -I./libraries -I -I -I -I -I. -MD -MP -MF ../build/target/user/platform-8-mkeys.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=BCM9WCDUSI14 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSE_THREADING=0 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_THREADING=0 -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=4 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,108 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -Wno-pointer-sign -std=gnu99 -c -o ../build/target/user/platform-8-mkeys.o keys.c
    In file included from ../wiring/inc/spark_wiring_print.h:35:0,
                     from ../wiring/inc/spark_wiring_client.h:24,
                     from ../wiring/inc/spark_wiring_tcpclient.h:30,
                     from wolfssl/io.h:120,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_printable.h:32:1: error: unknown type name 'class'
     class Print;
     ^
    ../wiring/inc/spark_wiring_printable.h:40:1: error: unknown type name 'class'
     class Printable
     ^
    ../wiring/inc/spark_wiring_printable.h:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     {
     ^
    In file included from ../wiring/inc/spark_wiring_client.h:24:0,
                     from ../wiring/inc/spark_wiring_tcpclient.h:30,
                     from wolfssl/io.h:120,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_print.h:42:1: error: unknown type name 'class'
     class String;
     ^
    ../wiring/inc/spark_wiring_print.h:43:1: error: unknown type name 'class'
     class __FlashStringHelper;
     ^
    ../wiring/inc/spark_wiring_print.h:45:1: error: unknown type name 'class'
     class Print
     ^
    ../wiring/inc/spark_wiring_print.h:46:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     {
     ^
    In file included from ../wiring/inc/spark_wiring_client.h:25:0,
                     from ../wiring/inc/spark_wiring_tcpclient.h:30,
                     from wolfssl/io.h:120,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_stream.h:44:1: error: unknown type name 'class'
     class Stream : public Print
     ^
    ../wiring/inc/spark_wiring_stream.h:44:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
     class Stream : public Print
                  ^
    In file included from ../wiring/inc/spark_wiring_client.h:26:0,
                     from ../wiring/inc/spark_wiring_tcpclient.h:30,
                     from wolfssl/io.h:120,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_ipaddress.h:41:1: error: unknown type name 'class'
     class IPAddress : public Printable {
     ^
    ../wiring/inc/spark_wiring_ipaddress.h:41:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
     class IPAddress : public Printable {
                     ^
    ../wiring/inc/spark_wiring_ipaddress.h:135:1: error: unknown type name 'IPAddress'
     extern const IPAddress INADDR_NONE;
     ^
    In file included from ../wiring/inc/spark_wiring_tcpclient.h:30:0,
                     from wolfssl/io.h:120,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_client.h:28:1: error: unknown type name 'class'
     class Client : public Stream {
     ^
    ../wiring/inc/spark_wiring_client.h:28:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
     class Client : public Stream {
                  ^
    In file included from wolfssl/io.h:120:0,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../wiring/inc/spark_wiring_tcpclient.h:37:1: error: unknown type name 'class'
     class TCPClient : public Client {
     ^
    ../wiring/inc/spark_wiring_tcpclient.h:37:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
     class TCPClient : public Client {
                     ^
    In file included from ../communication/src/spark_descriptor.h:30:0,
                     from ../communication/src/spark_protocol_functions.h:26,
                     from ../system/inc/system_cloud.h:23,
                     from ../system/inc/system_task.h:31,
                     from ../wiring/inc/spark_wiring_usbserial.h:33,
                     from wolfssl/io.h:121,
                     from wolfssl/ssl.h:89,
                     from wolfssl/internal.h:29,
                     from keys.c:33:
    ../communication/src/events.h:31:1: error: unknown type name 'namespace'
     namespace EventType {
 ^
../communication/src/events.h:31:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 namespace EventType {
             ^
../communication/src/events.h:65:15: error: expected declaration specifiers or '...' before 'sizeof'
 static_assert(sizeof(EventType::Enum)==1, "EventType size is 1");
       ^
../communication/src/events.h:65:43: error: expected declaration specifiers or '...' before string constant
 static_assert(sizeof(EventType::Enum)==1, "EventType size is 1");
                                   ^
../communication/src/events.h:68:1: error: unknown type name 'namespace'
 namespace SubscriptionScope {
 ^
../communication/src/events.h:68:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 namespace SubscriptionScope {
                     ^
../communication/src/events.h:86:3: error: expected specifier-qualifier-list before 'SubscriptionScope'
   SubscriptionScope::Enum scope;
   ^
../communication/src/events.h:95:45: error: unknown type name 'SubscriptionScope'
             const char *event_name, SubscriptionScope::Enum scope);
                                     ^
In file included from ../communication/src/spark_protocol_functions.h:26:0,
         from ../system/inc/system_cloud.h:23,
         from ../system/inc/system_task.h:31,
         from ../wiring/inc/spark_wiring_usbserial.h:33,
         from wolfssl/io.h:121,
         from wolfssl/ssl.h:89,
         from wolfssl/internal.h:29,
         from keys.c:33:
../communication/src/spark_descriptor.h:31:22: fatal error: functional: No such file or directory
 #include <functional>
              ^
compilation terminated.
../build/module.mk:262: recipe for target '../build/target/user/platform-8-mkeys.o' failed
make[2]: Leaving directory '/firmware/user'
make[2]: *** [../build/target/user/platform-8-mkeys.o] Error 1
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: Leaving directory '/firmware/modules/photon/user-part'
make[1]: *** [user] Error 2
../build/recurse.mk:11: recipe for target 'modules/photon/user-part' failed
make: *** [modules/photon/user-part] Error 2

Including Particle.h (or application.h) requires the C++ compiler. The easiest workaround is to rename all of the .c files to .cpp. Depending on your code, this may require some additional modifications to add extern “C” in places, but you’ll at least get past the error you’re seeing now. The other alternative is if the code really only requires built-in C stuff, make sure you don’t include Particle.h or application.h in any shared header file that’s included in a plain .c file.

1 Like

Thanks @rickkas7!
I’ll remove that one include that causes the problems then :slight_smile:

Another thing that is taking forever is adjusting paths. I keep getting errors like “fatal error: wolfssl/wolfcrypt/types.h: No such file or directory”.

Fixing it is easy. I just change this:

#include <wolfssl/wolfcrypt/types.h>

into this:

#include “types.h”

But it’s a massive job to change all paths to be relative throughout the application. Isn’t there a simple flag to just say “always start at the library root” or something like that?

I feel your pain. All those have to be flattened or changed to something consistent. I used a bash script with a few sed statements to quickly change all the strings that were needed across the project. Attached is the script I used to quickly port the development version of TclTcpLibrary / mbedtls. I am currently attempting to port axTLS.

#include <types.h> should work too.

pattern match "wolfssl/wolfcrypt/" to ""

#!/bin/bash

# Use sed to quickly update a downloaded library from
# mbed to put in a form needed by the Particle build
# cloud
##

# Save the operating ROOT directory
##
ROOT=`pwd`
PARTICLE_PROJECT_DIR=/Users/cermak/Particle/projects

# Define a mbedtls source directory (SRC)
# Define the target Particle project directory (PPD)
#SRC=${ROOT}/mbedtls-2.4.2
#PPD=${PARTICLE_PROJECT_DIR}/UbidotsDataFillNew/lib/tls
SRC=${ROOT}/mbedtls-development
PPD=${PARTICLE_PROJECT_DIR}/UbidotsDataFillDev/lib/tls

# Special patch files
##
PATCHDIR=${ROOT}/mbedtls-patches

# Original particle project tree
##
ORIG=${PARTICLE_PROJECT_DIR}/UbidotsDataFill/lib/tls

# Update C library, turn into C++ library
##
cd ${SRC}/library
if [ -e "error.c" ];
then
  echo "Converting c to cpp";
  for i in $(ls *.c); do
    mv $i ${i}pp
  done
else
  echo "Source files already cpp";
fi

# Do mass updates
# Mostly to flatten include statements
# fix casts on "volatile unsigned char *p = v" to
#   "volatile unsigned char *p = (volatile unsigned char*)v"
##
echo "Flatting include statements in cpp and copying";
for i in $(ls *.cpp); do
  sed -i .x -e '1,$s%#include "mbedtls/%#include "%g' $i
  if [ -e "${i}.x" ];
  then
    rm ${i}.x
  fi
  sed -i .x -e '1,$s%volatile unsigned char \*p = (unsigned char\*)v%volatile unsigned char \*p = (volatile unsigned char\*)v%g' $i
  if [ -e "${i}.x" ];
  then
    rm ${i}.x
  fi
  sed -i .x -e '1,$s%volatile unsigned char \*p = v%volatile unsigned char \*p = (volatile unsigned char\*)v%g' $i
  if [ -e "${i}.x" ];
  then
    rm ${i}.x
  fi
  cp $i ${PPD}/
  if [ -e "${ORIG}/$i" ];
  then
    #diff -u ${PPD}/$i ${ORIG}/$i > /dev/null
    diff -u ${PPD}/$i ${ORIG}/$i 
  fi
done

# Update include files
##
echo "Copying include files";
cd ${SRC}/include/mbedtls
for i in $(ls *.h); do
  sed -i .x -e '1,$s%#include "mbedtls/%#include "%g' $i
  if [ -e "${i}.x" ];
  then
    rm ${i}.x
  fi
  cp $i ${PPD}/
  if [ -e "${ORIG}/$i" ];
  then
    #diff -u ${PPD}/$i ${ORIG}/$i > /dev/null
    diff -u ${PPD}/$i ${ORIG}/$i 
  fi
done

# Do special patching in final directory
##
echo "Performing patching on specific files:"
cd ${PPD}
for i in $(ls *.cpp *.h); do
  if [ -e "${PATCHDIR}/${i}.patch" ];
  then
    echo -n "  ";
    patch -p0 < ${PATCHDIR}/${i}.patch
  fi
done

# Make sure NET_C is turned off, it does
# not apply to embedded projects
##
sed -i .x -e '1,$s%^#define MBEDTLS_NET_C%//#define MBEDTLS_NET_C%' config.h
rm -f config.h.x
2 Likes

Are you sure?
Have you tried following the basic project hierarchy to support libraries v2.0?

./lib/<libName>/src/<libName.h>
./lib/<libName>/src/<libName.cpp>
./lib/<libName>/src/library.properties

./lib/<libName>/src/<subFolder>/<extraFiles.h>
1 Like

Yup. That is why I mentioned something consistent. :wink: I didn’t get that far on the mbedtls (re-port) project to push it further into the v2 format.

So - sad but true then @cermak. The reason I want to port WolfSSL is the possibility of using the ATECC508A chip for some of the storage and handling auth. It should offload the Photon enough that you can fit the lib + a decent size app.

I’ve tried using the lib setup @ScruffR and it won’t work for several reasons. The primary one being that the library uses lots of .c files (now renamed to cpp) and that the headers are in different locations than the header files. The error I’m currently getting is this:

applications/wolfssl-test/lib/wolfssl/aes.cpp:27:40: fatal error: wolfssl/wolfcrypt/settings.h: No such file or directory #include <wolfssl/wolfcrypt/settings.h>

the settings file’s location is applications/wolfssl-test/lib/wolfssl/wolfssl/wolfcrypt/settings.h so it should find it? I think the main problem here is that there’s paths within paths and that the compiler does not know what to do with that?

(the settings.h file is linked no less than 150+ places in the source)

Are you porting wolfssl-3.11.0 or wolfssl-3.11.1-tls13-beta?

EDIT: I am wondering if this will still fit into 120k? The site mentions that it is 20 times smaller than openssl. There is a lot of code here. [I reviewed the list at the top again – I don’t think we need all that code. We might at most need one or two directories worth.]

The next step is to also adjust the headers in all the .h files. Are you porting on a Mac or PC? I am on a Mac which is why I do some crazy stuff with sed where I let it create a backup file and then erase it.

The next step after that is you may get symbol errors. This could be from libc usage like printf, etc. It may refer to a function in the .c now .cpp files. In which case, in all your .h files we will need to add extern "C" { }. Any alloc type statements will need a cast.

The compiler is very strict. Any inconsistent use of arguments will need to be corrected. IE: We will see how clean this code is.

In the INSTALL file there is a script that performs the reformatting for the Arduino IDE which will get us closer to the Particle structure.

9. Building with Arduino

    Use the script IDE/ARDUINO/wolfssl-arduino.sh to reformat the wolfSSL
    library for compatibility with the Arduino IDE. There is a README.md in
    IDE/ARDUINO for detailed instructions.

Let’s try this first and see what we get.

I think the code is fairly solid given that it’s already setup for STM32F2x? The integration guide is also pretty solid, but for now I’m just trying to make it compile. Working on the 3.11.0 version for now, but if I manage to get it working I’ll artie something down on how to make it work so others can use it also?

They state that the compiled code is from 20-120k, so that’s why I’m bothering. Having a dedicated chip with storage and hardware acceleration that is Amazon certified is also very tempting :wink:

Oh and that script just copies some files so the Arduino IDE sees what it needs. It’s not too relevant for local compile on the Particle platform.

Thanks! I have a copy of 3.11.0 to push around. More later…

1 Like

I’ve gone through all the paths now, but now I got two new errors:

/usr/local/Cellar/gcc-arm-none-eabi-49/20150306/arm-none-eabi/include/c++/4.9.3/type_traits:284:3: error: template with C linkage
template<typename _Tp>

and:

/usr/local/Cellar/gcc-arm-none-eabi-49/20150306/arm-none-eabi/include/c++/4.9.3/type_traits:273:3: 
error: template specialization with C linkage
template<>

Any ideas? A flag not set?

@jenschr and @ScruffR - the v2 format will pick up the headers. So, we don’t need to restructure the headers at all. The header structure just has to reside in src/.

Are you able to post the entire build output? It looks like there are some conflicts between wolfssl and the Particle firmware.

Looks like I am fairing a bit better, I am now contending with headers that we need to replace. IE: remove <socket.h> references in favor of using TCPClient.

RobPro:wolfssl_client cermak$ particle compile photon

Compiling code for photon

Including:
    wolfssl_client.ino
    ../../library.properties
    ../../src/aes.cpp
    ../../src/arc4.cpp
    ../../src/asm.cpp
    ../../src/asn.cpp
    ../../src/async.cpp
    ../../src/blake2b.cpp
    ../../src/camellia.cpp
    ../../src/chacha.cpp
    ../../src/chacha20_poly1305.cpp
    ../../src/cmac.cpp
    ../../src/coding.cpp
    ../../src/compress.cpp
    ../../src/crl.cpp
    ../../src/curve25519.cpp
    ../../src/dh.cpp
    ../../src/des3.cpp
    ../../src/dsa.cpp
    ../../src/ecc_fp.cpp
    ../../src/ecc.cpp
    ../../src/ed25519.cpp
    ../../src/fe_low_mem.cpp
    ../../src/error.cpp
    ../../src/fe_operations.cpp
    ../../src/ge_low_mem.cpp
    ../../src/ge_operations.cpp
    ../../src/hash.cpp
    ../../src/hc128.cpp
    ../../src/hmac.cpp
    ../../src/idea.cpp
    ../../src/integer.cpp
    ../../src/internal.cpp
    ../../src/io.cpp
    ../../src/keys.cpp
    ../../src/logging.cpp
    ../../src/md2.cpp
    ../../src/md4.cpp
    ../../src/md5.cpp
    ../../src/memory.cpp
    ../../src/misc.cpp
    ../../src/ocsp.cpp
    ../../src/pkcs12.cpp
    ../../src/pkcs7.cpp
    ../../src/poly1305.cpp
    ../../src/pwdbased.cpp
    ../../src/rabbit.cpp
    ../../src/random.cpp
    ../../src/ripemd.cpp
    ../../src/rsa.cpp
    ../../src/sha.cpp
    ../../src/sha256.cpp
    ../../src/sha512.cpp
    ../../src/signature.cpp
    ../../src/sniffer.cpp
    ../../src/srp.cpp
    ../../src/ssl.cpp
    ../../src/tfm.cpp
    ../../src/tls.cpp
    ../../src/wc_encrypt.cpp
    ../../src/wc_port.cpp
    ../../src/wolfevent.cpp
    ../../src/wolfmath.cpp
    ../../src/wolfssl.cpp
    ../../src/wolfssl.h
    ../../src/wolfssl/callbacks.h
    ../../src/wolfssl/certs_test.h
    ../../src/wolfssl/crl.h
    ../../src/wolfssl/error-ssl.h
    ../../src/wolfssl/include.am
    ../../src/wolfssl/internal.h
    ../../src/wolfssl/io.h
    ../../src/wolfssl/ocsp.h
    ../../src/wolfssl/options.h
    ../../src/wolfssl/options.h.in
    ../../src/wolfssl/sniffer.h
    ../../src/wolfssl/sniffer_error.h
    ../../src/wolfssl/sniffer_error.rc
    ../../src/wolfssl/ssl.h
    ../../src/wolfssl/test.h
    ../../src/wolfssl/version.h
    ../../src/wolfssl/version.h.in
    ../../src/wolfssl/openssl/aes.h
    ../../src/wolfssl/openssl/asn1.h
    ../../src/wolfssl/openssl/bio.h
    ../../src/wolfssl/openssl/bn.h
    ../../src/wolfssl/openssl/conf.h
    ../../src/wolfssl/openssl/crypto.h
    ../../src/wolfssl/openssl/des.h
    ../../src/wolfssl/openssl/dh.h
    ../../src/wolfssl/openssl/dsa.h
    ../../src/wolfssl/openssl/ec.h
    ../../src/wolfssl/openssl/ec25519.h
    ../../src/wolfssl/openssl/ecdh.h
    ../../src/wolfssl/openssl/ecdsa.h
    ../../src/wolfssl/openssl/ed25519.h
    ../../src/wolfssl/openssl/engine.h
    ../../src/wolfssl/openssl/err.h
    ../../src/wolfssl/openssl/evp.h
    ../../src/wolfssl/openssl/hmac.h
    ../../src/wolfssl/openssl/include.am
    ../../src/wolfssl/openssl/lhash.h
    ../../src/wolfssl/openssl/md4.h
    ../../src/wolfssl/openssl/md5.h
    ../../src/wolfssl/openssl/ocsp.h
    ../../src/wolfssl/openssl/opensslconf.h
    ../../src/wolfssl/openssl/opensslv.h
    ../../src/wolfssl/openssl/ossl_typ.h
    ../../src/wolfssl/openssl/pem.h
    ../../src/wolfssl/openssl/pkcs12.h
    ../../src/wolfssl/openssl/rand.h
    ../../src/wolfssl/openssl/ripemd.h
    ../../src/wolfssl/openssl/rsa.h
    ../../src/wolfssl/openssl/sha.h
    ../../src/wolfssl/openssl/ssl.h
    ../../src/wolfssl/openssl/ssl23.h
    ../../src/wolfssl/openssl/stack.h
    ../../src/wolfssl/openssl/ui.h
    ../../src/wolfssl/openssl/x509.h
    ../../src/wolfssl/openssl/x509v3.h
    ../../src/wolfssl/wolfcrypt/arc4.h
    ../../src/wolfssl/wolfcrypt/aes.h
    ../../src/wolfssl/wolfcrypt/asn.h
    ../../src/wolfssl/wolfcrypt/asn_public.h
    ../../src/wolfssl/wolfcrypt/async.h
    ../../src/wolfssl/wolfcrypt/blake2-impl.h
    ../../src/wolfssl/wolfcrypt/blake2-int.h
    ../../src/wolfssl/wolfcrypt/blake2.h
    ../../src/wolfssl/wolfcrypt/camellia.h
    ../../src/wolfssl/wolfcrypt/chacha.h
    ../../src/wolfssl/wolfcrypt/chacha20_poly1305.h
    ../../src/wolfssl/wolfcrypt/cmac.h
    ../../src/wolfssl/wolfcrypt/coding.h
    ../../src/wolfssl/wolfcrypt/compress.h
    ../../src/wolfssl/wolfcrypt/curve25519.h
    ../../src/wolfssl/wolfcrypt/des3.h
    ../../src/wolfssl/wolfcrypt/dh.h
    ../../src/wolfssl/wolfcrypt/dsa.h
    ../../src/wolfssl/wolfcrypt/ecc.h
    ../../src/wolfssl/wolfcrypt/ed25519.h
    ../../src/wolfssl/wolfcrypt/error-crypt.h
    ../../src/wolfssl/wolfcrypt/fe_operations.h
    ../../src/wolfssl/wolfcrypt/fips_test.h
    ../../src/wolfssl/wolfcrypt/ge_operations.h
    ../../src/wolfssl/wolfcrypt/hash.h
    ../../src/wolfssl/wolfcrypt/hc128.h
    ../../src/wolfssl/wolfcrypt/hmac.h
    ../../src/wolfssl/wolfcrypt/idea.h
    ../../src/wolfssl/wolfcrypt/include.am
    ../../src/wolfssl/wolfcrypt/integer.h
    ../../src/wolfssl/wolfcrypt/logging.h
    ../../src/wolfssl/wolfcrypt/md2.h
    ../../src/wolfssl/wolfcrypt/md4.h
    ../../src/wolfssl/wolfcrypt/md5.h
    ../../src/wolfssl/wolfcrypt/mem_track.h
    ../../src/wolfssl/wolfcrypt/memory.h
    ../../src/wolfssl/wolfcrypt/misc.h
    ../../src/wolfssl/wolfcrypt/mpi_class.h
    ../../src/wolfssl/wolfcrypt/mpi_superclass.h
    ../../src/wolfssl/wolfcrypt/pkcs12.h
    ../../src/wolfssl/wolfcrypt/pkcs7.h
    ../../src/wolfssl/wolfcrypt/poly1305.h
    ../../src/wolfssl/wolfcrypt/pwdbased.h
    ../../src/wolfssl/wolfcrypt/rabbit.h
    ../../src/wolfssl/wolfcrypt/random.h
    ../../src/wolfssl/wolfcrypt/ripemd.h
    ../../src/wolfssl/wolfcrypt/rsa.h
    ../../src/wolfssl/wolfcrypt/settings.h
    ../../src/wolfssl/wolfcrypt/sha.h
    ../../src/wolfssl/wolfcrypt/sha256.h
    ../../src/wolfssl/wolfcrypt/sha512.h
    ../../src/wolfssl/wolfcrypt/signature.h
    ../../src/wolfssl/wolfcrypt/srp.h
    ../../src/wolfssl/wolfcrypt/tfm.h
    ../../src/wolfssl/wolfcrypt/types.h
    ../../src/wolfssl/wolfcrypt/visibility.h
    ../../src/wolfssl/wolfcrypt/wc_encrypt.h
    ../../src/wolfssl/wolfcrypt/wc_port.h
    ../../src/wolfssl/wolfcrypt/wolfevent.h
    ../../src/wolfssl/wolfcrypt/wolfmath.h
    ../../src/wolfssl/wolfcrypt/port/nrf51.h
    ../../src/wolfssl/wolfcrypt/port/atmel/atmel.h
    ../../src/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
    ../../src/wolfssl/wolfcrypt/port/intel/quickassist.h
    ../../src/wolfssl/wolfcrypt/port/intel/quickassist_mem.h
    ../../src/wolfssl/wolfcrypt/port/nxp/ksdk_port.h
    ../../src/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h
    ../../src/wolfssl/wolfcrypt/port/ti/ti-ccm.h
    ../../src/wolfssl/wolfcrypt/port/ti/ti-hash.h
attempting to compile firmware 
Compile failed. Exiting.
Processing  src/wolfssl_client.ino
make -C ../modules/photon/user-part all
make[1]: Entering directory '/firmware/modules/photon/user-part'
make -C ../../../user 
make[2]: Entering directory '/firmware/user'
Building cpp file: src/io.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-6-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=6 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.6.2 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -Isrc -I./libraries -Isrc -Isrc -Isrc -Isrc -I. -MD -MP -MF ../build/target/user/platform-6-msrc/io.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=BCM9WCDUSI09 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSE_THREADING=0 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_THREADING=0 -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=4 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,108 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/user/platform-6-msrc/io.o src/io.cpp
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/dirent.h:6:0,
                 from src/wolfssl/wolfcrypt/wc_port.h:274,
                 from src/wolfssl/wolfcrypt/types.h:28,
                 from src/wolfssl/internal.h:28,
                 from src/io.cpp:37:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
 #error "<dirent.h> not supported"
  ^
In file included from src/wolfssl/ssl.h:89:0,
                 from src/wolfssl/internal.h:29,
                 from src/io.cpp:37:
src/wolfssl/io.h:118:36: fatal error: sys/socket.h: No such file or directory
             #include <sys/socket.h>
                                    ^
compilation terminated.
../build/module.mk:267: recipe for target '../build/target/user/platform-6-msrc/io.o' failed
make[2]: *** [../build/target/user/platform-6-msrc/io.o] Error 1
make[2]: Leaving directory '/firmware/user'
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: Leaving directory '/firmware/modules/photon/user-part'
make[1]: *** [user] Error 2
../build/recurse.mk:11: recipe for target 'modules/photon/user-part' failed
make: *** [modules/photon/user-part] Error 2

I have this out on a GitHub repo.

See the bin directory for my migration script to copy code into the Particle v2 format.

That was quick! Much smoother than the way I did it!
Most of these will go away if you just open /src/wolfssl/wolfcrypt/settings.h and set the platform to be WOLFSSL_STM32F2. It’s primarily complaining about files for Linux here and there’s a few things I think need to be added to the define’s for WOLFSSL_STM32F2 further down the settings file.

Compiling now will give us a bunch of errors like this:

error: 'pthread_mutex_t' does not name a type
'wolfSSL_Mutex' was not declared in this scope

Thanks to this thread I found that adding the define:

#define SINGLE_THREADED

will remove the errors. This is also correct, since the MCU should be probably be running this in a single thread. There’s options to integrate with FreeRTOS, but I have not found enough docs for how this works in the Photon to try turning that on.

The Arduino folder has a good example for how it should work. I’ve made this very basic example using tcpclient for now, but I’m getting som odd errors:

lib/wolfssl/src/io.cpp: In function 'int wolfIO_Recv(SOCKET_T, char*, int, int)':
lib/wolfssl/src/io.cpp:511:52: error: 'recv' was not declared in this scope
 recvd = (int)RECV_FUNCTION(sd, buf, sz, rdFlags);

This is odd since a variable by the name “recv” isn’t mentioned in that file at all. It’s getting late over here now, so I’ll get back to this tomorrow.

This isn't quite clear in the docs. Even in the extended structure example.
I am glad it works. I will send a pull request for a suggested update to try and make that clearer.

I am more use to includes in a separate structure like:

  • project
    • src/
    • include/

Due to the nature of compiling in the cloud, there isn't room to go poking around in directory structures outside src/ so this makes sense.

So, the preferred structure is:

  • project
    • src/
    • src/include/

Thanks for the tip! That will help with the other projects.

Is there a reason you chose to use WOLFSSL_STM32F2?

The WOLF_IAR_ARM is more on target as this platform is ARM. This particular define keeps the sys/sockets.h from being included. I had to add NO_OLD_RNGNAME to get around the redefine of RNG which in itself is used in the Particle firmware.

There are some other tweaks. The repo is updated. We are both now working on the example program. :slight_smile: Progress.