Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

SAM7 interrupts

Posted by Nobody/Anonymous on November 3, 2006
I am working with FreeRTOS on the At91sam7x-ek development board. I am trying to write some serial code to poll an external device, and I am trying to use the PDC to buffer the values before having a thread running in FreeRTOS copy over the buffer, then reset the PDC. However, the PDC buffer isn't getting all of the characters when it is attached to the external device (works fine in hyper terminal though...). So, I decided to write an interrupt to just print out all of the received characters over a TCP connection. I write a simple little interrupt that will just echo the character back over the serial port for starters, and then compiled it all using the arm-gcc. I also ended up putting the interrupt function in a separate file so that I could compile it in ARM mode, rather than THUMB mode. However, when I run the program on the uC, whenever the interrupt is generated, the entire kernel locks up. My best guess is that when it is not returning to "Thumb" mode after the conclusion of the interrupt, but I'm not completely sure. However, I was looking at some of the FreeRTOS code, parcitularly the EMAC interrupt, and it is able to use interrupts without much trouble, however, on the comments for the prototypes they all have something about an asm wrapper. I don't know if that is talking about the __attribute__ or if that means that somewhere in some assembler file, i need to write some code that tells the uC to switch back to "thumb" mode. I was hoping that since you (or someone in your group) was the one who wrote the EMAC interrupt, that you might know how to fix this problem. Any help would be greatly appreciated, or even a point in the right direction. Thanks :)

RE: SAM7 interrupts

Posted by Nobody/Anonymous on November 3, 2006
> I am working with FreeRTOS on the At91sam7x-ek development board. I am trying
> to write some serial code to poll an external device, and I am trying to use
> the PDC to buffer the values before having a thread running in FreeRTOS copy
> over the buffer, then reset the PDC. However, the PDC buffer isn't getting
> all of the characters when it is attached to the external device (works fine
> in hyper terminal though...).

Have you tried writing a very simply program that just does nothing else but receive the data? Without any other functionality, FreeRTOS related or otherwise? Once you have this running you can start to add in other things to see where it starts to go wrong.


>So, I decided to write an interrupt to just print
> out all of the received characters over a TCP connection. I write a simple
> little interrupt that will just echo the character back over the serial port
> for starters, and then compiled it all using the arm-gcc. I also ended up putting
> the interrupt function in a separate file so that I could compile it in ARM
> mode, rather than THUMB mode. However, when I run the program on the uC, whenever
> the interrupt is generated, the entire kernel locks up.

Which version of GCC are you using? There we a bug reported recently that can be fixed using a particular command line option. See this thread: http://sourceforge.net/forum/forum.php?thread_id=1597532&forum_id=382005

>My best guess is that
> when it is not returning to "Thumb" mode after the conclusion of the interrupt,
> but I'm not completely sure.
>However, I was looking at some of the FreeRTOS
> code, parcitularly the EMAC interrupt, and it is able to use interrupts without
> much trouble, however, on the comments for the prototypes they all have something
> about an asm wrapper. I don't know if that is talking about the __attribute__
> or if that means that somewhere in some assembler file, i need to write some
> code that tells the uC to switch back to "thumb" mode. Any help would be greatly appreciated,
> or even a point in the right direction. Thanks :)

If your interrupt does not cause a context switch then it can be written as a normal interrupt without having to worry about anything. If you are wanting to cause a context switch in the interrupt then make sure you copy the examples given for the GCC compiler - not the IAR compiler. The GCC compiler does not need the asm wrappers.


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


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner