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

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 ]    [ 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