Giter Site home page Giter Site logo

mbed-os-example-tls's Introduction

Mbed TLS Examples on Mbed OS

The example project is part of the Arm Mbed OS Official Examples. This repository contains a collection of Mbed TLS example applications based on Mbed OS. Each subdirectory contains a separate example meant for building as an executable.

Getting started

Required hardware

  • Any Mbed OS capable development board such as those listed here, which have an entropy source integrated into Mbed TLS. The single example that does not need an entropy source is hashing. To use the tls-client example you should also have a network interface supported on your board.

If your board has no hardware entropy source or its entropy source is not integrated with Mbed TLS, but you want to try these examples anyway, then you may want to consider compiling Mbed TLS without real entropy sources.

Warning! Without entropy sources Mbed TLS does not provide any security whatsoever. If you still want to compile Mbed TLS without entropy sources, then consult the section "How to test without entropy sources" in the Mbed TLS Porting Guide.

Required software

An alternative to Mbed CLI is to use the Mbed Online Compiler. In this case, you need to import the example projects from Mbed developer to your Mbed Online Compiler session using the links below:

Mbed OS build tools

Mbed CLI 2

Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section Mbed CLI 1.

Install Mbed CLI 2

Mbed CLI 1

Install Mbed CLI 1

Building and running the examples

  1. Clone the repository containing the collection of examples:

    $ git clone https://github.com/ARMmbed/mbed-os-example-tls
  2. Open a command line tool and navigate to one of the project’s subdirectories.

  3. Update the source tree:

    • Mbed CLI 2
    $ mbed-tools deploy
    • Mbed CLI 1
    $ mbed deploy
  4. Connect a USB cable between the USB port on the board and the host computer.

  5. Run the following command to build the example project, program the microcontroller flash memory, and open a serial terminal to the device:

    • Mbed CLI 2
    $ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
    • Mbed CLI 1
    $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
  6. Press the RESET button on the board to run the program.

Your PC may take a few minutes to compile your code.

The binary will be located in the following directory:

  • Mbed CLI 2 - ./cmake_build/<TARGET>/develop/<TOOLCHAIN>/
  • Mbed CLI 1 - ./BUILD/<TARGET>/<TOOLCHAIN>/

You can manually copy the binary to the target, which gets mounted on the host computer through USB, rather than using the --flash option.

You can also open a serial terminal separately, as explained below, rather than using the --sterm option.

Monitoring the application

Please browse the subdirectories for specific documentation.

  • authcrypt: performs authenticated encryption and authenticated decryption of a buffer.
  • benchmark: benchmarks the various cryptographic primitives offered by Mbed TLS.
  • hashing: performs hashing of a buffer with SHA-256 using various APIs.
  • tls-client: downloads a file from an HTTPS server (os.mbed.com) and looks for a specific string in that file.

The application prints debug messages over the serial port, so you can monitor its activity with a serial terminal emulator. The default serial baudrate has been set to 9600 for these examples. If not using the --sterm option when flashing, have a client open and connected to board. You may use:

  • Mbed CLI 2

    $ mbed-tools sterm
  • Mbed CLI 1

    $ mbed sterm
  • Tera Term for Windows

  • screen or minicom for Linux

    $ screen /dev/serial/<your board> 9600

After pressing the RESET button on the board, you should be able to observe the application's output.

Debugging Mbed TLS

To optionally print out more debug information, edit the main.cpp for the sample and change the definition of DEBUG_LEVEL (near the top of the file) from 0 to a positive number between 1 and 4.

License and contributions

The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.

This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.

mbed-os-example-tls's People

Contributors

0xc0170 avatar adbridge avatar andrzejkurek avatar c1728p9 avatar cmonr avatar dgreen-arm avatar gilles-peskine-arm avatar gpsimenos avatar hugueskamba avatar k-stachowiak avatar ldong-arm avatar mbedmain avatar michalpasztamobica avatar patater avatar rajkan01 avatar rwalton-arm avatar saheerb avatar sg- avatar simonbutcher avatar studavekar avatar urutva avatar wernerlewis avatar yanesca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbed-os-example-tls's Issues

authcrypt example fails to link on IAR 8.2 + Ublox ODIN

authcrypt example fails to link with IAR8.2+Ublox ODIN. error:

log https://jenkins-internal.mbed.com/job/mbedtls-mbed-os-examples-pr/74/execution/node/828/log/

14:56:57 Link: authcrypt
14:56:57 Error[Li060]: module "cb_main.o(libublox-odin-w2-driver.a)" contains C++ code
14:56:57           built for use with the (E)C++98 library. This code is not link
14:56:57           compatible with the new (C++14) library.
14:56:57 Error[Li009]: runtime model conflict: Module
14:56:57           cb_main.o(libublox-odin-w2-driver.a) specifies that '__CPP_Language'
14:56:57           must be 'C++', but module authcrypt.o has the value 'C++14'. Modules
14:56:57           compiled with C++14 are not link-compatible with modules that are
14:56:57           compiled with older C++.
14:56:57 Error[Li060]: module "cb_ticker_wrapper.o(libublox-odin-w2-driver.a)" contains
14:56:57           C++ code built for use with the (E)C++98 library. This code is not
14:56:57           link compatible with the new (C++14) library.
14:56:57 Warning[Lt009]: Inconsistent wchar_t size
14:56:57             cb_main.o(libublox-odin-w2-driver.a) and 106 other objects have
14:56:57                       wchar_t size 16 bits
14:56:57             authcrypt.o and 519 other objects, some of them in dlpp7M_tl_fc.a
14:56:57                       and 104 other libraries have wchar_t size 32 bits
14:56:57 [ERROR] Error[Li060]: module "cb_main.o(libublox-odin-w2-driver.a)" contains C++ code
14:56:57           built for use with the (E)C++98 library. This code is not link
14:56:57           compatible with the new (C++14) library.
14:56:57 Error[Li009]: runtime model conflict: Module
14:56:57           cb_main.o(libublox-odin-w2-driver.a) specifies that '__CPP_Language'
14:56:57           must be 'C++', but module authcrypt.o has the value 'C++14'. Modules
14:56:57           compiled with C++14 are not link-compatible with modules that are
14:56:57           compiled with older C++.
14:56:57 Error[Li060]: module "cb_ticker_wrapper.o(libublox-odin-w2-driver.a)" contains
14:56:57           C++ code built for use with the (E)C++98 library. This code is not
14:56:57           link compatible with the new (C++14) library.
14:56:57 Warning[Lt009]: Inconsistent wchar_t size
14:56:57             cb_main.o(libublox-odin-w2-driver.a) and 106 other objects have
14:56:57                       wchar_t size 16 bits
14:56:57             authcrypt.o and 519 other objects, some of them in dlpp7M_tl_fc.a
14:56:57                       and 104 other libraries have wchar_t size 32 bits
14:56:57 
14:56:57 [mbed] ERROR: "python" returned error code 1.
14:56:57 [mbed] ERROR: Command "python -u C:\builds\ws\mbedtls-mbed-os-examples-pr\authcrypt\mbed-os\tools\make.py -t IAR -m UBLOX_EVK_ODIN_W2 --source . --build .\BUILD\UBLOX_EVK_ODIN_W2\IAR" in "C:\builds\ws\mbedtls-mbed-os-examples-pr\authcrypt"
14:56:57 ---

