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

STM32F103 with GCC systick err

Posted by label.sr on August 22, 2013
Hi,
I use FreeRTOS V7.5.2 on STM32F103RE with GCC compile. But systick seem to be wrong. When I use:
vTaskDelay(1000 / portTICK_RATE_MS), the delay time seem to be 10 second, not 1 second. xQueueReceive(g_VolCtrlQ, &stQItem,400 / portTICK_RATE_MS) also delay about 4 second, not 400ms. But I run IAR Demo project is OK. Does any body meet this problem? Can anybody give me some advice? Thanks a lot.

RE: STM32F103 with GCC systick err

Posted by Richard on August 22, 2013
Are you using the same FreeRTOSConfig.h between the IAR and GCC projects?

If so, how is configCPU_CLOCK_HZ being set? If it is just mapped to SystemCoreClock then your GCC and IAR projects are probably setting SystemCoreClock differently, or the GCC project is not setting it at all.

If no, then is configCPU_CLOCK_HZ set to the same value in both files?


Are your IAR and GCC projects executing the same start up code?

It is likely the IAR project will be running start up code that configures the MCU clocks, and may even call a configuration file provided by the application before it calls main(). If you GCC project is not doing this then the frequency the chips are running at when main() is called could be different.

Regards.

STM32F103 with GCC systick err

Posted by mrichmond68 on December 11, 2014

I'm also working with the STM32F103 and the GCC/ARMCM3 port. Just wanted to add that as a newbie (which I am) it was not automatically clear how configCPUCLOCK_HZ should be set and how much configuring I should do manually of sysTick before the freeRTOS got hold of it.

So here is what I found for V8.1.2, the GCC ARMCM3 port. configCPUCLOCKHZ should be set to the core clock rate, not to the core clock/8, and I don't need to do anything to SysTick. freeRTOS configures the SysTick clock source to be the core clock. This happens in FreeRTOSSourceportableGCCARMCM3port.c,vPortSetupTimerInterrupt().


[ 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