FreeRTOS transplanted into LPC1788, KEIL5.14 compile error-free,
One step operation, RTOS can run normally,
But under full simulation and firmware are not running, RUN immediately stop,
Through the screen lock, found the problem point in prvStartFirstTask,
The simulation approach:
Breakpoints in A, before this function, since the main can be run at full speed to A breakpoint A,
Breakpoints in B, after this function, point immediately immediately after the run, continue to point nor simulation step, RTOS is not running,
Breakpoints in A and B, after the RUN to A single step can skip prvStartFirstTask, normal operation of RTOS,
Firmware:
HEX firmware through isp solidified into the CPU, electricity OS does not start,
A variety of attempting to:
Before and after the breakpoint plus fixed time delay, the problem is still,
C
FreeRTOS V9.0.0 port.
The __asm void prvStartFirstTask (void)
{
PRESERVE8
/* Use the NVIC offset register to locate the stack. */
LDR r0,=0 xe000ed08
LDR r0, r0
LDR r0, r0
/* Set the MSP back to the start of the stack. */
MSR MSP, r0
/* Globally enable interrupts. */
Cpsie I
Cpsie f
DSB
Isb
/* Call SVC to start the first task. */
SVC 0
The nop
The nop
}
BaseType_t xPortStartScheduler (void)
{
//& lt; - A breakpoint A
/* Start the first task. */
PrvStartFirstTask ();
//& lt; - a breakpoint B
}
Void vTaskStartScheduler (void)
{
If (xPortStartScheduler ()!=pdFALSE)
{
/* Should not reach here as if the scheduler is running the function will not return. */
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Int main (void)
{
/* start task scheduling */
If (pdPASS==xReturn)
{
VTaskStartScheduler ();/* startup tasks, open scheduling */
}
}