Wi-Fi MQTT Client example build errors

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
srini_a
Level 3
Level 3
50 sign-ins 10 questions asked 10 replies posted
Hi Community,
I tested the Wi-Fi MQTT Client example on CY8CPROTO-062-4343W. It works as expected. 
I’m trying to port the MQTT Client example code on to our hardware platform ( CY8C6247FDI-D32 and CY4343W ).
  • Added the necessary libraries based on the example
  • Copied the source code from the example, updated the makefile etc..
When I tried to compile the project, I 1st got this error:
 

../mtb_shared/aws-iot-device-sdk-embedded-C/202103.00/libraries/standard/coreHTTP/source/include/core_http_client.h:39:14: fatal error: core_http_config.h: No such file or directory

 
Searching through the Community, I saw this below post about the error:
 
So, I included these 2 lines in the Makefile
 
CY_IGNORE+= $(SEARCH_aws-iot-device-sdk-embedded-C)/libraries/standard/coreHTTP
CY_IGNORE+= libs/aws-iot-device-sdk-embedded-C/libraries/standard/coreHTTP
Now, I see this error

../mtb_shared/aws-iot-device-sdk-embedded-C/202103.00/libraries/standard/corePKCS11/source/include/core_pkcs11.h:208:5: error: unknown type name 'CK_ATTRIBUTE'

Can someone provide any guidance on what I'm missing??
0 Likes
1 Solution
8 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

After adding the desired macros, the HTTP issue is resolved. This seems to be coming from another file - core_pkcs11.h. Have you added any custom configurations to this file?

Thanks

Aditi

0 Likes

Thanks for your response. Please note that CY8C6247FDI-D32 doesn't have the CRYPTO feature. 

No, I haven't done any custom configuration to this (core_pkcs11.h) file, but I've some changes to the project makefile and mbedtls user config file based on the solution that was suggested for this other case, so I can get the tcp client working. 

https://community.infineon.com/t5/AIROC-Wi-Fi-and-Wi-Fi-Bluetooth/Problem-porting-TCP-Client-example...

Regards,

Srini

 

0 Likes
srini_a
Level 3
Level 3
50 sign-ins 10 questions asked 10 replies posted

I updated the 'mqtt' libraries to the following

aws-iot-device-sdk-embedded-C   202103.00

aws-iot-device-sdk-port v2.2.2

mqtt v3.4.2

and am able to compile but am getting linker errors:

../mtb_shared/aws-iot-device-sdk-port/release-v2.2.2/source/cy_aws_retry_utils.c:66: undefined reference to `cyhal_trng_generate'

../mtb_shared/aws-iot-device-sdk-port/release-v2.2.2/source/cy_aws_retry_utils.c:122: undefined reference to `cyhal_trng_init'

These are similar errors we saw before we applied the workaround:

https://community.infineon.com/t5/AIROC-Wi-Fi-and-Wi-Fi-Bluetooth/Problem-porting-TCP-Client-example...

Is there another workaround for MQTT library to not use hardware random number generator?? 

Thanks for your help.

0 Likes
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Okay. Thanks for the update. Can you provide the makefile of your project? Also, the host that you've doesn't have the CRYPTO feature, so I don't think you'll be able to use the HW Crypto. 

Thanks

Aditi

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

Correct, We can't use the Crypto on our hardware.

I've attached the Makefile. Few things to note:

The following 2 things were suggested by Infineon Support team to work around the CRYPTO/TRNG problem for our board(that doesn't support CRYPTO) because we saw the same problem when developing a TCP Client that connects to an Access Point (see the below community post). See the solution in the below post:

https://community.infineon.com/t5/AIROC-Wi-Fi-and-Wi-Fi-Bluetooth/Problem-porting-TCP-Client-example...

  • Added this to the Makefile DEFINES
    • DISABLE_MBEDTLS_ACCELERATION
  • Commented out this line in mbedtls_user_config.h
    • //#define MBEDTLS_ENTROPY_HARDWARE_ATL
By using the workaround/fix suggested above, we were able to build(no TRNG errors) and run the TCP Client without any problems, but MQTT uses different set of libraries.
 
But now, we are seeing the same exact problem with MQTT Client; meaning, if we include COMPONENT_43907 in the Makefile to get around the TRNG linker errors, we are having run-time problems (pbuf != 0 assert when trying to connect to the AP). 
 
Are there corresponding Makefile #defines for MQTT that can do the same that the DISABLE_MBEDTLS_ACCELERATION did for the TCP Client?
 
Very much appreciate your attention and help. Thank you!!
0 Likes
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

I'm not clear on why COMPONENT_43907 is required as a define in the makefile. Can you provide the reason for the same? I'll check the thread that you've pointed to in your previous query.

Thanks
Aditi

0 Likes

Hi,

COMPONENT_43907 is required to get around the TRNG(True Random Number Generator) linker errors from MBEDTLS library when using hardware that doesn't support CRYPTO(e.g. like the one we are using CY8CKIT6247-FDI).  Please see this community post:

https://community.infineon.com/t5/PSoC-6/PSOC6-mbedtls-with-CY8C6247FDI-D32-that-does-not-have-crypt...

Regards

0 Likes
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

Please refer suggestions provided in this link - https://community.infineon.com/t5/PSoC-6/Is-there-a-method-to-disable-both-CRYPTO-and-TRNG-from-a-PS...

Thanks

Aditi 

0 Likes