Quality RTOS & Embedded Software

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




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) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS