2024-12-16 11:32 PM - edited 2024-12-17 11:51 PM
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
2024-12-18 02:25 AM
Hello @mbarg.1
Could you please indicate which STM32 MCU you are working on?
2024-12-18 03:11 AM
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.
2024-12-18 07:41 AM
Hello @mbarg.1
Could you please be more precise.
The function tx_semaphore_create() has not been modified in release 3.3.
2024-12-19 02:49 AM
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.