Wiznet / RP2040-HAT-AWS-C

AWS IoT SDK Example for RP2040
6 stars 4 forks source link

Building on Windows or Linux causing same issue #6

Open MickeWest opened 4 months ago

MickeWest commented 4 months ago

Hi -

Some background first, I have setup the environment in Windows and in Linux, using the instructions here and using the PDF: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

All the simple blinky sample apps etc and my own apps compile fine, run on the Device (W5500-EVB-Pico), and I can use the DebugProbe to step through the code.

Then I clone the code from here (https://github.com/Wiznet/RP2040-HAT-AWS-C) and follow the instructions on how to setup it all up. The instructions are very simple and should just compile.

However, on both windows and Linux I get the following build error (see log below), which I am not sure why I get if everyone else succeeds in buildling the code. There must be something I am doing wrong? I am using VS Code as a Development Environment. Someone on a forum (in a similar problem) suggested remove the build flag -Werror so it no longer stops on this warning/error. However, I did that in a few CMakeLists.txt files but then realized it so many, so many levels down. And this cannot be the right approach as others can build.

I would really appreciate some insight in what I may be missing! What I am not setting up right? Considering this is the ONLY code not compiling and the warning, turned error through the -Werror flag, it must either be updated code in the repo and no one has compiled it since, or, more likely, I am still doingin something wrong.

Thanks,

Michael

mwestberg@raspberrypi4:/pico/RP2040_HAT_AWS_C/build $ make clean
mwestberg@raspberrypi4:/pico/RP2040_HAT_AWS_C/build $ make
RP2040-HAT-AWS-C patch utils found
cleaning aws-iot-device-sdk-embedded-C...
HEAD is now at 9de6cc4e Add Fleet Provisioning macro definitions in CMake command (#1708)
aws-iot-device-sdk-embedded-C cleaned
cleaning ioLibrary_Driver...
HEAD is now at ce4a7b6 Fix W5100S getIR()
ioLibrary_Driver cleaned
cleaning mbedtls...
HEAD is now at 662deb38d Merge pull request #3547 from ronald-cron-arm/psa-openless
mbedtls cleaned
cleaning pico-extras...
HEAD is now at 77eae28 Add PICO_SCANVIDEO_SCANLINE_RELEASE_FUNCTION for callback when scanlines are available (non host only)
pico-extras cleaned
cleaning pico-sdk...
HEAD is now at 2062372 SDK 1.3.0 release
pico-sdk cleaned
cleaning aws-iot-device-sdk-embedded-C coreHTTP...
HEAD is now at 9f511d5 Update CHANGELOG, version numbers, and add C++ header guards (#109)
aws-iot-device-sdk-embedded-C coreHTTP cleaned
cleaning aws-iot-device-sdk-embedded-C coreMQTT...
HEAD is now at 51c8067 Update version and add C++ guards (#168)
aws-iot-device-sdk-embedded-C coreMQTT cleaned
cleaning aws-iot-device-sdk-embedded-C coreHTTP http_parser...
HEAD is now at ec8b5ee doc: add maintenance notice to readme
aws-iot-device-sdk-embedded-C coreHTTP http_parser cleaned
Skipping submodule 'test/cbmc/aws-templates-for-cbmc-proofs'
Skipping submodule 'test/cbmc/litani'
Skipping submodule 'test/unit-test/CMock'
cleaning pico-sdk tinyusb...
HEAD is now at 4bfab30c0 Merge pull request #1139 from hathach/release-0.12.0
pico-sdk tinyusb cleaned
submodules aws-iot-device-sdk-embedded-C coreHTTP initialised
Running patch /home/mwestberg/pico/RP2040_HAT_AWS_C/patches/01_aws_iot_device_sdk_embedded_c_corehttp_network_interface.patch
PICO_SDK_PATH is /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/pico-sdk
PICO platform is rp2040.
-- RP2040-HAT-AWS-C SDK version is 2.1.0
PICO target board is pico.
Using board configuration from /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
Using PICO_EXAMPLES_PATH from environment ('/home/mwestberg/pico/pico-examples')
-- WIZNET_CHIP = W5100S
-- AWS_SDK_DIR = /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/aws-iot-device-sdk-embedded-C
-- WIZNET_DIR = /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/ioLibrary_Driver
-- MBEDTLS_DIR = /home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/mbedtls
-- PORT_DIR = /home/mwestberg/pico/RP2040_HAT_AWS_C/port
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mwestberg/pico/RP2040_HAT_AWS_C/build
[  0%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[  1%] Linking ASM executable bs2_default.elf
[  1%] Built target bs2_default
[  1%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/aes.c.obj
[  2%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/aesni.c.obj
[  2%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/arc4.c.obj
[  2%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/aria.c.obj
[  2%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/asn1parse.c.obj
[  2%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/asn1write.c.obj
[  3%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/base64.c.obj
[  3%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/bignum.c.obj
[  3%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/blowfish.c.obj
[  3%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/camellia.c.obj
[  3%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ccm.c.obj
[  4%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/chacha20.c.obj
[  4%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/chachapoly.c.obj
[  4%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/cipher.c.obj
[  4%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/cipher_wrap.c.obj
[  4%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/cmac.c.obj
[  5%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ctr_drbg.c.obj
[  5%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/des.c.obj
[  5%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/dhm.c.obj
[  5%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ecdh.c.obj
[  6%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ecdsa.c.obj
[  6%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ecjpake.c.obj
[  6%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ecp.c.obj
[  6%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ecp_curves.c.obj
[  6%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/entropy.c.obj
[  7%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.obj
[  7%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/error.c.obj
[  7%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/gcm.c.obj
[  7%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/havege.c.obj
[  7%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/hkdf.c.obj
[  8%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/hmac_drbg.c.obj
[  8%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/md.c.obj
[  8%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/md2.c.obj
[  8%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/md4.c.obj
[  8%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/md5.c.obj
[  9%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/memory_buffer_alloc.c.obj
[  9%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/nist_kw.c.obj
[  9%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/oid.c.obj
[  9%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/padlock.c.obj
[  9%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pem.c.obj
[ 10%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pk.c.obj
[ 10%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pk_wrap.c.obj
[ 10%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pkcs12.c.obj
[ 10%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pkcs5.c.obj
[ 10%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pkparse.c.obj
[ 11%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/pkwrite.c.obj
[ 11%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/platform.c.obj
[ 11%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/platform_util.c.obj
[ 11%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/poly1305.c.obj
[ 11%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_crypto.c.obj
[ 12%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_crypto_driver_wrappers.c.obj
[ 12%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_crypto_se.c.obj
[ 12%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_crypto_slot_management.c.obj
[ 12%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_crypto_storage.c.obj
[ 13%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/psa_its_file.c.obj
[ 13%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/ripemd160.c.obj
[ 13%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/rsa.c.obj
[ 13%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/rsa_internal.c.obj
[ 13%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/sha1.c.obj
[ 14%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/sha256.c.obj
[ 14%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/sha512.c.obj
[ 14%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/threading.c.obj
[ 14%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/timing.c.obj
[ 14%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/version.c.obj
[ 15%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/version_features.c.obj
[ 15%] Building C object libraries/mbedtls/library/CMakeFiles/mbedcrypto.dir/xtea.c.obj
[ 15%] Linking C static library libmbedcrypto.a
[ 15%] Built target mbedcrypto
[ 16%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/certs.c.obj
[ 16%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/pkcs11.c.obj
[ 16%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509.c.obj
[ 16%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509_create.c.obj
[ 16%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509_crl.c.obj
[ 17%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509_crt.c.obj
[ 17%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509_csr.c.obj
[ 17%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509write_crt.c.obj
[ 17%] Building C object libraries/mbedtls/library/CMakeFiles/mbedx509.dir/x509write_csr.c.obj
[ 18%] Linking C static library libmbedx509.a
[ 18%] Built target mbedx509
[ 18%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/debug.c.obj
[ 18%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/net_sockets.c.obj
[ 19%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cache.c.obj
[ 19%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ciphersuites.c.obj
[ 19%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cli.c.obj
[ 19%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cookie.c.obj
[ 19%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_msg.c.obj
[ 20%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_srv.c.obj
[ 20%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ticket.c.obj
[ 20%] Building C object libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_tls.c.obj
/home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/mbedtls/library/ssl_tls.c:1755:48: error: argument 2 of type 'unsigned char[32]' with mismatched bound [-Werror=array-parameter=]
 1755 |                                  unsigned char hash[32],
      |                                  ~~~~~~~~~~~~~~^~~~~~~~
/home/mwestberg/pico/RP2040_HAT_AWS_C/libraries/mbedtls/library/ssl_tls.c:690:69: note: previously declared as 'unsigned char *'
  690 | static void ssl_calc_verify_tls_sha256( const mbedtls_ssl_context *,unsigned char *, size_t * );
      |                                                                     ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [libraries/mbedtls/library/CMakeFiles/mbedtls.dir/build.make:202: libraries/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_tls.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:2055: libraries/mbedtls/library/CMakeFiles/mbedtls.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
wiznet-mason commented 4 months ago

Hi, Can you try again with latest commit? I have updated mbedtls to the latest version and checked that it resolved your issue.