tls-client does not check that network stack and ethernet are available

The tls-client example does not check whether the networking features (e.g. ethernet) are available in the target device at compile-time. This can result in various failures at compile/run time that are not necessarily easy to debug. Preprocessor checks should be added to the example to ensure that a comprehensible error message is printed if ethernet is not available.

Documentation should be extended to cover non K64F boards OoB#5

README file should be extended to cover non-K64F use cases:

  • Explicitly mention that at this stage other boards are not supported, otherwise people are faced with:
plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400
Example failed with error 1

which doesn't mean much for them

  • Documentation should enable people to implement support for TLS on their boards. It should be documented what is required (and what needs to be done) to get the demo up and running on different boards

CC: @rhenson

tls-client example failing in UBLOX_EVK_ODIN_W2 dev board

The tls-client compiles correctly with ARMCC and gcc for the UBLOX_EVK_ODIN_W2 target using mbed-os-5.3.0-rc1. However, no output is observed in the serial terminal when the application is run.

To reproduce, compile the program, flash and then connect the serial terminal:

mbed compile -t GCC_ARM -m UBLOX_EVK_ODIN_W2

Compiling tls examples with Keil throws warnings

Compiling "tls examples" with Keil gives multiple warnings with freescale target device
warning: #66-D: enumeration value is out of "int" range

Steps to reproduce run the command:

  1. Clone "mbed-os-example-tls"
  2. Enter authcrypt directory
  3. mbed deploy
  4. mbed export -i uVision -m K64F
  5. Build code on Keil uVision

@sg- @maclobdell @mmahadevan108 : enums are used for register specific defines (unsigned int) in target specific code and as per C standard range of enum is limited to int. Hence we see out of range warning for enums.

mbedTLS causes stack overflow on some mbedOS targets

The stack requirements for mbed TLS largely depend on the configuration used at compile time. However, there are no stack memory consumption figures available to help users decide on an appropriate stack size for embedded applications. As a result, it is very common that mbed TLS causes stack overflow errors that may or may not the caught by the system depending on the severity of the issue.

Assertation failed in the benchmark example

Following assertion occurred in the benchamrk example.

  SHA-256                  :       1910 Kb/s,         61 cycles/byte
  SHA-512                  :        614 Kb/s,        191 cycles/byte
  AES-CBC-128              :       1355 Kb/s,         86 cycles/byte
  AES-CBC-192              :       1191 Kb/s,         98 cycles/byte
  AES-CBC-256              :       1063 Kb/s,        110 cycles/byte
  AES-GCM-128              :        440 Kb/s,        267 cycles/byte
  AES-GCM-192              :        421 Kb/s,        279 cycles/byte
  AES-GCM-256              :        404 Kb/s,        291 cycles/byte
  AES-CCM-128              :        586 Kb/s,        200 cycles/byte
  AES-CCM-192              :        523 Kb/s,        224 cycles/byte
  AES-CCM-256              :        472 Kb/s,        248 cycles/byte
  CTR_DRBG (NOPR)          :       1110 Kb/s,        105 cycles/byte
  CTR_DRBG (PR)            :        796 Kb/s,        147 cycles/byte
  HMAC_DRBG SHA-256 (NOPR) :        218 Kb/s,        541 cycles/byte
  HMAC_DRBG SHA-256 (PR)   :        192 Kb/s,        616 cycles/byte
  RSA-2048                 :      30 ms/ public
  RSA-2048                 :    1041 ms/private
  RSA-4096                 :     100 ms/ public
  RSA-4096                 :    5742 ms/private
  ECDSA-secp384r1          :  mbed assertation failed: interrupts_disabled, file: .\mbed-os\hal\common\mbed_critical.c, line 54

mbed OS version

[mbed] Importing program "mbed-os-example-tls" from "https://github.com/armmbed/mbed-os-example-tls" at latest revision in the current branch
[mbed] Adding library "authcrypt\mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #21dd7008a154
[mbed] Adding library "benchmark\mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #21dd7008a154
[mbed] Adding library "hashing\mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #21dd7008a154
[mbed] Adding library "tls-client\mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #21dd7008a154
[mbed] Couldn't find build tools in your program. Downloading the mbed 2.0 SDK tools...

Build command

$ cd benchmark
$ mbed compile -m K64F -t GCC_ARM

Authcrypt example, exported with make_iar for Hexiwear - nothing happens

Steps to Reproduce:

  1. Navigate to the authcrypt directory and run mbed export -i make_iar -m HEXIWEAR
    Output:
$ mbed export -i make_iar -m HEXIWEAR
[mbed] WARNING: Could not find mbed program in current path "C:\Repos\mbed-os-example-tls\authcrypt".
[mbed] WARNING: You can fix this by calling "mbed new ." in the root of your program.
---
Scan: .
Scan: FEATURE_BLE
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_LWIP
Scan: FEATURE_UVISOR
Scan: FEATURE_ETHERNET_HOST
Scan: FEATURE_LOWPAN_BORDER_ROUTER
Scan: FEATURE_LOWPAN_HOST
Scan: FEATURE_LOWPAN_ROUTER
Scan: FEATURE_NANOSTACK
Scan: FEATURE_NANOSTACK_FULL
Scan: FEATURE_THREAD_BORDER_ROUTER
Scan: FEATURE_THREAD_END_DEVICE
Scan: FEATURE_THREAD_ROUTER
Scan: FEATURE_STORAGE
  1. Run make (in my case I'm using GnuWin32 make)
    Output:
$ make
C:/Repos/mbed-os-example-tls/authcrypt/makefile:508: warning: overriding commands for target `.s.o'
C:/Repos/mbed-os-example-tls/authcrypt/makefile:503: warning: ignoring old commands for target `.s.o'
"Compile: main.cpp"

   IAR ANSI C/C++ Compiler V7.80.1.11864/W32 for ARM
   Copyright 1999-2016 IAR Systems AB.
   Network license: 10.118.12.44 (STD)

      using FileSystemHandle::open;
      ^
"C:\Repos\mbed-os-example-tls\authcrypt\mbed-os\platform\FileSystemLike.h",47  Warning[Pe941]: duplicate using-declaration of "mbed::FileSystemHandle::open" ignored

 570 bytes of CODE  memory (+ 154 bytes shared)
 704 bytes of CONST memory (+  12 bytes shared)

Errors: none
Warnings: 1
"link: authcrypt.elf"

   IAR ELF Linker V7.80.1.11864/W32 for ARM
   Copyright 2007-2016 IAR Systems AB.

   55 254 bytes of readonly  code memory
    5 706 bytes of readonly  data memory
  114 975 bytes of readwrite data memory

Errors: none
Warnings: none

Link time:   0.48 (CPU)   0.47 (elapsed)
'ielftool' --bin authcrypt.elf authcrypt.bin

   IAR ELF Tool V9.21.1.163 [BUILT at IAR]
   Copyright 2007-2016 IAR Systems AB.

Loading authcrypt.elf
Saving binary file to authcrypt.bin
"===== bin file ready to flash: BUILD/authcrypt.bin ====="
'ielftool' --ihex authcrypt.elf authcrypt.hex

   IAR ELF Tool V9.21.1.163 [BUILT at IAR]
   Copyright 2007-2016 IAR Systems AB.

Loading authcrypt.elf
Saving ihex file to authcrypt.hex
  1. Drag the created .bin file in the BUILD directory to the HEXIWEAR board

  2. Connect serial port monitor to the board (in my case COM16)

Expected Output:

plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400
ciphertext: c1a5ffe0078e90fb969cadb7fc2afe3d399857f91928e54cd0c9441192adb6de0d7938b1ae8bc608dff64f37534dc3f0f9a6a41ce1ec9f1c733989
decrypted: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400

DONE

Actual Output:

Nothing

Notes:

  • I am using the mbed-os-5.5.0-rc1-oob branch
  • I gathered the expected output from running the commands mbed compile -t ARM -m HEXIWEAR -f and mbed compile -t IAR -m HEXIWEAR -f (both run on the board successfully)

mbed-os-5.1.0-rc1: autocrypt fails

Environment

MacOS (10.11.6) GCC_ARM

Board

nRF51-DK
Giant Gecko
NUCLEO-L476RG

Tag

mbed-os-5.1.0-rc1

Error

plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400
Example failed with error 1

Benchmark does not compile with IAR + Odin

Here is the compilation error:

mbed compile -t iar -m auto
[mbed] Detected "UBLOX_EVK_ODIN_W2" connected to "D:" and using com port "COM5"
Building project mbed-os-example-tls (UBLOX_EVK_ODIN_W2, IAR)
Scan: .
Scan: mbed
Scan: env
Scan: FEATURE_LWIP
Compile [  0.5%]: AnalogIn.cpp
[Error] mpu_armv7.h@167,21: [Pe018]: expected a ")"
[Error] mpu_armv7.h@170,15: [Pe020]: identifier "len" is undefined
[Error] mpu_armv7.h@172,47: [Pe020]: identifier "src" is undefined
[Error] mpu_armv7.h@184,47: [Pe140]: too many arguments in function call
[Error] mpu_armv7.h@187,0: [Pe140]: too many arguments in function call
[ERROR]
  __STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
                                                                                     ^
"C:\Repos\mbed-os-example-tls\benchmark\mbed-os\cmsis\TARGET_CORTEX_M\mpu_armv7.h",167  Error[Pe018]: expected a ")"

    for (i = 0U; i < len; ++i)
                     ^
"C:\Repos\mbed-os-example-tls\benchmark\mbed-os\cmsis\TARGET_CORTEX_M\mpu_armv7.h",170  Error[Pe020]: identifier "len" is undefined

      dst[i] = src[i];
               ^
"C:\Repos\mbed-os-example-tls\benchmark\mbed-os\cmsis\TARGET_CORTEX_M\mpu_armv7.h",172  Error[Pe020]: identifier "src" is undefined

      orderedCpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize);
                                               ^
"C:\Repos\mbed-os-example-tls\benchmark\mbed-os\cmsis\TARGET_CORTEX_M\mpu_armv7.h",184  Error[Pe140]: too many arguments in function call

      orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize);
                                               ^
"C:\Repos\mbed-os-example-tls\benchmark\mbed-os\cmsis\TARGET_CORTEX_M\mpu_armv7.h",187  Error[Pe140]: too many arguments in function call

[mbed] ERROR: "c:\python27\python.exe" returned error code 1.
[mbed] ERROR: Command "c:\python27\python.exe -u C:\Repos\mbed-os-example-tls\.temp\tools\make.py -t iar -m UBLOX_EVK_ODIN_W2 --source . --build .\BUILD\UBLOX_EVK_ODIN_W2\iar" in "C:\Repos\mbed-os-example-tls"
---

I verified that it does build with gcc_arm.

[OoB_5.8]: Need more docs.

