Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Lattice Mico32

Posted 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 Mico32

Posted 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 Mico32

Posted 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 Mico32

Posted 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 Mico32

Posted 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;



[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists