Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build issues on STM32H7 with ARM GNU toolchain #719

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

aggarg
Copy link
Contributor

@aggarg aggarg commented Jul 10, 2024

Description

I tried building the libstrp for STM32H743ZI (Cortex-M7) target using ARM GNU GCC and faced some build issues. This change fixes those issues.

  1. aes_gcm_mbedtls.c and aes_icm_mbedtls.c - Fix use for before declaration errors.
  2. datatypes.h - Do not generate error when HAVE_NETINET_IN_H and HAVE_WINSOCK2_H are not defined. This enables the library to be used on embedded targets using FreeRTOS-Plus-TCP.
  3. err.h and srtp.c - Allow the application to change the logging macro definitions at compile time. The application can provide these definitions in config.h.

I tried building the libstrp for STM32H743ZI (Cortex-M7) target using
ARM GNU GCC and faced some build issues. This change fixes those issues.

1. aes_gcm_mbedtls.c and aes_icm_mbedtls.c - Fix use for before
   declaration errors.
2. datatypes.h - Do not generate error when HAVE_NETINET_IN_H and
   HAVE_WINSOCK2_H are not defined. This enables the library to be used
   on embedded targets using FreeRTOS-Plus-TCP.
3. err.h and srtp.c - Allow the application to change the logging
   macro definitions at compile time. The application can provide these
   definitions in config.h.

Signed-off-by: Gaurav Aggarwal <[email protected]>
@pabuhler
Copy link
Member

I can understand 1 & 2, but why 3? You can install a handler for the debug, why do you need to replace at compile time.

@aggarg
Copy link
Contributor Author

aggarg commented Jul 10, 2024

You can install a handler for the debug, why do you need to replace at compile time.

It is needed if I want to completely remove the debug logs to reduce code size. With this change I can add the following to config.h to remove logs -

#define debug_print0(mod, format)
#define debug_print(mod, format, arg)
#define debug_print2(mod, format, arg1, arg2)

Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg
Copy link
Contributor Author

aggarg commented Jul 16, 2024

@pabuhler Do you need anything else to merge this?

Copy link
Member

@pabuhler pabuhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these changes will be caught by the CI builds so they might break again for you in the future.

@aggarg
Copy link
Contributor Author

aggarg commented Jul 16, 2024

Would be happy to fix if and when that happens.

@pabuhler pabuhler merged commit 5f8dfbf into cisco:main Jul 16, 2024
39 checks passed
@aggarg aggarg deleted the freertos branch July 16, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants