Skip to main content
Romaszewski
Associate II
May 29, 2024
Question

error in generate code for stm32WBA54 with MX tools

  • May 29, 2024
  • 6 replies
  • 2287 views

For your information

Sizeof is used in place of strlen and my coordinator receive a \0x00 at the end of the string !!

when i generate code with MX generation tools, in function : in red old code in green new code

 

void APP_ZIGBEE_ConfigBasicServer(void)

{

static struct ZbZclBasicServerDefaults stBasicServerDefaults;

/* Initialize Basic Server Cluster 'defaults' information */

memset( &stBasicServerDefaults, 0x00, sizeof(stBasicServerDefaults) );

stBasicServerDefaults.mfr_name[0] = sizeof strlen( APP_ZIGBEE_MFR_NAME );

memcpy( &stBasicServerDefaults.mfr_name[1], APP_ZIGBEE_MFR_NAME, sizeof( APP_ZIGBEE_MFR_NAME ) );

stBasicServerDefaults.model_name[0] = sizeof strlen( APP_ZIGBEE_CHIP_NAME );

memcpy( &stBasicServerDefaults.model_name[1], APP_ZIGBEE_CHIP_NAME, sizeof( APP_ZIGBEE_CHIP_NAME ) );

stBasicServerDefaults.date_code[0] = sizeof strlen( APP_ZIGBEE_APP_DATE_CODE );

memcpy( &stBasicServerDefaults.date_code[1], APP_ZIGBEE_APP_DATE_CODE, sizeof( APP_ZIGBEE_APP_DATE_CODE ) );

stBasicServerDefaults.sw_build_id[0] = sizeof strlen( APP_ZIGBEE_APP_BUILD_ID );

memcpy( &stBasicServerDefaults.sw_build_id[1], APP_ZIGBEE_APP_BUILD_ID, sizeof( APP_ZIGBEE_APP_BUILD_ID ) );

This topic has been closed for replies.

6 replies

STTwo-32
ST Technical Moderator
May 29, 2024

Hello @Romaszewski 

Can you share your .ioc file so we can reproduce this behavior.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Romaszewski
Associate II
May 29, 2024
STTwo-32
ST Technical Moderator
May 29, 2024

I'm not able to reproduce that issue. Could you give more details and the steps to reproduce this issue. 

Merci Beaucoup d'avance.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Romaszewski
Associate II
June 6, 2024

Do you have a procedure to inform the team of development of MX tools for this error ?

STTwo-32
ST Technical Moderator
June 12, 2024

Hello @Romaszewski 

I've raised this internally for more investigation (under internal ticket number 184049).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.