ARM 7 from STM

nobody wrote on Friday, February 04, 2005:

Has anyone done a port of FreeRTOS to the new ARM 7 family (STR71x) from STMicroelectronics ?

nobody wrote on Friday, February 04, 2005:

I’m not aware of any. 

Which compiler are you wanting to use?  If a port for that compiler already exists then it should just be a matter of writting the memory map (linker script) and peripheral setup routines.

nobody wrote on Friday, February 04, 2005:

I’m using a Keil compiler.
I already tried to port to my uC with the actual port of LPC21xx from philips.
The memory mapping is checked, but my problems were with software interrupts and mode for the context switching…

nobody wrote on Friday, February 04, 2005:

Here are a few pointers.

----

Check the startup code [it can be compared to that for the lpc2000 demo].  Make sure that the stacks are all configured correctly.  Here are some suggested sizes.

        UND_Stack_Size  EQU     0x00000004
        SVC_Stack_Size  EQU     0x00000100
        ABT_Stack_Size  EQU     0x00000004
        FIQ_Stack_Size  EQU     0x00000004
        IRQ_Stack_Size  EQU     0x00000300
        USR_Stack_Size  EQU     0x00000200

----

You need to install the SWI handler and set the IRQ vector.  The LPC2000 port assumes that there is an interrupt controller at PC,[PC, #-0x0FF0] from the IRQ vector.

Vectors:        LDR     PC,Reset_Addr        
                LDR     PC,Undef_Addr
                LDR     PC,SWI_Addr
                LDR     PC,PAbt_Addr
                LDR     PC,DAbt_Addr
                NOP                            /* Reserved Vector */
;               LDR     PC,IRQ_Addr
                LDR     PC,[PC, #-0x0FF0]      /* Vector from VicVectAddr */
                LDR     PC,FIQ_Addr

Reset_Addr:     DD      Reset_Handler
Undef_Addr:     DD      Undef_Handler?A
SWI_Addr:       DD      vPortYieldProcessor?A
PAbt_Addr:      DD      PAbt_Handler?A
DAbt_Addr:      DD      DAbt_Handler?A
                         DD      0                      /* Reserved Address */
IRQ_Addr:       DD      IRQ_Handler?A
FIQ_Addr:       DD      FIQ_Handler?A

----

Hardware configuration needs consideration.  The phase locked loop and interrupt controller are specific to the LPC and may be different on your uC.  Also the timer that generates the tick interrupt will require modification to your particular uC peripheral standard.

----

Try starting with the simplest of programs and without using the preemptive scheduler (set portUSE_PREEMPTION to 0).  A sample program would be along the lines of:

void main( void )
{
    sTaskCreate( TestTask, "test", portMINIMAL_STACK_SIZE, NULL, 0, NULL );
    vTaskStartScheduler( portUSE_PREEMPTION );
   
    /* Should not get here. */
}

void TestTask( void *pvParameters )
{
    for( ;; )
    {
        taskYIELD();
    }
}

You will end up with two tasks.  TestTask() and the automatically generated Idle task.  Neither block so it does not matter if the RTOS tick is not running.  With the cooperative scheduler you should be able to step through the code without the tick interrupting you.  Step through the code in the Keil simulator and see how far you get then let us know.  When you hit a taskYIELD you should go to the SWI handler.  Do you ever get into the first task?

nobody wrote on Monday, February 07, 2005:

Thank you. That’s worked.