Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS slower with an STM32F103RB

Posted 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 STM32F103RB

Posted 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 STM32F103RB

Posted 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 STM32F103RB

Posted 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 STM32F103RB

Posted 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 STM32F103RB

Posted 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


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists