Hallo,
ich habe auf einem STM32F103RB nun FreeRTOS aufgesetzt und alles
angepasst und es kommt beim start zu folgender stelle ...
1 | portBASE_TYPE xPortStartScheduler( void )
|
2 | {
|
3 | /* Make PendSV, CallSV and SysTick the same priroity as the kernel. */
|
4 | *(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;
|
5 | *(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;
|
6 |
|
7 | /* Start the timer that generates the tick ISR. Interrupts are disabled
|
8 | here already. */
|
9 | prvSetupTimerInterrupt();
|
10 |
|
11 | /* Initialise the critical nesting count ready for the first task. */
|
12 | uxCriticalNesting = 0;
|
13 |
|
14 | /* Start the first task. */
|
15 | vPortStartFirstTask();
|
16 |
|
17 | /* Should not get here! */
|
18 | return 0;
|
19 | }
|
Bei vPortStartFirstTask liest er von der Adress 0xE000ED08 und spring
jedoch wieder zu der zuvor bereits aufgerufenen Funktion
prvSetupTimerInterrupt.
1 | void vPortStartFirstTask( void )
|
2 | {
|
3 | __asm volatile(
|
4 |
|
5 | " ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
6 | " ldr r0, [r0] \n"
|
7 | " ldr r0, [r0] \n"
|
8 | " msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
9 | " svc 0 \n" /* System call to start first task. */
|
10 | );
|
11 | }
|
12 |
|
13 | void prvSetupTimerInterrupt( void )
|
14 | {
|
15 | /* Configure SysTick to interrupt at the requested rate. */
|
16 | *(portNVIC_SYSTICK_LOAD) = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
|
17 | *(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE;
|
18 | }
|
Diese Schleife läuft dann ewig. Wo liegt der Fehler bzw. was habe ich
vergessen zu konfigurieren? Irgendwie kommt der Stack durcheinander oder
...
Philipp