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

STR912 and Rowley

Posted by williamjsell on February 1, 2008
I see there is a demo with IAR and STR912 using uIP, has anyone ported this over to Crossworks?

-Bill

RE: STR912 and Rowley

Posted by Richard on February 1, 2008
Hi - I can't help with your request directly, but the following page might be of assistance: http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html.

Regards.

RE: STR912 and Rowley

Posted by williamjsell on February 5, 2008
Thanks Richard,
That link does not appear to work, but I can find my way to the hardware port page. This is not really a hardware port, I am merely trying to use Rowley's Crossworks instead of IAR for the ARM9 demo. I am not familiar with the chip (yet) so I am not sure what I have to worry about, but I think I will construct a project in Rowley based on the files in the IAR demo and see what errors I get. If I get this to work I will post this back onto the site for other users...

Thanks

-Bill

RE: STR912 and Rowley

Posted by slawc on February 5, 2008
I'm also trying to use Crossworks. I started with LPC23xx port and STR9 IAR port. At this moment everything stops here
void vPortISRStartFirstTask( void )
{

/* Simply start the scheduler. This is included here as it can only be
called from ARM mode. */
portRESTORE_CONTEXT();
}

To be more specific at this line of portRESTORE_CONTEXT() macro

subs pc, lr, #0x00000004

I get data abort. I think I missed something in configuration (stack, init,...) in the Crossworks because I also peeked into Ben's gcc port (thanks a lot again!!!) and besides IRQ handling and some macro locations I can't find differences that could cause troubles.

I prefer LPC23xx port style where all needed functions and macros for the FreeRTOS itself are located in the three files in the portable directory and seperated from crt0.s, IRQ hanlder etc.

BTW -> "ARM7 GCC ports no longer use the IRQ attribute" is true only for ARM7_LPC2000 other ports (such as LPC23xx) still uses "IRQ" attribute.





RE: STR912 and Rowley

Posted by Richard on February 5, 2008
>To be more specific at this line of portRESTORE_CONTEXT() macro
>subs pc, lr, #0x00000004

This is normally a symptom of not being in Supervisor mode when the scheduler is started. CrossWorks provides a mechanism for this - all you need to do is define SUPERVISOR_START in the pre-processor section of the project options. Do you have this definition?

With reference to the IRQ comment - thanks for pointing this out. I actually made the change because the GCC version supplied with my current CrossWorks installation will not even compile the IRQ attribute and I was working on the LPC2138 at the time.

Regards.

RE: STR912 and Rowley

Posted by slawc on February 5, 2008
Just checked again in the Register view, micro is in Supervisor mode.


RE: STR912 and Rowley

Posted by Richard on February 5, 2008
When you execute the line:
SUBSPC, LR, #4

what value is in LR?

What values are in the registers R1, R2 and R3?

Regards.

RE: STR912 and Rowley

Posted by slawc on February 5, 2008
Hm... ok I got something. Just after the check for Supervisor mode, I commented out some lines that created LCD queue, LCD and LED task (I used that code from the STR9 IAR port) so main function has only hardware init and vTaskStartScheduler(). No more abort, system is running.

It seems that I got corrupted stack (I set up 1024 bytes but this wasn't enough or did I missed something in the Crossworks project setup?).

RE: STR912 and Rowley

Posted by Richard on February 5, 2008
1KByte stack should be much more than enough, unless you are using complex sprintf/printf type calls?

Interrupts will become enabled as the first task starts. Is it possible that a task or interrupt is writing to a queue/semaphore/mutex that has not been created?

Regards.

RE: STR912 and Rowley

Posted by slawc on February 5, 2008
LR is filled with 0x0504
R0 0x0400073c
R1 0x0101...
R2 0x0202...
R3 0x0303...


RE: STR912 and Rowley

Posted by slawc on February 5, 2008
No complex type calls. Now I have just a LED flash task provided in the IAR port. Anyway increasing the stack size doesn't solve the problem.

RE: STR912 and Rowley

Posted by slawc on February 6, 2008
Here we go... I have running STR912 Demo for Rowley. I commented out serial com demo and I didn't test the TCP part yet. Thanks to Ben for his GCC port.

The problem was in the interrupt handling. Originaly I wanted to use VECTORED_IRQ_INTERRUPTS as in LPC2368 demo, but without luck. So I used IRQ wrapper (like Bens GCC and IAR ports):

void irq_handler( void ) __attribute__((naked));

void irq_handler(void)
{
portSAVE_CONTEXT();

asm volatile (
"ldrr0, = 0xFFFFF030 \n\t"
"ldrr0, [r0]\n\t"/* Read the routine address */
"ldrr1, = 0xFC000030 \n\t"
"ldrr1, [r1] \n\t"
"movlr, pc \n\t"
"bxr0 \n\t"
"ldrr0, = 0xFFFFF030\n\t"/* Write to the VectorAddress to clear the */
"strr0, [r0]\n\t"/* respective interrupt in the internal interrupt */
"ldrr1, = 0xFC000030\n\t" /* Write to the VectorAddressDaisy to clear the */
"strr1,[r1]");/* respective interrupt in the internal interrupt*/

/* Restore the context of the new task. */
portRESTORE_CONTEXT();

}

void swi_handler( void ) __attribute__((naked));

void swi_handler(void)
{
/* Within an IRQ ISR the link register has an offset from the true return
address, but an SWI ISR does not. Add the offset manually so the same
ISR return code can be used in both cases. */
asm volatile ( "ADDLR, LR, #4" );

/* Perform the context switch. First save the context of the current task. */
portSAVE_CONTEXT();

/* Find the highest priority task that is ready to run. */
vTaskSwitchContext();

/* Restore the context of the new task. */
portRESTORE_CONTEXT();


}


RE: STR912 and Rowley

Posted by ollo on February 19, 2008
Hi

Would you mind to share your project files?


RE: STR912 and Rowley

Posted by slawc on February 23, 2008
Sorry for late reply, I didn't have much time these days. I hope I'll find more time this week to test whole STR912 demo and send it to Richard (if he is interested to put it on the freertos.org). As I said basic (freertos standard) tasks and LCD are working just fine. TCP and UART were not included (IAR to gcc porting is needed).


[ 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