cancel
Showing results for 
Search instead for 
Did you mean: 

BUG in AZRTOS 6.4 NetxDuo v3.3

mbarg.1
Associate III

in file app_netxduo.c

function static VOID nx_app_thread_entry (ULONG thread_input){ ....

/* wait until an IP address is ready */ if(tx_semaphore_get(&DHCPSemaphore, TX_WAIT_FOREVER) != TX_SUCCESS)

blocks code execution

as in function tx_semaphore_create(&DHCPSemaphore, "DHCP Semaphore", 0){

"tx_semaphore_put(&DHCPSemaphore);"

has been removed - was present in previous versions - nothing sets this semaphore

4 REPLIES 4
Saket_Om
ST Employee

Hello @mbarg.1 

Could you please indicate which STM32 MCU you are working on?

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

BUG is on AZRTOS as such, it applies to every mcu with ethernet - we work mainly on H7, but we have designs with F4 and next design will be with H5

Bug is easily visible when you upgrade from V3.2 to v 3.3, can be verified in STM32Cube/Repository.

Hello @mbarg.1 

Could you please be more precise. 

The function tx_semaphore_create() has not been modified in release 3.3.

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

Ok

When you create a new project, the system creates file app_netxduo.c.

Inside this file, you have function 

       static VOID nx_app_thread_entry (ULONG thread_input)

and you add your code after 

/* USER CODE BEGIN Nx_App_Thread_Entry 2 */

If you create a project with version 6.4.0_3.3.0, you will never reach your code.

Why? Because 

if(tx_semaphore_get(&DHCPSemaphore, TX_WAIT_FOREVER) != TX_SUCCESS)

will prevent to get there.

In previous versions, it worked fine, as DHCP on IP address change calls ip_address_change_notify_callback and this last function put DHCPSemaphore.

Where is the difference ?

It is in function 

 

static VOID ip_address_change_notify_callback(NX_IP *ip_instance, VOID *ptr)

{

/* USER CODE BEGIN ip_address_change_notify_callback */

 

/* USER CODE END ip_address_change_notify_callback */

}

which is now empty while before had 

/* release the semaphore as soon as an IP address is available */

tx_semaphore_put(&DHCPSemaphore);

}

You can check in distribution files

C:\Users\XXX\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AZRTOS-H7\3.3.0\STM32CubeMX\templates\app_netxduo_c_file.ftl

vs

C:\Users\XXX\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AZRTOS-H7\3.2.0\STM32CubeMX\templates\app_netxduo_c_file.ftl

 

 Attached a project generated from .ioc - can send projects with old version, if required.