While OoB campaign for 5.8 release, the feature opaque key was validated.
Docs start here: https://github.com/ARMmbed/mbed-os-example-tls/blob/feature-opaque-keys/README.md .
Observations:

  1. No mention of opaque key feature.
  2. No introduction to what the feature does, how to use it, what are the advantages etc.
  3. On the individual examples (pk_sign, pk_verify) there is no info about how opaque keys are actually being used in these examples.
  4. Currently HW support limited to K64 via source code. Porting to other platforms or use of the AT crypto engine with other platforms must be clearly explained (I2C pins to check, define if required etc) in a separate section.

The examples build / run fine on the CLI with all 3 supported toolchains.

cc @mazimkhan @sbutcher-arm

[Exporter] [TLS-Client] : Platform not supported by IAR.

  1. Update repo.
    mbed-os (7b974cac6578)
C:\Ashok\mbed_CLI\v5_3_OoB\TLS\mbed-os-example-tls\tls-client>mbed export -i IAR -m NUMAKER_PFM_NUC472
WARNING: MBED_ARM_PATH set as environment variable but doesn't exist
c:\python27\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
usage: project.py [-h] [-m MCU] [-i IDE] [-c] [-p PROGRAM] [-n PROGRAM] [-b]
                  [-L] [-S] [-E] [--source SOURCE_DIR] [-D MACROS]
                  [--profile PROFILE] [--update-packs]
project.py: error: NUMAKER_PFM_NUC472 not supported by iar
[mbed] ERROR: "python" returned error code 2.
[mbed] ERROR: Command "python -u C:\Ashok\mbed_CLI\v5_3_OoB\TLS\mbed-os-example-tls\tls-client\mbed-os\tools\project.py -i iar -m NUMAKER_PFM_NUC472 --source ." in "C:\Ashok\mbed_CLI\v5_3_OoB\TLS\mbed-os-example-tls\tls-client"
---

Benchmark example built with make_iar thows runtime error

Once the benchmark example finishes running, a CMSIS RTOS error is thrown when built with the make_iar exporter. Here's the full log:

MD4                      :      12048 Kb/s,         13 cycles/byte
MD5                      :       9120 Kb/s,         17 cycles/byte
SHA-1                    :       3973 Kb/s,         41 cycles/byte
SHA-256                  :       1135 Kb/s,        144 cycles/byte
SHA-512                  :        602 Kb/s,        273 cycles/byte
ARC4                     :       5272 Kb/s,         31 cycles/byte
3DES                     :        215 Kb/s,        767 cycles/byte
DES                      :        608 Kb/s,        270 cycles/byte
AES-CBC-128              :       1455 Kb/s,        112 cycles/byte
AES-CBC-192              :       1262 Kb/s,        130 cycles/byte
AES-CBC-256              :       1114 Kb/s,        147 cycles/byte
AES-GCM-128              :        635 Kb/s,        259 cycles/byte
AES-GCM-192              :        595 Kb/s,        276 cycles/byte
AES-GCM-256              :        560 Kb/s,        293 cycles/byte
AES-CCM-128              :        600 Kb/s,        274 cycles/byte
AES-CCM-192              :        532 Kb/s,        309 cycles/byte
AES-CCM-256              :        477 Kb/s,        344 cycles/byte
CTR_DRBG (NOPR)          :       1133 Kb/s,        144 cycles/byte
CTR_DRBG (PR)            :        813 Kb/s,        202 cycles/byte
HMAC_DRBG SHA-1 (NOPR)   :        275 Kb/s,        600 cycles/byte
HMAC_DRBG SHA-1 (PR)     :        255 Kb/s,        648 cycles/byte
HMAC_DRBG SHA-256 (NOPR) :        137 Kb/s,       1209 cycles/byte
HMAC_DRBG SHA-256 (PR)   :        121 Kb/s,       1373 cycles/byte
RSA-2048                 :      38 ms/ public
RSA-2048                 :    1504 ms/private
RSA-4096                 :     134 ms/ public
RSA-4096                 :    8617 ms/private
ECDHE-secp384r1          :     951 ms/handshake
ECDHE-secp256r1          :     610 ms/handshake
ECDHE-Curve25519         :     514 ms/handshake
ECDH-secp384r1           :     467 ms/handshake
ECDH-secp256r1           :     298 ms/handshake
ECDH-Curve25519          :     264 ms/handshake

DONE
CMSIS-RTOS error: Stack underflow (status: 0x1, task ID: 0x2001C2F4, task name: hd)

[OoB_5.4.1] [EXPORTER] : export to uvision5 and make_armc5 fails on NuMaker_PFM_NUC472.

Steps to reproduce:

  1. import example, update to oob-test-mbed-os-5.4.1 branch.
  2. mbed export -i uvision5 -m NUMAKER_PFM_NUC472

Result:

Scan: .

Exporting with -vv option:

[mbed] Working path "C:\Ashok\mbed_CLI\v5_4_OoB\v_5_4_1_OoB\mbed-os-example-tls\authcrypt" (library)
[mbed] Exec "python -u C:\Ashok\mbed_CLI\v5_4_OoB\v_5_4_1_OoB\mbed-os-example-tls\authcrypt\mbed-os\tools\project.py -i uvision5 -m NUMAKER_PFM_NUC472 --source ." in C:\Ashok\mbed_CLI\v5_4_OoB\v_5_4_1_OoB\mbed-os-example-tls\authcrypt
Scan: .

Maybe an issue with exporter. Raising here to keep track.
The exported project does not contain anything except 1 file (mbed_config.h).

[OOB_5_4] Online Compilation failed by missing "objects.h"

Online compilation failed by missing "objects.h".
Target : NUCLEO_F746ZG

Error: Cannot open source input file "objects.h": No such file or directory in "extras/tls-client/mbed-os.lib/targets/TARGET_STM/TARGET_STM32F7/device.h", Line: 38, Col: 22

imported URL to online compiler

https://github.com/ARMmbed/mbed-os-example-tls#fcc3b724ff879b7dcfc3a5d4fb5e23b7de5f7848

Signature algorithm (oid) is unsupported : OID - OID is not found

