Hello,
thank u very much for your answer.
Unfortunatelly I wasn’t able to get it running.
Although in the datasheet is said BASPRI priority bits are [7:4] (4 BITS!!!) the definition for configPRIO
BITS in CMSIS is 3. I do not understand this.
Because I am not sure what is right, I am still using the above settings (4 Bits).
My problem is not, that I am not able to start the Scheduler.
I jump into dummyhandler (Hard Fault) when I hit the function
vTaskStartScheduler()–>xTaskCreate(prvIdleTask,…)–>xTaskGenericCreate(…)–>taskYIELD
IFUSING_PREEMPTION()–>xPortPendSVHandler()
Here I can step through, up to line “stmdb r0!, {r4-r11, r14}”. After that line I directly jump into dummy_handler() because of Hard Fault Error Interrupt.
~~~
void xPortPendSVHandler( void )
{
/* This is a naked function. */
__asm volatile
(
" mrs r0, psp n"
" isb n"
" n"
" ldr r3, pxCurrentTCBConst n" /* Get the location of the current TCB. */
" ldr r2, [r3] n"
" n"
" tst r14, #0x10 n" /* Is the task using the FPU context? If so, push high vfp registers. */
" it eq n"
" vstmdbeq r0!, {s16-s31} n"
" n"
" stmdb r0!, {r4-r11, r14} n" /* Save the core registers. */
" n"
" str r0, [r2] n" /* Save the new top of stack into the first member of the TCB. */
" n"
" stmdb sp!, {r3} n"
" mov r0, %0 n"
" cpsid i n" /* Errata workaround. */
" msr basepri, r0 n"
" dsb n"
" isb n"
" cpsie i n" /* Errata workaround. */
" bl vTaskSwitchContext n"
" mov r0, #0 n"
" msr basepri, r0 n"
" ldmia sp!, {r3} n"
" n"
" ldr r1, [r3] n" /* The first item in pxCurrentTCB is the task top of stack. */
" ldr r0, [r1] n"
" n"
" ldmia r0!, {r4-r11, r14} n" /* Pop the core registers. */
" n"
" tst r14, #0x10 n" /* Is the task using the FPU context? If so, pop the high vfp registers too. */
" it eq n"
" vldmiaeq r0!, {s16-s31} n"
" n"
" msr psp, r0 n"
" isb n"
" n"
#ifdef WORKAROUND_PMU_CM001 /* XMC4000 specific errata workaround. */
#if WORKAROUND_PMU_CM001 == 1
" push { r14 } n"
" pop { pc } n"
#endif
#endif
" n"
" bx r14 n"
" n"
" .align 2 n"
"pxCurrentTCBConst: .word pxCurrentTCB n"
::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY)
);
}
~~~
I also tried it with 3 bit and the following settings:
configMAX
PRIORITIES ((unsignes portBASETYPE) 5 )
configPRIO
BITS 3
configLIBRARYLOWEST
INTERRUPTPRIORITY 0x07
configLIBRARY
MAXSYSCALL
INTERRUPTPRIORITY 1
configKERNEL
INTERRUPTPRIORITY ( configLIBRARY
LOWESTINTERRUPT
PRIORITY << (8 – configPRIOBITS) )
configMAX
SYSCALLINTERRUPT
PRIORITY ( configLIBRARYMAX
SYSCALLINTERRUPT
PRIORITY << (8 – configPRIOBITS) )
but without any success.
I am using freertos 8.2.3 and I don’t know what to do.
here is my small application code:
~~~
void User
inittasks(void)
{
xTaskHandle xINITHandle;
portBASE_TYPE retVal=0;
//Start init Task
retVal = xTaskCreate( init_task, // Function
( signed portCHAR * ) "INIT_Task", // Name
256, // Stack Size
NULL, // Parameter
tskIDLE_PRIORITY, // Prio
&xINITHandle ); // Handel
/* Start the scheduler. */
vTaskStartScheduler();
/* Will only get here if there was insufficient memory to create the idle
task. */
return 0;
}
void init
task(void *pvParameters)
{
(void) pvParameters;
portBASETYPE OK = pdPASS;
//Blinky Task
OK = xTaskCreate(Blink, "Blinky",
TASK_LED_STACK_SIZE,
NULL,
TASK_LED_PRIORITY,
&System.taskhandles[LED_HANDLE]);
// OK |= xTaskCreate(vStartEthernetTask, “ETHLAUNCH”,
// configMINIMAL
STACKSIZE,
// NULL,
// tskIDLE_PRIORITY,
// NULL);
// OK |= xTaskCreate(CAN
TOETH
TASK, “CANTO
ETH”,
// CANTO
ETHTASK
STACKSIZE,
// NULL,
// CAN
TOETH
TASKPRIORITY,
// &System.taskhandles[CAN
TOETHER_HANDLE]);
//if(OK != pdPASS)
//set_SystemStatus(SYSTEM_ERROR, 2);
vTaskDelete(xTaskGetCurrentTaskHandle());
}
//Blink Task alle 200ms
void Blink(void *pvParameters)
{
portTickType xLastWakeTime;
const portTickType xFrequency = LIFE_PULS_CYCLE_TIME_MS;
xLastWakeTime = xTaskGetTickCount();
for(;;)
{
ioport_toggle_pin_level(LED_ON);
vTaskDelayUntil(&xLastWakeTime, xFrequency); //Pause
}
}
User
inittasks() I am calling from my main().
~~~
I am really looking forwars to your ansers.
Thank u very much.