Skip to main content
Visitor II
November 15, 2024
Solved

Incorrect UX_PERIODIC_RATE when TX_TIMER_TICKS_PER_SECOND has been set to 1ms

  • November 15, 2024
  • 1 reply
  • 643 views

I have a STMCubeMX project in which I've changed to 1ms tick in ThreadX. This shows the following from printf:

UX_PERIODIC_RATE=100
TX_TIMER_TICKS_PER_SECOND=1000

The attached STM32CubeMX project is ported from Ux_Device_CDC_ACM to run on the STM32H743I-EVAL board and migrated to STM32CubeMX 6.12.1

USART1 is used for printf output. USB_OTG_FS is set up for device cdc.

Started
UX_PERIODIC_RATE=100
TX_TIMER_TICKS_PER_SECOND=1000
*** MX_USBX_Device_Init ***
*** MX_USBX_Device_Init *** complete
*** USBX_APP_Device_Init ***
*** USBX_APP_Device_Init *** complete
*** usbx_cdc_acm_read_thread_entry ***
*** usbx_cdc_acm_write_thread_entry ***
*** USBD_CDC_ACM_Activate ***
*** USBD_CDC_ACM_Activate *** complete
*** USBD_CDC_VCP_Config ***
*** USBD_CDC_VCP_Config *** complete

 

UX_PERIODIC_RATE is defined in ux_port.h at line 133:

#ifndef UX_PERIODIC_RATE
#define UX_PERIODIC_RATE 100
#endif

 

It is also defined in ux_api.h at line 893:

#ifndef UX_PERIODIC_RATE
#ifdef TX_TIMER_TICKS_PER_SECOND
#define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)
#else
#define UX_PERIODIC_RATE 100
#endif
#endif

 

This definition does not have any effect because ux_port.h is included earlier in ux_api.h at line 163:

#include "ux_port.h"

 

    This topic has been closed for replies.
    Best answer by FBL

    Hi @ifemc 

    An internal ticket 196562 is submitted to dedicated team to review definition of UX_PERIODIC_RATE.

     

    /* #define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)*/

     

    In ux_user.h, this line is commented because the UX_PERIODIC_RATE is not entered by User in CubeMX. I was expecting that generated code should have configure it without further modifications.

    1 reply

    FBLAnswer
    Technical Moderator
    November 19, 2024

    Hi @ifemc 

    An internal ticket 196562 is submitted to dedicated team to review definition of UX_PERIODIC_RATE.

     

    /* #define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)*/

     

    In ux_user.h, this line is commented because the UX_PERIODIC_RATE is not entered by User in CubeMX. I was expecting that generated code should have configure it without further modifications.