Hello,

I'm compiling the tls-client with mbed-os 5.4.0 and gcc for ARM 6.3.1.

When it boots, it fails at the cert parse:

mbedtls_x509_crt_parse() failed: -0x262e (-9774): X509 - Signature algorithm (oid) is unsupported : OID - OID is not found

I tried a few different certs and get the same error.

Advice?

Thanks,
Peter

mbed TLS examples fail in NUMAKER_PFM_NUC472 board

Even though the examples compile correctly with ARMCC and gcc, none of them shows the expected behaviour when the applications are flahed onto the target and the serial terminal is connected.

To reproduce this, compile any of the examples with mbed-os-5.3.0-rc1:

mbed compile -t GCC_ARM -m NUMAKER_PFM_NUC472

Then flash the device and open the serial terminal.

benchmark example does not finish correctly in NCS36510 dev board

The benchmark example is very slow to run in the NCS36510 target. Furthermore, after waiting for sometime it does not seem to progress from the CTR_DRBG (PR) when compiled with ARMCC:

  SHA-256                  :        407 Kb/s,         77 cycles/byte
  SHA-512                  :        176 Kb/s,        178 cycles/byte
  AES-CBC-128              :        346 Kb/s,         90 cycles/byte
  AES-CBC-192              :        301 Kb/s,        104 cycles/byte
  AES-CBC-256              :        267 Kb/s,        117 cycles/byte
  AES-GCM-128              :        146 Kb/s,        216 cycles/byte
  AES-GCM-192              :        137 Kb/s,        229 cycles/byte
  AES-GCM-256              :        130 Kb/s,        243 cycles/byte
  AES-CCM-128              :        155 Kb/s,        203 cycles/byte
  AES-CCM-192              :        136 Kb/s,        231 cycles/byte
  AES-CCM-256              :        122 Kb/s,        259 cycles/byte
  CTR_DRBG (NOPR)          :        265 Kb/s,        118 cycles/byte
  CTR_DRBG (PR)            :        192 Kb/s,        163 cycles/byte

When compiled with gcc, the program terminates, but the following error is printed:

  SHA-256                  :        416 Kb/s,         75 cycles/byte
  SHA-512                  :        136 Kb/s,        231 cycles/byte
  AES-CBC-128              :        318 Kb/s,         98 cycles/byte
  AES-CBC-192              :        277 Kb/s,        113 cycles/byte
  AES-CBC-256              :        245 Kb/s,        128 cycles/byte
  AES-GCM-128              :        108 Kb/s,        292 cycles/byte
  AES-GCM-192              :        103 Kb/s,        307 cycles/byte
  AES-GCM-256              :         99 Kb/s,        321 cycles/byte
  AES-CCM-128              :        139 Kb/s,        227 cycles/byte
  AES-CCM-192              :        123 Kb/s,        257 cycles/byte
  AES-CCM-256              :        110 Kb/s,        287 cycles/byte
  CTR_DRBG (NOPR)          :        258 Kb/s,        121 cycles/byte
  CTR_DRBG (PR)            :        185 Kb/s,        170 cycles/byte
  HMAC_DRBG SHA-256 (NOPR) :         50 Kb/s,        649 cycles/byte
  HMAC_DRBG SHA-256 (PR)   :         44 Kb/s,        739 cycles/byte
  RSA-2048                 :     171 ms/ public
  RSA-2048                 :    5566 ms/private
  RSA-4096                 :     595 ms/ public
  RSA-4096                 :  FAILED: RSA - The private key operation failed : BIGNUM - Memory allocation failed
  ECDHE-secp384r1          :    4532 ms/handshake
  ECDHE-secp256r1          :    2722 ms/handshake
  ECDHE-Curve25519         :    2299 ms/handshake
  ECDH-secp384r1           :    2230 ms/handshake
  ECDH-secp256r1           :    1338 ms/handshake
  ECDH-Curve25519          :    1162 ms/handshake

DONE

Stack buffers leading to stack overflow

The main stack for most platforms is 4K. The tls-client example uses ~6K of stack which causes a stack overflow. TLS itself seems to be using nearly 4k and main.cpp is using ~2k.
Some places in main.cpp contributing to this stack usage.
https://github.com/ARMmbed/mbed-os-example-tls/blob/master/tls-client/main.cpp#L270
https://github.com/ARMmbed/mbed-os-example-tls/blob/master/tls-client/main.cpp#L373
https://github.com/ARMmbed/mbed-os-example-tls/blob/master/tls-client/main.cpp#L437
https://github.com/ARMmbed/mbed-os-example-tls/blob/master/tls-client/main.cpp#L470

This is causing the issue reported here:
ARMmbed/mbed-os#2567

[OOB_5_4] tls-client failed when running on NUCLEO_F746ZG

tls-client outputted following error message when running on NUCLEO_F746ZG.

tls-client-err01

Imported URL to online compiler

https://github.com/ARMmbed/mbed-os-example-tls#fcc3b724ff879b7dcfc3a5d4fb5e23b7de5f7848
then removed other examples (authcrypt/benchmark/hashing), built tls-client only.
I had verified this error happens at master as well.

cannot export to make_iar, make_gcc_arm, make_armc5, platform UBLOX_EVK_ODIN_W2

command:
cd authcrypt
mbed compile -i make_XXX -m UBLOX_EVK_ODIN_W2

log:

Scan: .
Traceback (most recent call last):
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 248, in <module>
    main()
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 244, in main
    build_profile=profile)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 94, in export
    build_profile=build_profile, silent=silent)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project_api.py", line 222, in export_project
    macros=macros)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project_api.py", line 89, in generate_project_files
    exporter.generate()
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\export\makefile\__init__.py", line 49, in generate
    raise NotSupportedException("No linker script found.")
