FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2010 Threads] Lattice Mico32Posted by Jon Harper on May 19, 2010 Hi, I would like to use the community port of FreeRTOS on a Lattice Mico32. I downloaded the files available at http://www.freertos.org/index.html?http://interactive.freertos.org/forums/104358-lattice. I tried to buid this with the version of FreeRTOS 4.7.0 (what it was created for). There are some missing include files : #include "system_conf.h" #include "Timer.h" #include "GPIO.h" I suppose this is some lattice specific headers files, but can't find them anywhere. Does anyone have any pointers here ? Thanks in advance Jon
RE: Lattice Mico32Posted by MEdwards on May 19, 2010 Yes I think you must be right, there are not FreeRTOS files. Could it be that the version of the Lattice tools has changed since the port was posted?
RE: Lattice Mico32Posted by Jon Harper on May 21, 2010 So I got it to compile using the following Timer.h (writtten after reading the lattice mico32 timer spec) #ifndef TIMER_H #define TIMER_H #include
#define TIMER_CONTROL_INT_BIT_MASK 1 << 0 #define TIMER_CONTROL_CONT_BIT_MASK 1 << 1 #define TIMER_CONTROL_START_BIT_MASK 1 << 2 #define TIMER_CONTROL_STOP_BIT_MASK 1 << 3
#define TIMER_BASE_ADDRESS 0xA0000600 // This is the timer address for my configuration, it should be changed
typedef struct { volatile uint32_t Status; volatile uint32_t Control; volatile uint32_t Period; volatile uint32_t Snapshot; } Timer_t ;
#endif
However, context switching does not occur. I can see that the timer interrupt handler is called, I can see that the systick is incrementing, but it doesn't change context. Could someone explain what normally happens when the ISR handlers executes the following functions ? vTaskIncrementTick(); vTaskSwitchContext();
RE: Lattice Mico32Posted by Jon Harper on May 21, 2010 This is what when I dump the values that are logged by the trace utility : ... TickCount :14 previous :1 TickCount :15 previous :0 TickCount :16 previous :1 TickCount :17 previous :0 TickCount :18 previous :1 ...
It looks like both my tasks are beeing scheduled However, I am sure that when I launch two tasks, only the code from the last created task is executed. The code from the other task is not executed. Does anyone have any pointers ..?
RE: Lattice Mico32Posted by Jon Harper on May 26, 2010 Ok, I had not seen the low level interrupt routine vPortInterruptHandler that saves and restores contexts... I was calling the high level IRQ directly. Now that I changed that, it works like a charm !
I had to add one line to port.c though, but maybe that's because i'm running a simulated timer, not the real timer from lattice.
Here's the line : + pTimer->Period = configCPU_CLOCK_HZ / configTICK_RATE_HZ ; pTimer->Control = TIMER_CONTROL_START_BIT_MASK | TIMER_CONTROL_INT_BIT_MASK | TIMER_CONTROL_CONT_BIT_MASK;
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|