STM32F4+FreeRTOS+Keil

Кто любит RISC в жизни, заходим, не стесняемся.
Ответить
Аватара пользователя
osievskiy
Открыл глаза
Сообщения: 79
Зарегистрирован: Вт июн 18, 2013 11:23:25

STM32F4+FreeRTOS+Keil

Сообщение osievskiy »

Доброго времени суток! Пытаюсь скомпилировать проект с подключенной FreeRTOS, но постоянно выскакивает

This port can only be used when the project options are configured to enable hardware floating point support.

Я так понимаю что он хочет что бы я включил FPU, но ничего не получается в настройках ставил и Use FPU и Not used
и так пытался сделать

Код: Выделить всё

void SystemInit(void)
{
	/* FPU settings ------------------------------------------------------------*/
  #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));  /* set CP10 and CP11 Full Access */
  #endif

Ничего не получается.. все время вылазит эта строчка! Подскажите как все таки правильно все настроить что бы в Keil скомпилировать проект?
Реклама
Аватара пользователя
dosikus
Друг Кота
Сообщения: 3604
Зарегистрирован: Пн июл 28, 2008 22:12:01

Re: STM32F4+FreeRTOS+Keil

Сообщение dosikus »

osievskiy , наверное настало время читать ? :)))
Например справку на CMSIS , на тему юзанья FPU в ней все расписано .
Конечно могу ткнув носом расписать все по пунктам , но лучше сами . Оно пользительней.
Заодно посмотрите иерархию интерфейса , и поймете что SPL излишняя прослойка ...
Реклама
Аватара пользователя
osievskiy
Открыл глаза
Сообщения: 79
Зарегистрирован: Вт июн 18, 2013 11:23:25

Re: STM32F4+FreeRTOS+Keil

Сообщение osievskiy »

Нда, помогли так помогли.. я целый день пыытаюсь с этим что то сделать и никак не могу побороть... что я только не читал и не прописывал!!!!
Аватара пользователя
dosikus
Друг Кота
Сообщения: 3604
Зарегистрирован: Пн июл 28, 2008 22:12:01

Re: STM32F4+FreeRTOS+Keil

Сообщение dosikus »

Ну давайте вместе почитаем . :)))
Читать все , жирное читать до осознания !!!!
СпойлерThis user manual describes the CMSIS DSP software library, a suite of common signal processing functions for use on Cortex-M processor based devices.

The library is divided into a number of modules each covering a specific category:

Basic math functions
Fast math functions
Complex math functions
Filters
Matrix functions
Transforms
Motor control functions
Statistical functions
Support functions
Interpolation functions
The library has separate functions for operating on 8-bit integers, 16-bit integers, 32-bit integer and 32-bit floating-point values.

Processor Support

The library is completely written in C and is fully CMSIS compliant. High performance is achieved through maximum use of Cortex-M4 intrinsics.

The supplied library source code also builds and runs on the Cortex-M3 and Cortex-M0 processor, with the DSP intrinsics being emulated through software.

Toolchain Support

The library has been developed and tested with MDK-ARM version 4.21. The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.

Using the Library

The library installer contains prebuilt versions of the libraries in the Lib folder.

arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
arm_cortexM4l_math.lib (Little endian on Cortex-M4)
arm_cortexM4b_math.lib (Big endian on Cortex-M4)
arm_cortexM3l_math.lib (Little endian on Cortex-M3)
arm_cortexM3b_math.lib (Big endian on Cortex-M3)
arm_cortexM0l_math.lib (Little endian on Cortex-M0)
arm_cortexM0b_math.lib (Big endian on Cortex-M3)

The library functions are declared in the public file arm_math.h which is placed in the Include folder. Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single public header file arm_math.h for Cortex-M4/M3/M0 with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. Define the appropriate pre processor MACRO ARM_MATH_CM4 or ARM_MATH_CM3 or ARM_MATH_CM0 depending on the target processor in the application.

Examples

The library ships with a number of examples which demonstrate how to use the library functions.

Building the Library

The library installer contains project files to re build libraries on MDK Tool chain in the CMSIS\DSP_Lib\Source\ARM folder.

arm_cortexM0b_math.uvproj
arm_cortexM0l_math.uvproj
arm_cortexM3b_math.uvproj
arm_cortexM3l_math.uvproj
arm_cortexM4b_math.uvproj
arm_cortexM4l_math.uvproj
arm_cortexM4bf_math.uvproj
arm_cortexM4lf_math.uvproj
Each library project have differant pre-processor macros.

ARM_MATH_CMx: Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target and ARM_MATH_CM0 for building library on cortex-M0 target.

ARM_MATH_BIG_ENDIAN: Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.

ARM_MATH_MATRIX_CHECK: Define macro for checking on the input and output sizes of matrices

ARM_MATH_ROUNDING: Define macro for rounding on support functions

__FPU_PRESENT: Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries


The project can be built by opening the appropriate project in MDK-ARM 4.21 chain and defining the optional pre processor MACROs detailed above.

Copyright Notice

Copyright (C) 2010 ARM Limited. All rights reserved.



Из прочтенного следует, что для полноценного юзанья FPU нужно включить дефайн __FPU_PRESENT, сей дефайн уже прописан в stm32f4xx.h.
Далее надо подключить мат либы , для этого надо подключить хэдер arm_math.h и прописать дефайн ARM_MATH_CM4 в препроцессоре .
Осталось включить дефайн __FPU_USED(что в купе с __FPU_PRESENT включает сопроцессор)- та самая галочка , которую вы судорожно переключаете. :)))
Это все в Keil и Iar , в ГНУтых компилях надо еще саму либу подключить ручками .
Реклама
Эиком - электронные компоненты и радиодетали
Аватара пользователя
osievskiy
Открыл глаза
Сообщения: 79
Зарегистрирован: Вт июн 18, 2013 11:23:25

Re: STM32F4+FreeRTOS+Keil

Сообщение osievskiy »

До осознания прочитал :))) Спасибо! Вроде бы включил все как нужно, но все равно он эту строку начал выводить
Я прописал в дефайны еще и __VFP_FP__ , но теперь он ругается на

Код: Выделить всё

void vPortSVCHandler( void )
{
	__asm volatile (
					"	ldr	r3, pxCurrentTCBConst2		\n" /* Restore the context. */
					"	ldr r1, [r3]					\n" /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */
					"	ldr r0, [r1]					\n" /* The first item in pxCurrentTCB is the task top of stack. */
					"	ldmia r0!, {r4-r11, r14}		\n" /* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
					"	msr psp, r0						\n" /* Restore the task stack pointer. */
					"	mov r0, #0 						\n"
					"	msr	basepri, r0					\n"
					"	bx r14							\n"
					"									\n"
					"	.align 2						\n"
					"pxCurrentTCBConst2: .word pxCurrentTCB				\n"
				);
}
..\freertos\port.c(221): error: #1086: Operand is wrong type
Реклама
Ответить

Вернуться в «ARM»