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


ATXMEGA384D3 port

Posted by Jay on March 12, 2013
I am relatively new to the free RTOS but have been developing some new code using it and things have been progressing pretty well. That is until I have reached a certain code size on my device > 78500. Now when I try to delete the first startup task my code resets. I realize there is no official port but wonder if there are some pointers as to what is going wrong.
Heap and stack are ok plenty of space there.
I have enabled task delete and suspend. (using either from within the task cause a re start)

Any suggestions greatly received.


RE: ATXMEGA384D3 port

Posted by Richard on March 12, 2013
Where did you get the code from? The official ATMega port does not support the larger memory devices. Supporting the larger memory devices is, I believe, quite straight forward and requires that a couple of extra RAMn registers are saved in the task context. Is your port doing that?


RE: ATXMEGA384D3 port

Posted by Jay on March 12, 2013
I got this after looking at various port attempts so couldn't be exactly sure where it came from now.
save context is as below.

#if defined(__AVR_ATxmega384D3__)
/* 3-Byte PC Save */
#define portSAVE_CONTEXT()\
asm volatile ("pushr0\n\t"\
"inr0, __SREG__\n\t"\
"ldsr26, pxCurrentTCB\n\t"\
"ldsr27, pxCurrentTCB + 1\n\t"\
"inr0, 0x3d\n\t"\
"stx+, r0\n\t"\
"inr0, 0x3e\n\t"\
"stx+, r0\n\t"\

RE: ATXMEGA384D3 port

Posted by Richard on March 12, 2013
Just from a brief look, without referring to the manuals, I think you need to also be storing RAMX and RAMY (or something like that) in addition to the registers in your post if you want to go above 64K. You would also need to have initial values for the extra registers in the stack setup for a task when the task is created.

Have a look at the Atmel forum in http://interactive.freertos.org to see if you can find an example. You can also ask on http://www.avrfreaks.net


RE: ATXMEGA384D3 port

Posted by Jay on March 12, 2013
Looking at the manual the x y and z registers run from R26 to R31. Not really sure how to use them in this instance though. Apologies.


RE: ATXMEGA384D3 port

Posted by Jay on March 12, 2013
I have now resolved my issue. The problem was in the pxPortInitialiseStack function. The issue was with the program counter being larger than 16bit.

I used yuris from https://github.com/yuriykulikov/FreeRTOS-on-XMEGA


Many thanks for your help.

[ 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