tools.utils.NotSupportedException: No linker script found.
[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py -i make_iar -m UBLOX_EVK_ODIN_W2 --source ." in "C:\my\dev\mbed_5_0\oob_540\tls
_n\authcrypt"
---

[OOB_5_4] tls-client got "SSL - Memory allocation failed"

I got following error when running tls-client on NUCLEO_F746ZG.
It related memory handling by IAR compiler.
allocation_err

How to build the bad executable

mbed compile -m NUCLEO_F746ZG -t IAR -c > bb0 2>&1

mbed export -i IAR -m NUCLEO_F746ZG -vv > aa 2>&1
then click Make, Download and Debug on IAR Embedded Workbench.

mbed export -i make_iar -m NUCLEO_F746ZG -vv > a00 2>&1
make clean
make V=1 > ren02 2>&1

How to build a working executable

mbed compile -m NUCLEO_F746ZG -t GCC_ARM -c > bb2 2>&1

[OOB_5_4] Benchmark program hangs at "RSA-2048"

I exported benchmark as "make_iar", and built benchmark.bin with no error.
the program hangs at "RSA-2048" cannot go through as following. but the benchmark.bin built from mbed-cli command with IAR toolchain works well.

hangup01

How to build the bad execuable

(workspace) C:\iotBu\ooT-228\import\mbed-os-example-tls\benchmark>mbed export -i
make_iar -m NUCLEO_F746ZG -vv > a00 2>&1 //marker 1: makefile is generated as a result
(workspace) C:\iotBu\ooT-228\import\mbed-os-example-tls\benchmark>make clean
(workspace) C:\iotBu\ooT-228\import\mbed-os-example-tls\benchmark>make

makefile

I cannot attach the makefile generated at maker 1.
if you need it, I can send it by email.

How to build the working execuable

(workspace) C:\iotBu\ooT-228\import\mbed-os-example-tls\benchmark>mbed compile -
m NUCLEO_F746ZG -t IAR -vv > ren 2>&1

(workspace) C:\iotBu\ooT-228\import\mbed-os-example-tls\benchmark>

compilation options

[DEBUG] Compile: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\arm\bin\iccarm --no_wrap_diagnostics -e --diag_suppress=Pa050,Pa084,Pa093,Pa082 -Oh --cpu Cortex-M7 --thumb --dlib_config DLib_Config_Full.h --fpu=VFPv5_sp --vla -DTARGET_STM32F746xG -DFEATURE_LWIP=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -D__FPU_PRESENT=1 -DDEVICE_PORTOUT=1 -DUSBHOST_OTHER -DDEVICE_PORTINOUT=1 -D__MBED_CMSIS_RTOS_CM -DDEVICE_LOWPOWERTIMER=1 -DTARGET_STM32F7 -DTOOLCHAIN_object -DDEVICE_SERIAL_ASYNCH=1 -D__CMSIS_RTOS -DDEVICE_ANALOGOUT=1 -DTARGET_STM32F746ZG -DDEVICE_CAN=1 -DARM_MATH_CM7 -DTARGET_CORTEX_M -DTARGET_LIKE_CORTEX_M7 -DDEVICE_TRNG=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M7 -DDEVICE_SPI_ASYNCH=1 -DTOOLCHAIN_IAR -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DTRANSACTION_QUEUE_SIZE_SPI=2 -DDEVICE_STDIO_MESSAGES=1 -D__CORTEX_M7 -DTARGET_STM32F746 -DTARGET_LIKE_MBED -DTARGET_FF_ARDUINO -DDEVICE_PORTIN=1 -DTARGET_RELEASE -DTARGET_STM -DDEVICE_SERIAL=1 -DTARGET_NUCLEO_F746ZG -DTARGET_RTOS_M4_M7 -DDEVICE_SLEEP=1 -DDEVICE_SPI=1 -DMBED_BUILD_TIMESTAMP=1488364481.74 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_PWMOUT=1 -DDEVICE_RTC=1 -DDEVICE_I2C_ASYNCH=1 -f .\BUILD\NUCLEO_F746ZG\IAR\.includes_395d7dfa13e0bc77e08d33db466febf1.txt --preinclude=.\BUILD\NUCLEO_F746ZG\IAR\mbed_config.h --dependencies .\BUILD\NUCLEO_F746ZG\IAR\mbed-os\targets\TARGET_STM\i2c_api.d -l .\BUILD\NUCLEO_F746ZG\IAR\mbed-os\targets\TARGET_STM\i2c_api.s.txt -o .\BUILD\NUCLEO_F746ZG\IAR\mbed-os\targets\TARGET_STM\i2c_api.o .\mbed-os\targets\TARGET_STM\i2c_api.c

wrong output in the Benchmark application

The output of the Benchmark Application performance is in Kb/s , however, according to the code:

    mbedtls_printf( "%9lu Kb/s,  %9lu cycles/byte\r\n",                        \
                     i * BUFSIZE / 1024,                                       \
                     ( mbedtls_timing_hardclock() - tsc ) / ( j * BUFSIZE ) );

The performance should be in Kilo Bytes (KB) not Kilo bits (Kb) as printed

Authcrypt compiled with make_gcc_arm fails with runtime error

With branch mbed-os-5.5.0-rc1-oob, when exporting with make_gcc_arm, the example fails to run.

I received two different errors when running the authcrypt example.

plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400
CMSIS-RTOS error: Stack underflow (status: 0x1, task ID: 0x20006CE8, task name: (null))
plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400
Mutex 0x730fcfdb error -4: Parameter error

client-tls: Test fail K64F for export to GCC OoB#4

Platform: K64F
Tag: mbed-os-5.1.0-rc4
OS: OSX (10.11.6)
Test: client-tls

Test passes just fine when compiled with mbed (GCC_ARM) but when exported to GCC_ARM and compiled with make I'm getting:

Using Ethernet LWIP
Client IP Address is 10.2.203.154
Connecting with developer.mbed.org
Starting the TLS handshake...
mbedtls_ssl_handshake() failed: -0x0001 (-1): UNKNOWN ERROR CODE (0001)
MBED: Socket Error: -1

Unexpected behaviour of mbed export?

I believe there is some unexpected behaviour when exporting the examples using the command:

mbed export -i make_iar -m K64F

It appears that if the mbed_settings.py does dont contain an acceptable path for IAR_PATH then the generated makefiles do not contain the correct include path. However, I find surprising that even after setting IAR_PATH correctly, invocations of the compiler are not prepended with the correct path to the compiler, resulting in build failures. As a workaround, I had to include the path to the compiler in the environment variabled.

MAKE_ARM5 export compilation fails for NUCLEO_F429ZI

Using benchmark example:

mbed export -i MAKE_ARMC5 -m NUCLEO_F429ZI
...
make -j4
...

"link: benchmark.elf"
"C:\Users\dongar01\AppData\Local\Temp\p1b14-3", line 117 (column 3): Warning: L6312W: Empty Execution region description for region RW_IRAM1
Error: L6218E: Undefined symbol Load$$LR$$LR_IROM1$$Base (referred from mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/system_init_pre.o).
Finished: 0 information, 1 warning and 1 error messages.
make[1]: *** [benchmark.elf] Error 1
make: *** [all] Error 2

tls-client example does not support Wifi

The tls-client application only works with Ethernet at the moment. It needs to be modified so that it uses either Wifi or Ethernet depending on availability.

[OOB_5_4] tls-client got a compilation error for target HEXIWEAR

All of following build commands resulted a compilation error.

Building commnand

  1. mbed compile -m HEXIWEAR -t IAR -c > bb0 2>&1
  2. mbed compile -m HEXIWEAR -t ARM -c > bb1 2>&1
  3. mbed compile -m HEXIWEAR -t GCC_ARM -c > bb2 2>&1

Building log

Building project tls-client (HEXIWEAR, IAR)
Scan: .
Scan: FEATURE_BLE
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_LWIP
Scan: FEATURE_UVISOR
Scan: FEATURE_ETHERNET_HOST
Scan: FEATURE_LOWPAN_BORDER_ROUTER
Scan: FEATURE_LOWPAN_HOST
Scan: FEATURE_LOWPAN_ROUTER
Scan: FEATURE_NANOSTACK
Scan: FEATURE_NANOSTACK_FULL
Scan: FEATURE_THREAD_BORDER_ROUTER
Scan: FEATURE_THREAD_END_DEVICE
Scan: FEATURE_THREAD_ROUTER
Scan: FEATURE_STORAGE
Scan: mbed
Scan: env
Compile [  0.4%]: cmain.S
Compile [  0.9%]: AnalogIn.cpp
Compile [  1.3%]: BusIn.cpp
Compile [  1.7%]: BusInOut.cpp
Compile [  2.2%]: main.cpp
[Fatal Error] main.cpp@38,0: [Pe1696]: cannot open source file "EthernetInterface.h"
[ERROR] 
  #include "EthernetInterface.h"
                                ^
"C:\iotBu\ooT-228\import\mbed-os-example-tls\tls-client\main.cpp",38  Fatal error[Pe1696]: cannot open source file "EthernetInterface.h"

(snip)

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u C:\iotBu\ooT-228\import\mbed-os-example-tls\tls-client\mbed-os\tools\make.py -t IAR -m HEXIWEAR --source . --build .\BUILD\HEXIWEAR\IAR -c" in "C:\iotBu\ooT-228\import\mbed-os-example-tls\tls-client"

mbed deploy downloads 4 times mbed-os ?

Hello,
I did git clone https://github.com/ARMmbed/mbed-os-example-tls
then cd mbed-os-example-tls
thenmbed deploy
I was surprised to see 4 times

[mbed] Adding library "xxxxxxxxx\mbed-os" from "https://github.com/ARMmbed/mbed-os/" at rev #d2202045ac8f

Is it possible to modify the setup so that it takes mbed-os repository only once ? It is very slow (at least for me, arround 30 minutes)

Kind regards
Armelle

[Docs Request] .mbedignore or preferred method for selecting examples

Please document how to compile only the desired example. I used .mbedignore to ignore the examples I did not want to compile. Unfortunately, this means that the mbed-os tools are not at the root of the project, which means that the mbed 2 SDK tools are used. It also means that users unfamiliar with .mbedignore might fail to compile this example.

The current suggestion for building would fail because there are multiple copies of mbed-os inside the examples.

Please document the use of .mbedignore or other preferred method.

Compile scanning root directory (mbed-os-example-tls) instead of mbed-os-example-tls/authcrypt

sarmar01@U202209 MINGW64 /c/Repos/oob/mbed-os-example-tls/authcrypt ((mbed-os-5.                                                 1.0-rc1))
$ mbed compile -m K64F -t GCC_ARM
Building project mbed-os-example-tls (K64F, GCC_ARM)
Scan: ..
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_IPV4
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_IPV4
Warning: Multiple linker scripts detected: ..\authcrypt\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld -> ..\benchmark\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_IPV4
Warning: Multiple linker scripts detected: ..\benchmark\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld -> ..\hashing\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_IPV4
Warning: Multiple linker scripts detected: ..\hashing\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld -> ..\tls-client\mbed-os\hal\targets\cmsis\TARGET_Freescale\TARGET_K64F\TOOLCHAIN_GCC_ARM\MK64FN1M0xxx12.ld
Scan: mbed
Scan: env
[ERROR] Library name 'core' is not unique (defined in 'C:\Repos\oob\mbed-os-example-tls\benchmark\mbed-os\mbed_lib.json' and 'C:\Repos\oob\mbed-os-example-tls\authcrypt\mbed-os\mbed_lib.json')
[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u C:\Repos\oob\mbed-os-example-tls\.temp\tools\make.py -t GCC_ARM -m K64F --source .. --build ..\.build\K64F\GCC_ARM" in "C:\Repos\oob\mbed-os-example-tls\authcrypt"

This line:

Command "python -u C:\Repos\oob\mbed-os-example-tls\.temp\tools\make.py -t GCC_ARM -m K64F --source .. --build ..\.build\K64F\GCC_ARM" in "C:\Repos\oob\mbed-os-example-tls\authcrypt"

looks problematic. It hands off --source as .. instead of .

Examples do fail intermitently when using the mbed online IDE

The mbed TLS examples intermitently fail to compile when using the mbed online IDE. The failure causes vary between the examples and sometimes the same example exhibits different faults depending on the time of compilation. Errors are related to:

  • The online IDE fails to load, hangs, seems to be stuck doing some operations.
  • Compilation errors are reported for no good reason since the programs compile without problems using the offline tools e.g. mble-cli, Makefiles, IAR, uVision, etc...

Cannot export to IAR, platform: UBLOX_EVK_ODIN_W2

command:
cd authcrypt
mbed compile -i iar -m UBLOX_EVK_ODIN_W2

error log:

Scan: .
Traceback (most recent call last):
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 248, in <module>
    main()
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 244, in main
    build_profile=profile)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py", line 94, in export
    build_profile=build_profile, silent=silent)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project_api.py", line 222, in export_project
    macros=macros)
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project_api.py", line 89, in generate_project_files
    exporter.generate()
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\export\iar\__init__.py", line 122, in generate
    'linker_script': self.format_file(self.resources.linker_script),
  File "C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\export\iar\__init__.py", line 89, in format_file
    return join('$PROJ_DIR$',file)
  File "c:\python27\lib\ntpath.py", line 67, in join
    p_drive, p_path = splitdrive(p)
  File "c:\python27\lib\ntpath.py", line 115, in splitdrive
    if len(p) > 1:
