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

vPortSetupTimerInterrupt changes break STM32F4

Posted by pbleyer on December 15, 2013

Hello.

I have been checking out the FreeRTOS development releases that implement tickless mode and, after realizing that SysTick was running slower than before on some STM32F4-based boards, I saw that the portNVICSYSTICKCTRLREG initialization in vPortSetupTimerInterrupt (ARMCM4F, tickless mode disabled) was modified to update only the INT and ENABLE bits instead of updating the complete register as before. In particular:

678c686
< 	portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
---
> 	portNVIC_SYSTICK_CTRL_REG |= ( portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT );

The CM4 standard states that the reset value of STKCTRL is 0x00000004 --i.e., default CLKSOURCE is the AHB clock. However from the debugger output I can see the value on my chip after reset is 0x0000_0000 instead, effectively selecting CLKSOURCE as AHB/8 and the reason for the slower behavior.

Is there any rationale behind the change to bit ORing in the case of tick-mode vPortSetupTimerInterrupt function? I understand the code may be written directly from the standard but it seems the STM32F4 is deviant, at least the ones I have.

Best regards.


vPortSetupTimerInterrupt changes break STM32F4

Posted by rtel on December 15, 2013

Try the latest head revision now. It reverts to the old line:

portNVICSYSTICKCTRLREG = portNVICSYSTICKCLKBIT | portNVICSYSTICKINTBIT | portNVICSYSTICKENABLEBIT;

but sets portNVICSYSTICKCLKBIT to 0 if configSYSTICKCLOCK_HZ is defined. It is checked in with the following comment:

"Force the SysTick clock bit to be set in Cortex-M3 and Cortex-M4F bits if configSYSTICKCLOCKHZ is not defined, otherwise leave the bit as it is found as the SysTick may use a divided clock."

Please let us know if this works for you or not.

Regards.


vPortSetupTimerInterrupt changes break STM32F4

Posted by pbleyer on December 16, 2013

That certainly fixes it. Many thanks.


[ 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