rodrigodelavega wrote on Wednesday, September 26, 2012:
Thanks, i havent defined tris variable anywhere.
So I was disabled configGENERATE_RUN_TIME_STATS, but i have still few errors:
Description Resource Path Location Type
undefined reference to `_sbrk’ pokus107 line 0 C/C++ Problem
my main.c is:
#include <stddef.h>
#include "stm32f10x.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_gpio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#define LED_PORT GPIOB
#define LED1 GPIO_Pin_13
#define LED2 GPIO_Pin_14
#define LED3 GPIO_Pin_15
void prvTaskA (void* pvParameters)
{
(void) pvParameters;
for (;;) {
GPIO_SetBits(LED_PORT,LED2);
vTaskDelay(1000);
//GPIO_ResetBits(LED_PORT,LED2);
vTaskDelay(1000);
}
}
void prvTaskB (void* pvParameters)
{
(void) pvParameters;
for (;;) {
GPIO_SetBits(LED_PORT,LED1);
vTaskDelay(1000);
//GPIO_ResetBits(LED_PORT,LED1);
vTaskDelay(1000);
}
}
void mojDelay()
{long int i;
i=0;
while(i < 2300000) //cca 0,5 sekundovy delay
{
i++;
}
}
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
SysTick_Config(1000);
SystemCoreClockUpdate();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
GPIO_InitStructure.GPIO_Pin = LED1 | LED2 | LED3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(LED_PORT, &GPIO_InitStructure);
xTaskCreate( prvTaskA, ( signed char * ) "TaskA", configMINIMAL_STACK_SIZE , NULL,1 , NULL );
xTaskCreate( prvTaskB, ( signed char * ) "TaskB", configMINIMAL_STACK_SIZE , NULL,1 , NULL );
vTaskStartScheduler();
//sem by sme dojst nemali
while(1)
{
GPIO_SetBits(LED_PORT,LED1);
mojDelay();
GPIO_SetBits(LED_PORT,LED2);
mojDelay();
GPIO_SetBits(LED_PORT,LED3);
mojDelay();
GPIO_ResetBits(LED_PORT,LED1);
mojDelay();
GPIO_ResetBits(LED_PORT,LED2);
mojDelay();
GPIO_ResetBits(LED_PORT,LED3);
mojDelay();
}
return 0;
}
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
{
( void ) pxTask;
( void ) pcTaskName;
for( ;; );
}
void vApplicationTickHook( void )
{
}
and my config file is:
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 30 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
#define configUSE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 0
#define configUSE_ALTERNATIVE_API 0
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configGENERATE_RUN_TIME_STATS 0
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define configKERNEL_INTERRUPT_PRIORITY 255
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xb0, or priority 11. */
#define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15
#endif /* FREERTOS_CONFIG_H */
without FreeRTOS includes and tasks is this compiled and functionaly in last endless loop with LED’s with no errors