TypeError: object of type 'NoneType' has no len()
[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u C:\my\dev\mbed_5_0\oob_540\tls_n\authcrypt\mbed-os\tools\project.py -i iar -m UBLOX_EVK_ODIN_W2 --source ." in "C:\my\dev\mbed_5_0\oob_540\tls_n\au
thcrypt"
---

OOB-5.8 Does not compile within online compiler

Tried with K66F & NUCLEO_F429ZI targets.

Looks like there's a define issue with easy-connect.

Error: #error directive: "No connectivity method chosen. Please add 'config.network-interfaces.value' to your mbed_app.json (see README.md for more information)." in "tls-client/easy-connect/easy-connect.h", Line: 49, Col: 3

These work fine with GCC_ARM + mbed cli, might be an online compiler issue.

[Online IDE] [TLS-client] : Compilation fails on online IDE.

Steps to reproduce:

  1. Import into online IDE via "import from URL" and point to example's github link.
  2. Select K64F for platform and compile.
  3. Fails to find "EthernetInterface.h".

However, it passes when compiling with CLI tool.
Screenshot below:

tls-client

Compiling tls-client with IAR compiler throws warnings

Compiling the tls-client example with IAR causes the following warning to be printed to the console:

[Warning] ssl_srv.c@2684,0: [Pe549]: variable "len" is used before its value is set

This warning was observed while compiling with mbed-os-5.3.0-rc1 and mbed-cli. To reproduce run the command:

cd tls-client
mbed compile -m K64F -t IAR

No server support using mbedTLS on mbed-os

Is such a thing possible on mbed-os? I found this example on the mbedTLS Github page, but the code was written assuming a UNIX platform.

After searching around a bit I have found examples:

All pointing to there not being any server support for mbedTLS on mbed-os. If this is not true, to what extent has server support been implemented in mbed's port of mbedTLS?

mbed-os-example-tls/benchmark: mbed-os-5.1.0-rc1: Compilation fail for NRF51_DK

OS

MacOS

Toolchain

GCC_ARM

Platform

NRF51_DK

Tag

mbed-os-5.1.0-rc1

Variant

benchmark

Compilation fails with:

$ mbed compile -m NRF51_DK -t GCC_ARM
Building project benchmark (NRF51_DK, GCC_ARM)
Scan: .
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_IPV4
Scan: mbed
Scan: env
Compile: main.cpp
[Error] main.cpp@181,9: 'CoreDebug' was not declared in this scope
[Error] main.cpp@181,29: 'CoreDebug_DEMCR_TRCENA_Msk' was not declared in this scope
[Error] main.cpp@182,9: 'DWT' was not declared in this scope
[Error] main.cpp@182,22: 'DWT_CTRL_CYCCNTENA_Msk' was not declared in this scope
[Error] main.cpp@185,13: 'DWT' was not declared in this scope
[ERROR] ./main.cpp: In function 'long unsigned int mbedtls_timing_hardclock()':
./main.cpp:181:9: error: 'CoreDebug' was not declared in this scope
         CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
         ^
./main.cpp:181:29: error: 'CoreDebug_DEMCR_TRCENA_Msk' was not declared in this scope
         CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
                             ^
./main.cpp:182:9: error: 'DWT' was not declared in this scope
         DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
         ^
./main.cpp:182:22: error: 'DWT_CTRL_CYCCNTENA_Msk' was not declared in this scope
         DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
                      ^
./main.cpp:185:13: error: 'DWT' was not declared in this scope
     return( DWT->CYCCNT );
             ^

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Users/barsza01/devel/mbed/mbed-os-example-tls/benchmark/mbed-os/tools/make.py -t GCC_ARM -m NRF51_DK --source . --build ./.build/NRF51_DK/GCC_ARM" in "/Users/barsza01/devel/mbed/mbed-os-example-tls/benchmark"

---

Application do not compile

the easy-connect generates compile errors when compiled for target NUCLEO_L476RG + WIFI_IDW01M1 network interface. The CLI build system and the online compiler both generates compiler errors.
The online compiler throw this error:

Error: Cannot open source input file "SpwfSAInterface.h": No such file or directory in "easy-connect/easy-connect.h", Line: 32, Col: 30

the CLI:

$ mbed compile
Building project mbed-os-example-tls-tls-client (NUCLEO_L476RG, GCC_ARM)
Scan: .
Scan: mbed
Scan: env
Scan: FEATURE_COMMON_PAL
Compile [ 0.3%]: BufferedPrint.c
Compile [ 0.6%]: MyBuffer.cpp
Compile [ 0.9%]: BufferedSerial.cpp
Compile [ 1.1%]: main.cpp
[Fatal Error] easy-connect.h@32,29: SpwfSAInterface.h: No such file or directory
[ERROR] In file included from .\main.cpp:36:0:
./easy-connect/easy-connect.h:32:29: fatal error: SpwfSAInterface.h: No such file or directory
#include "SpwfSAInterface.h"
^
compilation terminated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.