This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX RTOS operation on lower MCU frequencies

Hello,

My application runs on RTX RTOS and MCU STM32F2 is used.

I have implemented one task which handles UART read/write (baudrate 115200). Other task reads data from GPS (UART 9200). Application runs on 48 MHz core clock without any problems. Systick is set to 10 ms.
But when I set MCU core 8MHz, the application stops working. What is the limitations for MCU clock working with RTX RTOS?

Thanks in advance.

Linas

  • Not sure what you mean by "stops workin". It can work well at lower frequencies too, but you need to consider task switch times etc, how often you have co figured tasks switches and what amount of CPU that is needed to maintain your real-time requirements.

  • Maybe I not correctly defined "stops working". The thing is that RTOS is running and tasks are running on 8 MHz, but I am facing fault UART operation. Receive and transmission is faulty.
    There are two interrupt handlers implemented for both UARTS. Tasks only reads global receive buffer and parses data.

  • So have you computed the required interrupt respose times needed to never lose characters, and the amount of time the OS needs to perform the required task switches? Does your clocking options leave you with enough processing power to manage your real-time requirements?

    Note that you can play with I/O pins to let you see on a scope when ISR runs and when your threads do something.

    Whatever CPU speed you select, you still need to verify what safety margins you have to maintain your real-time requirements - even when "all" interrupts gets flagged at the same time.

  • Never mind "correctly" - you didn't define it at all!

    "Receive and transmission is faulty"

    There you go again - what, exactly, do you mean by "faulty"?!

    Being able to give a proper description of the problem is half way (at least) to solving it.

    What tests & debugging have you done to investigate what's happening?

  • I would check you PCLK1 and PCLK2. If you lower SYSCLK, you may also have lowered HCLK if you did not change how it was calculated. PCLK1 and PCLK2 are based on HCLK so you may have lowered these too.

  • At 8 MHz both APB dividers could be DIV1, rather than DIV2/4, check the baud rate value programmed into the USART, understand the % error there.

    8 MHz and 48 MHz are not the only available rates here, the part mentioned is certainly capable of functioning in the range 4-120 MHz, if you turn the PLL off you can run at 16 MHz using the HSI clock. Plenty of options.

    The RTOS is the least of your issues here, understand the actual utilization/loading, and how to better express the failure condition.

  • which handles UART read/write (baudrate 115200) ... Application runs on 48 MHz core clock without any problems.But when I set MCU core 8MHz, the application stops working.
    did you remember to change the UART clock dividers?

    Erik

  • Hello,

    Thank you for your help. Problem solved. There were issues with my hardware.
    So thats why I got faulty data from UART. So, my application on RTX OS is running correctly on 8MHz.