FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2012 Threads] FreeRTOS slower with an STM32F103RBPosted by Benjamin on September 21, 2012 Hi everybody,
I used FreeRTOS for a couple of projects based on an STM32F103VC and everything was working fine but now I switched to an STM32F103RB and for a reason that I ignore, the SysTick seems to run a about 100Hz instead of 1kHz... I measure this using the vApplicationTickHook().
I used the exactly same files for the different projects, I just changed some definitions (declare the MCU as a medium density for example).
I checked, the oscillator is set up to runs at 72MHz, as usual.
Do anyone has a lead on the origin of this behavior?
Thanks
RE: FreeRTOS slower with an STM32F103RBPosted by Richard on September 22, 2012 It must be a chip configuration problem. The kernel uses the SysTick to generate tick interrupts. SysTick is on the core itself and does not need clocking separately. The calculation used to set the tick frequency itself uses configCPU_CLOCK_HZ and configTICK_RATE_HZ (both defined in FreeRTOSConfig.h). If these settings are correct, but the tick frequency is wrong, it would indicate that the CPU is not running at the frequency you think it is. “I used the exactly same files for the different projects,” Does that include the same system files provided by ST? If there is a setting in those files that is specific to the chip, then that might be the cause of the problem. Nothing in the FreeRTOS files themselves will change between the chips. Regards.
RE: FreeRTOS slower with an STM32F103RBPosted by Benjamin on September 22, 2012 Thanks for your answer. No, not the same ST files. I changed the linker script and the startup file. The chip is declared as a medium density one. In FreeRTOSConfig.h I have these lines : #define configCPU_CLOCK_HZ( 72000000UL ) #define configTICK_RATE_HZ( ( portTickType ) 1000 )
Is there any way to check the chip frequency?
RE: FreeRTOS slower with an STM32F103RBPosted by Benjamin on September 22, 2012 I used a PWM output to check the frequency of the CPU and I have an output frequency of 11.11Hz instead of 100Hz. So apparently the chip is running at 8MHz... It's not a FreeRTOS problem so we can close this thread but if someone has an idea to solve that...
RE: FreeRTOS slower with an STM32F103RBPosted by Richard on September 22, 2012 You could try finding the function that configures the CPU frequency, and then step into that using the debugger to see if there is a clue there (either in the comments, or a variable). Be aware however that often a debugger will loose contact with the hardware if you try stepping over the instructions that change the CPU frequency (presumably because the JTAG frequency changes too). The function that configures the clock might be called before main().
Alternatively, if you are using CMSIS libraries, you can try inspecting the SystemCoreClock variable.
Regards.
RE: FreeRTOS slower with an STM32F103RBPosted by Benjamin on September 22, 2012 Problem solved, I forgot that on this board I don't have any external oscillator so I modified the clock configuration function to enable the PLL on the internal oscillator. I can reach 64MHz in this configuration.
Thanks for your help
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|