For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU.
This group is to exchange information to help users get started and learn how to use the devices.
FreeRTOS with AT91SAM7x512 - bhavintailor_ec - May 29 0:56:52 2009
I am using YAGARTO Tool to compile my project based on AT91SAM7X512. I have developed one
project without RTOS. Its code size become higher than 265K and ram size around 64K. It
works Ok. Now, i want to add TCP/IP. So, that i first make working webserver on my
hardware. The TCP/IP Stack which i have used is for AT91SAM7X256. So, i modified every
where with AT91SAM7X512 header file with its flash and ram size. The stack which i have
used is based on uIP with FreeRTOS. Currently this webserver is working ok. This stack
size around 80K. Now, as i mearge this STACK (based on FreeRTOS) with my previous
developed project, it stop working after total code size become higher than 265K. I am
just adding code. I m not calling any function. As i remove some functions code and as
code size less than 264K then it works ok but as it reach limit of 265K, webserver code
stop working. I think this problem is created either by STARTUP File or some makefile
command which limit code to AT91SAM7X256 flash size. So, How can i remove this problem ?
For refrence i have added below code of boot.s, atmel-rom.ld & Makefile.
/************** boot.s file code **************/
/* Sample initialization file */
.extern main
.extern exit
.extern AT91F_LowLevelInit
.extern vPortYieldProcessor
.text
.code 32
.align 0
.extern __stack_end__
.extern __bss_beg__
.extern __bss_end__
.extern __data_beg__
.extern __data_end__
.extern __data+beg_src__
.global start
.global endless_loop
/* Stack Sizes */
.set UND_STACK_SIZE, 0x00000004
.set ABT_STACK_SIZE, 0x00000004
.set FIQ_STACK_SIZE, 0x00000004
.set IRQ_STACK_SIZE, 0X00000400
.set SVC_STACK_SIZE, 0x00000400
/* Standard definitions of Mode bits and Interrupt (I & F) flags in PSRs */
.set MODE_USR, 0x10 /* User Mode */
.set MODE_FIQ, 0x11 /* FIQ Mode */
.set MODE_IRQ, 0x12 /* IRQ Mode */
.set MODE_SVC, 0x13 /* Supervisor Mode */
.set MODE_ABT, 0x17 /* Abort Mode */
.set MODE_UND, 0x1B /* Undefined Mode */
.set MODE_SYS, 0x1F /* System Mode */
.equ I_BIT, 0x80 /* when I bit is set, IRQ is disabled */
.equ F_BIT, 0x40 /* when F bit is set, FIQ is disabled */
start:
_start:
_mainCRTStartup:
/* Setup a stack for each mode - note that this only sets up a usable stack
for system/user, SWI and IRQ modes. Also each mode is setup with
interrupts initially disabled. */
ldr r0, .LC6
msr CPSR_c, #MODE_UND|I_BIT|F_BIT /* Undefined Instruction Mode */
mov sp, r0
sub r0, r0, #UND_STACK_SIZE
msr CPSR_c, #MODE_ABT|I_BIT|F_BIT /* Abort Mode */
mov sp, r0
sub r0, r0, #ABT_STACK_SIZE
msr CPSR_c, #MODE_FIQ|I_BIT|F_BIT /* FIQ Mode */
mov sp, r0
sub r0, r0, #FIQ_STACK_SIZE
msr CPSR_c, #MODE_IRQ|I_BIT|F_BIT /* IRQ Mode */
mov sp, r0
sub r0, r0, #IRQ_STACK_SIZE
msr CPSR_c, #MODE_SVC|I_BIT|F_BIT /* Supervisor Mode */
mov sp, r0
sub r0, r0, #SVC_STACK_SIZE
msr CPSR_c, #MODE_SYS|I_BIT|F_BIT /* System Mode */
mov sp, r0
/* We want to start in supervisor mode. Operation will switch to system
mode when the first task starts. */
msr CPSR_c, #MODE_SVC|I_BIT|F_BIT
bl AT91F_LowLevelInit
/* Clear BSS.
mov a2, #0 /* Fill value
mov fp, a2 /* Null frame pointer
mov r7, a2 /* Null frame pointer for Thumb
ldr r1, .LC1 /* Start of memory block
ldr r3, .LC2 /* End of memory block
subs r3, r3, r1 /* Length of block
beq .end_clear_loop
mov r2, #0
.clear_loop:
strb r2, [r1], #1
subs r3, r3, #1
bgt .clear_loop
.end_clear_loop:
/* Initialise data.
ldr r1, .LC3 /* Start of memory block
ldr r2, .LC4 /* End of memory block
ldr r3, .LC5
subs r3, r3, r1 /* Length of block
beq .end_set_loop
.set_loop:
ldrb r4, [r2], #1
strb r4, [r1], #1
subs r3, r3, #1
bgt .set_loop
.end_set_loop:
*/
/********************************************************************/
/* Clear BSS. */
mov a2, #0 /* Fill value */
mov fp, a2 /* Null frame pointer */
mov r7, a2 /* Null frame pointer for Thumb */
ldr r1, .LC1 /* Start of memory block */
ldr r3, .LC2 /* End of memory block */
subs r3, r3, r1 /* Length of block */
beq .end_clear_loop
mov r2, #0
.clear_loop:
strb r2, [r1], #1
subs r3, r3, #1
bgt .clear_loop
.end_clear_loop:
/* Initialise data. */
ldr r1, .LC3 /* Start of memory block */
ldr r2, .LC4 /* End of memory block */
ldr r3, .LC5
subs r3, r3, r1 /* Length of block */
beq .end_set_loop
.set_loop:
ldrb r4, [r2], #1
strb r4, [r1], #1
subs r3, r3, #1
bgt .set_loop
.end_set_loop:
/********************************************************************/
mov r0, #0 /* no arguments */
mov r1, #0 /* no argv either */
ldr lr, =main
bx lr
endless_loop:
b endless_loop
.align 0
.LC1:
.word __bss_beg__
.LC2:
.word __bss_end__
.LC3:
.word __data_beg__
.LC4:
.word __data_beg_src__
.LC5:
.word __data_end__
.LC6:
.word __stack_end__
/* Setup vector table. Note that undf, pabt, dabt, fiq just execute
a null loop. */
.section .startup,"ax"
.code 32
.align 0
b _start /* reset - _start */
ldr pc, _undf /* undefined - _undf */
ldr pc, _swi /* SWI - _swi */
ldr pc, _pabt /* program abort - _pabt */
ldr pc, _dabt /* data abort - _dabt */
nop /* reserved */
ldr pc, [pc,#-0xF20] /* IRQ - read the AIC */
ldr pc, _fiq /* FIQ - _fiq */
_undf: .word __undf /* undefined */
_swi: .word vPortYieldProcessor /* SWI */
_pabt: .word __pabt /* program abort */
_dabt: .word __dabt /* data abort */
_fiq: .word __fiq /* FIQ */
__undf: b . /* undefined */
__pabt: b . /* program abort */
__dabt: b . /* data abort */
__fiq: b . /* FIQ */
/**************** atmel-rom.ld code ****************/
MEMORY
{
/*
flash : ORIGIN = 0x00100000, LENGTH = 256K
ram : ORIGIN = 0x00200000, LENGTH = 64K
*/
flash : ORIGIN = 0x00100000, LENGTH = 512K
ram : ORIGIN = 0x00200000, LENGTH = 128K
}
/*
__stack_end__ = 0x00200000 + 64K - 4;
*/
__stack_end__ = 0x00200000 + 128K - 4;
SECTIONS
{
. = 0;
startup : { *(.startup)} >flash
prog :
{
*(.text)
*(.rodata)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
} >flash
__end_of_text__ = .;
.data :
{
__data_beg__ = .;
__data_beg_src__ = __end_of_text__;
*(.data)
__data_end__ = .;
} >ram AT>flash
.bss :
{
__bss_beg__ = .;
*(.bss)
} >ram
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
}
. = ALIGN(32 / 8);
_end = .;
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
PROVIDE (end = .);
/************** Makefile Code **************/
#RTOS_SOURCE_DIR=../../../Source
#DEMO_COMMON_DIR=../../Common/Minimal
#DEMO_INCLUDE_DIR=../../Common/include
#UIP_COMMON_DIR=../../Common/ethernet/uIP/uip-1.0/uip
RTOS_SOURCE_DIR=C:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Source
DEMO_COMMON_DIR=C:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/Minimal
DEMO_INCLUDE_DIR=C:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/include
SATURN_INCLUDE_DIR=C:/Eclipse_Def_WorkSpace/SATURN-II_Webserver/RTOSDemo/inc
SATURN_SOURCE_DIR=C:/Eclipse_Def_WorkSpace/SATURN-II_Webserver/RTOSDemo/src
UIP_COMMON_DIR=C:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip
CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
LDSCRIPT=atmel-rom.ld
LD = arm-elf-ld -v
CPFLAGS = --output-target=binary
ODFLAGS = -x --syms
#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker
-Map=rtosdemo.map $(OBJECTS) libm.a -mno-thumb-interwork -lm
#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker
-Map=rtosdemo.map $(OBJECTS) libm.a -mno-thumb-interwork -lc
LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker
-Map=rtosdemo.map $(OBJECTS) libm.a -lm
#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker
-Map=rtosdemo.map $(OBJECTS) libc.a libm.a libgcc.a -mno-thumb-interwork -lc
#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.out -Xlinker -M -Xlinker
-Map=rtosdemo.map $(OBJECTS) libm.a -lm
#$(OBJECTS) libc.a libm.a libgcc.a
DEBUG=-g
#OPTIM=-O3
OPTIM=-O2
CFLAGS= $(DEBUG) \
$(OPTIM) \
-T$(LDSCRIPT) \
-I . \
-I $(SATURN_INCLUDE_DIR) \
-I $(RTOS_SOURCE_DIR)/include \
-I $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S \
-I $(DEMO_INCLUDE_DIR) \
-I ./webserver \
-I $(UIP_COMMON_DIR) \
-I ./SrcAtmel \
-I ./USB \
-D SAM7_GCC \
-D THUMB_INTERWORK \
-mcpu=arm7tdmi \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) \
-fomit-frame-pointer \
-mthumb-interwork
THUMB_SOURCE= \
main.c \
./ParTest/ParTest.c \
$(DEMO_COMMON_DIR)/BlockQ.c \
$(DEMO_COMMON_DIR)/blocktim.c \
$(DEMO_COMMON_DIR)/flash.c \
$(DEMO_COMMON_DIR)/integer.c \
$(DEMO_COMMON_DIR)/GenQTest.c \
$(DEMO_COMMON_DIR)/QPeek.c \
$(DEMO_COMMON_DIR)/dynamic.c \
./webserver/uIP_Task.c \
./webserver/httpd.c \
./webserver/httpd-cgi.c \
./webserver/httpd-fs.c \
./webserver/http-strings.c \
$(UIP_COMMON_DIR)/uip_arp.c \
$(UIP_COMMON_DIR)/psock.c \
$(UIP_COMMON_DIR)/timer.c \
$(UIP_COMMON_DIR)/uip.c \
$(RTOS_SOURCE_DIR)/list.c \
$(RTOS_SOURCE_DIR)/queue.c \
$(RTOS_SOURCE_DIR)/tasks.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/port.c \
$(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
./USB/USBSample.c
#./webserver/SAM7_EMAC.c \
ARM_SOURCE= \
enc28j60.c \
$(SATURN_SOURCE_DIR)/initSystem.c \
$(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/portISR.c \
./webserver/emac_isr.c \
./SrcAtmel/Cstartup_SAM7.c \
./USB/USB_ISR.c \
# $(SATURN_SOURCE_DIR)/Global_Var.c \
# $(SATURN_SOURCE_DIR)/Relay.c \
# $(SATURN_SOURCE_DIR)/AT45DB_Flash.c \
# $(SATURN_SOURCE_DIR)/i2c_devices.c \
# $(SATURN_SOURCE_DIR)/cs5463.c \
# $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
# $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
# $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
# $(SATURN_SOURCE_DIR)/cs5463.c \
# $(SATURN_SOURCE_DIR)/i2c_devices.c \
# $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
# ./src/timerisr.c \
# ./src/timersetup.c \
# ./src/isrsupport.c \
# ./src/lowlevelinit.c \
# ./src/blinker.c \
# ./src/Relay.c \
# ./src/TFT_TouchScreen.c \
# ./src/Global_Var.c \
# ./src/i2c_devices.c \
# ./src/AT45DB_Flash.c \
# ./src/cs5463.c \
# ./src/int_isr.c \
# ./src/Alarm_PF_Control.c \
# ./src/modbus_485.c \
# ./src/cdc_enumerate.c \
# ./src/main.c \
THUMB_OBJS = $(THUMB_SOURCE:.c=.o)
ARM_OBJS = $(ARM_SOURCE:.c=.o)
all: RTOSDemo.bin
#all: RTOSDemo.out RTOSDemo.bin
# @ echo "...copying"
# $(arm-elf-objcopy) $(--output-target=binary) RTOSDemo.out RTOSDemo.bin
# $(OD) $(ODFLAGS) main.out > main.dmp
# $(arm-elf-ld -v) $(LINKER_FLAGS) -o RTOSDemo.out RTOSDemo.bin
RTOSDemo.bin : RTOSDemo.hex
$(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin
RTOSDemo.hex : RTOSDemo.elf
$(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
#RTOSDemo.out : $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
# $(arm-elf-objcopy) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
#RTOSDemo.out : RTOSDemo.elf
# $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.out
# LINKER_FLAGS
#all: RTOSDemo.out
# @ echo "...copying"
# $(CP) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
# $(OD) $(ODFLAGS) RTOSDemo.out > RTOSDemo.dmp
#RTOSDemo.out: $(THUMB_OBJS) $(ARM_OBJS) atmel-rom.ld
# @ echo "..linking"
# $(LD) $(LFLAGS) -o main.out $(OBJECTS) libc.a libm.a libgcc.a
# $(LD) $(LINKER_FLAGS) -o RTOSDemo.out
#RTOSDemo.out : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
# $(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s $(LINKER_FLAGS)
RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
$(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s $(LINKER_FLAGS)
$(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) -mthumb $< -o $@
$(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@
clean :
rm $(THUMB_OBJS)
rm $(ARM_OBJS)
touch Makefile
rm RTOSDemo.elf
rm RTOSDemo.bin
rm RTOSDemo.hex
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
RE: FreeRTOS with AT91SAM7x512 - FreeRTOS info - May 29 3:31:21 2009
I see you have updated the linker script to be correct for the part with th=
e
larger memory. I don't think there should be any other changes necessary,
so if the rest of the code is the same (startup file, makefile, etc.) then
you should be ok, but evidently no.
How are you programming the flash? Are you using a bootloader or remapping
the vector table?
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.
+ http://www.SafeRTOS.com
Certified by T=DCV as meeting the requirements for safety related systems.
=20=20
> -----Original Message-----
> From: A...@yahoogroups.com=20
> [mailto:A...@yahoogroups.com] On Behalf Of bhavintailor_ec
> Sent: 29 May 2009 05:56
> To: A...@yahoogroups.com
> Subject: [AT91SAM] FreeRTOS with AT91SAM7x512
>=20
>=20
>=20
> I am using YAGARTO Tool to compile my project based on=20
> AT91SAM7X512. I have developed one project without RTOS. Its=20
> code size become higher than 265K and ram size around 64K. It=20
> works Ok. Now, i want to add TCP/IP. So, that i first make=20
> working webserver on my hardware. The TCP/IP Stack which i=20
> have used is for AT91SAM7X256. So, i modified every where=20
> with AT91SAM7X512 header file with its flash and ram size.=20
> The stack which i have used is based on uIP with FreeRTOS.=20
> Currently this webserver is working ok. This stack size=20
> around 80K. Now, as i mearge this STACK (based on FreeRTOS)=20
> with my previous developed project, it stop working after=20
> total code size become higher than 265K. I am just adding=20
> code. I m not calling any function. As i remove some=20
> functions code and as code size less than 264K then it works=20
> ok but as it reach limit of 265K, webserver code stop=20
> working. I think this problem is created either by STARTUP=20
> File or some makefile command which limit code to=20
> AT91SAM7X256 flash size. So, How can i remove this problem ?=20
> For refrence i have added below code of boot.s, atmel-rom.ld=20
> & Makefile.
> /************** boot.s file code **************/
> /* Sample initialization file */
>=20
> .extern main
> .extern exit
> .extern AT91F_LowLevelInit
> .extern vPortYieldProcessor
>=20
> .text
> .code 32
>=20
> .align 0
>=20
> .extern __stack_end__
> .extern __bss_beg__
> .extern __bss_end__
> .extern __data_beg__
> .extern __data_end__
> .extern __data+beg_src__
>=20
> .global start
> .global endless_loop
>=20
> /* Stack Sizes */
> .set UND_STACK_SIZE, 0x00000004
> .set ABT_STACK_SIZE, 0x00000004
> .set FIQ_STACK_SIZE, 0x00000004
> .set IRQ_STACK_SIZE, 0X00000400
> .set SVC_STACK_SIZE, 0x00000400
>=20
> /* Standard definitions of Mode bits and Interrupt (I & F)=20
> flags in PSRs */
> .set MODE_USR, 0x10 /* User Mode */
> .set MODE_FIQ, 0x11 /* FIQ Mode */
> .set MODE_IRQ, 0x12 /* IRQ Mode */
> .set MODE_SVC, 0x13 /* Supervisor Mode */
> .set MODE_ABT, 0x17 /* Abort Mode */
> .set MODE_UND, 0x1B /* Undefined Mode */
> .set MODE_SYS, 0x1F /* System Mode */
>=20
> .equ I_BIT, 0x80 /* when I bit is set, IRQ is disabled */
> .equ F_BIT, 0x40 /* when F bit is set, FIQ is disabled */
>=20
> start:
> _start:
> _mainCRTStartup:
>=20
> /* Setup a stack for each mode - note that this only sets up=20
> a usable stack
> for system/user, SWI and IRQ modes. Also each mode is setup with
> interrupts initially disabled. */
> ldr r0, .LC6
> msr CPSR_c, #MODE_UND|I_BIT|F_BIT /* Undefined Instruction Mode */
> mov sp, r0
> sub r0, r0, #UND_STACK_SIZE
> msr CPSR_c, #MODE_ABT|I_BIT|F_BIT /* Abort Mode */
> mov sp, r0
> sub r0, r0, #ABT_STACK_SIZE
> msr CPSR_c, #MODE_FIQ|I_BIT|F_BIT /* FIQ Mode */
> mov sp, r0
> sub r0, r0, #FIQ_STACK_SIZE
> msr CPSR_c, #MODE_IRQ|I_BIT|F_BIT /* IRQ Mode */
> mov sp, r0
> sub r0, r0, #IRQ_STACK_SIZE
> msr CPSR_c, #MODE_SVC|I_BIT|F_BIT /* Supervisor Mode */
> mov sp, r0
> sub r0, r0, #SVC_STACK_SIZE
> msr CPSR_c, #MODE_SYS|I_BIT|F_BIT /* System Mode */
> mov sp, r0
>=20
> /* We want to start in supervisor mode. Operation will switch=20
> to system
> mode when the first task starts. */
> msr CPSR_c, #MODE_SVC|I_BIT|F_BIT
>=20
> bl AT91F_LowLevelInit
>=20
> /* Clear BSS.=20
>=20
> mov a2, #0 /* Fill value=20
> mov fp, a2 /* Null frame pointer=20
> mov r7, a2 /* Null frame pointer for Thumb=20
>=20
> ldr r1, .LC1 /* Start of memory block=20
> ldr r3, .LC2 /* End of memory block=20
> subs r3, r3, r1 /* Length of block=20
> beq .end_clear_loop
> mov r2, #0
>=20
> .clear_loop:
> strb r2, [r1], #1=20
> subs r3, r3, #1
> bgt .clear_loop
>=20
> .end_clear_loop:
>=20
> /* Initialise data.=20
>=20
> ldr r1, .LC3 /* Start of memory block=20
> ldr r2, .LC4 /* End of memory block=20
> ldr r3, .LC5
> subs r3, r3, r1 /* Length of block=20
> beq .end_set_loop
>=20
> .set_loop:
> ldrb r4, [r2], #1
> strb r4, [r1], #1
> subs r3, r3, #1
> bgt .set_loop
>=20
> .end_set_loop:
> */
> /********************************************************************/
> /* Clear BSS. */
>=20
> mov a2, #0 /* Fill value */
> mov fp, a2 /* Null frame pointer */
> mov r7, a2 /* Null frame pointer for Thumb */
>=20
> ldr r1, .LC1 /* Start of memory block */
> ldr r3, .LC2 /* End of memory block */
> subs r3, r3, r1 /* Length of block */
> beq .end_clear_loop
> mov r2, #0
>=20
> .clear_loop:
> strb r2, [r1], #1=20
> subs r3, r3, #1
> bgt .clear_loop
>=20
> .end_clear_loop:
>=20
> /* Initialise data. */
>=20
> ldr r1, .LC3 /* Start of memory block */
> ldr r2, .LC4 /* End of memory block */
> ldr r3, .LC5
> subs r3, r3, r1 /* Length of block */
> beq .end_set_loop
>=20
> .set_loop:
> ldrb r4, [r2], #1
> strb r4, [r1], #1
> subs r3, r3, #1
> bgt .set_loop
>=20
> .end_set_loop:
>=20
> /********************************************************************/
> mov r0, #0 /* no arguments */
> mov r1, #0 /* no argv either */
>=20
> ldr lr, =3Dmain=20
> bx lr
>=20
> endless_loop:
> b endless_loop
>=20
> .align 0
>=20
> .LC1:
> .word __bss_beg__
> .LC2:
> .word __bss_end__
> .LC3:
> .word __data_beg__
> .LC4:
> .word __data_beg_src__
> .LC5:
> .word __data_end__
> .LC6:
> .word __stack_end__
>=20
> /* Setup vector table. Note that undf, pabt, dabt, fiq just execute
> a null loop. */
>=20
> .section .startup,"ax"
> .code 32
> .align 0
>=20
> b _start /* reset - _start */
> ldr pc, _undf /* undefined - _undf */
> ldr pc, _swi /* SWI - _swi */
> ldr pc, _pabt /* program abort - _pabt */
> ldr pc, _dabt /* data abort - _dabt */
> nop /* reserved */
> ldr pc, [pc,#-0xF20] /* IRQ - read the AIC */
> ldr pc, _fiq /* FIQ - _fiq */
>=20
> _undf: .word __undf /* undefined */
> _swi: .word vPortYieldProcessor /* SWI */
> _pabt: .word __pabt /* program abort */
> _dabt: .word __dabt /* data abort */
> _fiq: .word __fiq /* FIQ */
>=20
> __undf: b . /* undefined */
> __pabt: b . /* program abort */
> __dabt: b . /* data abort */
> __fiq: b . /* FIQ */
> /**************** atmel-rom.ld code ****************/
> MEMORY=20
> {
> /*
> flash : ORIGIN =3D 0x00100000, LENGTH =3D 256K
> ram : ORIGIN =3D 0x00200000, LENGTH =3D 64K
> */=20
> flash : ORIGIN =3D 0x00100000, LENGTH =3D 512K
> ram : ORIGIN =3D 0x00200000, LENGTH =3D 128K
> }
> /*
> __stack_end__ =3D 0x00200000 + 64K - 4;
> */
> __stack_end__ =3D 0x00200000 + 128K - 4;
>=20
> SECTIONS=20
> {
> . =3D 0;
> startup : { *(.startup)} >flash
>=20
> prog :=20
> {
> *(.text)
> *(.rodata)
> *(.rodata*)
> *(.glue_7)
> *(.glue_7t)
> } >flash
>=20
> __end_of_text__ =3D .;
>=20
> .data :=20
> {
> __data_beg__ =3D .;
> __data_beg_src__ =3D __end_of_text__;
> *(.data)
> __data_end__ =3D .;
> } >ram AT>flash
>=20
> .bss :=20
> {
> __bss_beg__ =3D .;
> *(.bss)
> } >ram
>=20
> /* Align here to ensure that the .bss section occupies space up to
> _end. Align after .bss to ensure correct alignment even if the
> .bss section disappears because there are no input sections. */
> . =3D ALIGN(32 / 8);
> }
> . =3D ALIGN(32 / 8);
> _end =3D .;
> _bss_end__ =3D . ; __bss_end__ =3D . ; __end__ =3D . ;
> PROVIDE (end =3D .);
>=20
> /************** Makefile Code **************/
>=20
> #RTOS_SOURCE_DIR=3D../../../Source
> #DEMO_COMMON_DIR=3D../../Common/Minimal
> #DEMO_INCLUDE_DIR=3D../../Common/include
> #UIP_COMMON_DIR=3D../../Common/ethernet/uIP/uip-1.0/uip
>=20
> RTOS_SOURCE_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Source
> DEMO_COMMON_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/Minimal
> DEMO_INCLUDE_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Commo
> n/include
> SATURN_INCLUDE_DIR=3DC:/Eclipse_Def_WorkSpace/SATURN-II_Webserve
r/RTOSDemo/inc
> SATURN_SOURCE_DIR=3DC:/Eclipse_Def_WorkSpace/SATURN-II_Webserver
/RTOSDemo/src
> UIP_COMMON_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/
> ethernet/uIP/uip-1.0/uip
>=20
> CC=3Darm-elf-gcc
> OBJCOPY=3Darm-elf-objcopy
> LDSCRIPT=3Datmel-rom.ld
> LD =3D arm-elf-ld -v
>=20
> CPFLAGS =3D --output-target=3Dbinary
> ODFLAGS =3D -x --syms
> #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a=20
> -mno-thumb-interwork -lm
> #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a=20
> -mno-thumb-interwork -lc
> LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a -lm
> #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libc.a=20
> libm.a libgcc.a -mno-thumb-interwork -lc
> #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.out=20
> -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a -lm
>=20
> #$(OBJECTS) libc.a libm.a libgcc.a
>=20
> DEBUG=3D-g
> #OPTIM=3D-O3
> OPTIM=3D-O2
>=20
> CFLAGS=3D $(DEBUG) \
> $(OPTIM) \
> -T$(LDSCRIPT) \
> -I . \
> -I $(SATURN_INCLUDE_DIR) \
> -I $(RTOS_SOURCE_DIR)/include \
> -I $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S \
> -I $(DEMO_INCLUDE_DIR) \
> -I ./webserver \
> -I $(UIP_COMMON_DIR) \
> -I ./SrcAtmel \
> -I ./USB \
> -D SAM7_GCC \
> -D THUMB_INTERWORK \
> -mcpu=3Darm7tdmi \
> -D PACK_STRUCT_END=3D__attribute\(\(packed\)\) \
> -D ALIGN_STRUCT_END=3D__attribute\(\(aligned\(4\)\)\) \
> -fomit-frame-pointer \
> -mthumb-interwork
>=20
> THUMB_SOURCE=3D \
> main.c \
> ./ParTest/ParTest.c \
> $(DEMO_COMMON_DIR)/BlockQ.c \
> $(DEMO_COMMON_DIR)/blocktim.c \
> $(DEMO_COMMON_DIR)/flash.c \
> $(DEMO_COMMON_DIR)/integer.c \
> $(DEMO_COMMON_DIR)/GenQTest.c \
> $(DEMO_COMMON_DIR)/QPeek.c \
> $(DEMO_COMMON_DIR)/dynamic.c \
> ./webserver/uIP_Task.c \
> ./webserver/httpd.c \
> ./webserver/httpd-cgi.c \
> ./webserver/httpd-fs.c \
> ./webserver/http-strings.c \
> $(UIP_COMMON_DIR)/uip_arp.c \
> $(UIP_COMMON_DIR)/psock.c \
> $(UIP_COMMON_DIR)/timer.c \
> $(UIP_COMMON_DIR)/uip.c \
> $(RTOS_SOURCE_DIR)/list.c \
> $(RTOS_SOURCE_DIR)/queue.c \
> $(RTOS_SOURCE_DIR)/tasks.c \
> $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/port.c \
> $(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
> ./USB/USBSample.c
>=20
> #./webserver/SAM7_EMAC.c \
>=20
> ARM_SOURCE=3D \
> enc28j60.c \
> $(SATURN_SOURCE_DIR)/initSystem.c \
> $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
> $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/portISR.c \
> ./webserver/emac_isr.c \
> ./SrcAtmel/Cstartup_SAM7.c \
> ./USB/USB_ISR.c \
>=20
>=20
> # $(SATURN_SOURCE_DIR)/Global_Var.c \
> # $(SATURN_SOURCE_DIR)/Relay.c \
> # $(SATURN_SOURCE_DIR)/AT45DB_Flash.c \
> # $(SATURN_SOURCE_DIR)/i2c_devices.c \
> # $(SATURN_SOURCE_DIR)/cs5463.c \
> # $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
> # $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
>=20
>=20
> # $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
> # $(SATURN_SOURCE_DIR)/cs5463.c \
> # $(SATURN_SOURCE_DIR)/i2c_devices.c \
> # $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
>=20
>=20
> # ./src/timerisr.c \
> # ./src/timersetup.c \
> # ./src/isrsupport.c \
> # ./src/lowlevelinit.c \
> # ./src/blinker.c \
> # ./src/Relay.c \
> # ./src/TFT_TouchScreen.c \
> # ./src/Global_Var.c \
> # ./src/i2c_devices.c \
> # ./src/AT45DB_Flash.c \
> # ./src/cs5463.c \
> # ./src/int_isr.c \
> # ./src/Alarm_PF_Control.c \
> # ./src/modbus_485.c \
> # ./src/cdc_enumerate.c \
> # ./src/main.c \
>=20
> THUMB_OBJS =3D $(THUMB_SOURCE:.c=3D.o)
> ARM_OBJS =3D $(ARM_SOURCE:.c=3D.o)
>=20
> all: RTOSDemo.bin
>=20
> #all: RTOSDemo.out RTOSDemo.bin
> # @ echo "...copying"
> # $(arm-elf-objcopy) $(--output-target=3Dbinary) RTOSDemo.out=20
> RTOSDemo.bin
> # $(OD) $(ODFLAGS) main.out > main.dmp
> # $(arm-elf-ld -v) $(LINKER_FLAGS) -o RTOSDemo.out RTOSDemo.bin
>=20
> RTOSDemo.bin : RTOSDemo.hex
> $(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin=20
>=20
> RTOSDemo.hex : RTOSDemo.elf
> $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
>=20
> #RTOSDemo.out : $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
> # $(arm-elf-objcopy) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
>=20
> #RTOSDemo.out : RTOSDemo.elf
> # $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.out
> # LINKER_FLAGS
>=20
> #all: RTOSDemo.out
> # @ echo "...copying"
> # $(CP) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
> # $(OD) $(ODFLAGS) RTOSDemo.out > RTOSDemo.dmp
>=20
> #RTOSDemo.out: $(THUMB_OBJS) $(ARM_OBJS) atmel-rom.ld
> # @ echo "..linking"
> # $(LD) $(LFLAGS) -o main.out $(OBJECTS) libc.a libm.a libgcc.a
> # $(LD) $(LINKER_FLAGS) -o RTOSDemo.out
>=20
> #RTOSDemo.out : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
> # $(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s=20
> $(LINKER_FLAGS)=20
>=20
> RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
> $(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s=20
> $(LINKER_FLAGS)=20
>=20
> $(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
> $(CC) -c $(CFLAGS) -mthumb $< -o $@
>=20
> $(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
> $(CC) -c $(CFLAGS) $< -o $@
>=20
> clean :
> rm $(THUMB_OBJS)
> rm $(ARM_OBJS)
> touch Makefile
> rm RTOSDemo.elf
> rm RTOSDemo.bin
> rm RTOSDemo.hex
>=20
>=20
>=20
>=20
>=20
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: FreeRTOS with AT91SAM7x512 - bhavintailor_ec - Jun 2 8:07:07 2009
I am programming the AT91SAM7x512 using SAM-BA 2.6. After programming the f=
lash I program "BOOT FROM FLASH (GPNVM2)" by click on EXECUTE Command Butto=
n. I think SAM-BA don't have problem. Because my main project size is aroun=
d 267K. Which is ARM Mode base execution. I can run this thing without any =
problem. Now, my purpose is to merge TCP/IP stack (based on FreeRTOS) with =
my code. So, after merging both code it will reach 267K + 80K > 265K. Becau=
se in FreeRTOS base as my code size increase after 265K it stop working.
And other problem I m facing with web server. I have modified uIP st=
ack to run with ENC28J60. In original stack it is using on chip Ethernet mo=
dule. But in my hardware I don't have sufficient i/o so that I have used EN=
C28J60. In original stack, in uip-conf.h file there is=20
#define UIP_CONF_BUFFER_SIZE 1480
for size of long buffer. I need to change this to start webserver. If I do=
n't change this size then I can ping my hardware but I cant run webpage. To=
, make working web server I have to do
#define UIP_CONF_BUFFER_SIZE 65600
This is actually RAM wasting. But without this I am not able to run webpag=
e. I don't think that in run time this much large buffer size required. Bec=
ause in run time around 10 to 20 COMPUTER will be connected with my hardwar=
e through LAN or INTERNET. So, by increasing buffer size I can run my webpa=
ge. But I need to solve this thing because it is consuming RAM which will n=
ot require at run time.
--- In A...@yahoogroups.com, "FreeRTOS info"
wrote:
>
> I see you have updated the linker script to be correct for the part with =
the
> larger memory. I don't think there should be any other changes necessary=
,
> so if the rest of the code is the same (startup file, makefile, etc.) the=
n
> you should be ok, but evidently no.
>=20
> How are you programming the flash? Are you using a bootloader or remappi=
ng
> the vector table?
>=20
> Regards,
> Richard.
>=20
> + http://www.FreeRTOS.org
> Designed for Microcontrollers. More than 7000 downloads per month.
>=20
> + http://www.SafeRTOS.com
> Certified by T=DCV as meeting the requirements for safety related systems=
.
>=20
>=20
>=20
>=20
>=20
>=20=20=20
>=20
> > -----Original Message-----
> > From: A...@yahoogroups.com=20
> > [mailto:A...@yahoogroups.com] On Behalf Of bhavintailor_ec
> > Sent: 29 May 2009 05:56
> > To: A...@yahoogroups.com
> > Subject: [AT91SAM] FreeRTOS with AT91SAM7x512
> >=20
> >=20
> >=20
> > I am using YAGARTO Tool to compile my project based on=20
> > AT91SAM7X512. I have developed one project without RTOS. Its=20
> > code size become higher than 265K and ram size around 64K. It=20
> > works Ok. Now, i want to add TCP/IP. So, that i first make=20
> > working webserver on my hardware. The TCP/IP Stack which i=20
> > have used is for AT91SAM7X256. So, i modified every where=20
> > with AT91SAM7X512 header file with its flash and ram size.=20
> > The stack which i have used is based on uIP with FreeRTOS.=20
> > Currently this webserver is working ok. This stack size=20
> > around 80K. Now, as i mearge this STACK (based on FreeRTOS)=20
> > with my previous developed project, it stop working after=20
> > total code size become higher than 265K. I am just adding=20
> > code. I m not calling any function. As i remove some=20
> > functions code and as code size less than 264K then it works=20
> > ok but as it reach limit of 265K, webserver code stop=20
> > working. I think this problem is created either by STARTUP=20
> > File or some makefile command which limit code to=20
> > AT91SAM7X256 flash size. So, How can i remove this problem ?=20
> > For refrence i have added below code of boot.s, atmel-rom.ld=20
> > & Makefile.
> > /************** boot.s file code **************/
> > /* Sample initialization file */
> >=20
> > .extern main
> > .extern exit
> > .extern AT91F_LowLevelInit
> > .extern vPortYieldProcessor
> >=20
> > .text
> > .code 32
> >=20
> > .align 0
> >=20
> > .extern __stack_end__
> > .extern __bss_beg__
> > .extern __bss_end__
> > .extern __data_beg__
> > .extern __data_end__
> > .extern __data+beg_src__
> >=20
> > .global start
> > .global endless_loop
> >=20
> > /* Stack Sizes */
> > .set UND_STACK_SIZE, 0x00000004
> > .set ABT_STACK_SIZE, 0x00000004
> > .set FIQ_STACK_SIZE, 0x00000004
> > .set IRQ_STACK_SIZE, 0X00000400
> > .set SVC_STACK_SIZE, 0x00000400
> >=20
> > /* Standard definitions of Mode bits and Interrupt (I & F)=20
> > flags in PSRs */
> > .set MODE_USR, 0x10 /* User Mode */
> > .set MODE_FIQ, 0x11 /* FIQ Mode */
> > .set MODE_IRQ, 0x12 /* IRQ Mode */
> > .set MODE_SVC, 0x13 /* Supervisor Mode */
> > .set MODE_ABT, 0x17 /* Abort Mode */
> > .set MODE_UND, 0x1B /* Undefined Mode */
> > .set MODE_SYS, 0x1F /* System Mode */
> >=20
> > .equ I_BIT, 0x80 /* when I bit is set, IRQ is disabled */
> > .equ F_BIT, 0x40 /* when F bit is set, FIQ is disabled */
> >=20
> > start:
> > _start:
> > _mainCRTStartup:
> >=20
> > /* Setup a stack for each mode - note that this only sets up=20
> > a usable stack
> > for system/user, SWI and IRQ modes. Also each mode is setup with
> > interrupts initially disabled. */
> > ldr r0, .LC6
> > msr CPSR_c, #MODE_UND|I_BIT|F_BIT /* Undefined Instruction Mode */
> > mov sp, r0
> > sub r0, r0, #UND_STACK_SIZE
> > msr CPSR_c, #MODE_ABT|I_BIT|F_BIT /* Abort Mode */
> > mov sp, r0
> > sub r0, r0, #ABT_STACK_SIZE
> > msr CPSR_c, #MODE_FIQ|I_BIT|F_BIT /* FIQ Mode */
> > mov sp, r0
> > sub r0, r0, #FIQ_STACK_SIZE
> > msr CPSR_c, #MODE_IRQ|I_BIT|F_BIT /* IRQ Mode */
> > mov sp, r0
> > sub r0, r0, #IRQ_STACK_SIZE
> > msr CPSR_c, #MODE_SVC|I_BIT|F_BIT /* Supervisor Mode */
> > mov sp, r0
> > sub r0, r0, #SVC_STACK_SIZE
> > msr CPSR_c, #MODE_SYS|I_BIT|F_BIT /* System Mode */
> > mov sp, r0
> >=20
> > /* We want to start in supervisor mode. Operation will switch=20
> > to system
> > mode when the first task starts. */
> > msr CPSR_c, #MODE_SVC|I_BIT|F_BIT
> >=20
> > bl AT91F_LowLevelInit
> >=20
> > /* Clear BSS.=20
> >=20
> > mov a2, #0 /* Fill value=20
> > mov fp, a2 /* Null frame pointer=20
> > mov r7, a2 /* Null frame pointer for Thumb=20
> >=20
> > ldr r1, .LC1 /* Start of memory block=20
> > ldr r3, .LC2 /* End of memory block=20
> > subs r3, r3, r1 /* Length of block=20
> > beq .end_clear_loop
> > mov r2, #0
> >=20
> > .clear_loop:
> > strb r2, [r1], #1=20
> > subs r3, r3, #1
> > bgt .clear_loop
> >=20
> > .end_clear_loop:
> >=20
> > /* Initialise data.=20
> >=20
> > ldr r1, .LC3 /* Start of memory block=20
> > ldr r2, .LC4 /* End of memory block=20
> > ldr r3, .LC5
> > subs r3, r3, r1 /* Length of block=20
> > beq .end_set_loop
> >=20
> > .set_loop:
> > ldrb r4, [r2], #1
> > strb r4, [r1], #1
> > subs r3, r3, #1
> > bgt .set_loop
> >=20
> > .end_set_loop:
> > */
> > /********************************************************************/
> > /* Clear BSS. */
> >=20
> > mov a2, #0 /* Fill value */
> > mov fp, a2 /* Null frame pointer */
> > mov r7, a2 /* Null frame pointer for Thumb */
> >=20
> > ldr r1, .LC1 /* Start of memory block */
> > ldr r3, .LC2 /* End of memory block */
> > subs r3, r3, r1 /* Length of block */
> > beq .end_clear_loop
> > mov r2, #0
> >=20
> > .clear_loop:
> > strb r2, [r1], #1=20
> > subs r3, r3, #1
> > bgt .clear_loop
> >=20
> > .end_clear_loop:
> >=20
> > /* Initialise data. */
> >=20
> > ldr r1, .LC3 /* Start of memory block */
> > ldr r2, .LC4 /* End of memory block */
> > ldr r3, .LC5
> > subs r3, r3, r1 /* Length of block */
> > beq .end_set_loop
> >=20
> > .set_loop:
> > ldrb r4, [r2], #1
> > strb r4, [r1], #1
> > subs r3, r3, #1
> > bgt .set_loop
> >=20
> > .end_set_loop:
> >=20
> > /********************************************************************/
> > mov r0, #0 /* no arguments */
> > mov r1, #0 /* no argv either */
> >=20
> > ldr lr, =3Dmain=20
> > bx lr
> >=20
> > endless_loop:
> > b endless_loop
> >=20
> > .align 0
> >=20
> > .LC1:
> > .word __bss_beg__
> > .LC2:
> > .word __bss_end__
> > .LC3:
> > .word __data_beg__
> > .LC4:
> > .word __data_beg_src__
> > .LC5:
> > .word __data_end__
> > .LC6:
> > .word __stack_end__
> >=20
> > /* Setup vector table. Note that undf, pabt, dabt, fiq just execute
> > a null loop. */
> >=20
> > .section .startup,"ax"
> > .code 32
> > .align 0
> >=20
> > b _start /* reset - _start */
> > ldr pc, _undf /* undefined - _undf */
> > ldr pc, _swi /* SWI - _swi */
> > ldr pc, _pabt /* program abort - _pabt */
> > ldr pc, _dabt /* data abort - _dabt */
> > nop /* reserved */
> > ldr pc, [pc,#-0xF20] /* IRQ - read the AIC */
> > ldr pc, _fiq /* FIQ - _fiq */
> >=20
> > _undf: .word __undf /* undefined */
> > _swi: .word vPortYieldProcessor /* SWI */
> > _pabt: .word __pabt /* program abort */
> > _dabt: .word __dabt /* data abort */
> > _fiq: .word __fiq /* FIQ */
> >=20
> > __undf: b . /* undefined */
> > __pabt: b . /* program abort */
> > __dabt: b . /* data abort */
> > __fiq: b . /* FIQ */
> > /**************** atmel-rom.ld code ****************/
> > MEMORY=20
> > {
> > /*
> > flash : ORIGIN =3D 0x00100000, LENGTH =3D 256K
> > ram : ORIGIN =3D 0x00200000, LENGTH =3D 64K
> > */=20
> > flash : ORIGIN =3D 0x00100000, LENGTH =3D 512K
> > ram : ORIGIN =3D 0x00200000, LENGTH =3D 128K
> > }
> > /*
> > __stack_end__ =3D 0x00200000 + 64K - 4;
> > */
> > __stack_end__ =3D 0x00200000 + 128K - 4;
> >=20
> > SECTIONS=20
> > {
> > . =3D 0;
> > startup : { *(.startup)} >flash
> >=20
> > prog :=20
> > {
> > *(.text)
> > *(.rodata)
> > *(.rodata*)
> > *(.glue_7)
> > *(.glue_7t)
> > } >flash
> >=20
> > __end_of_text__ =3D .;
> >=20
> > .data :=20
> > {
> > __data_beg__ =3D .;
> > __data_beg_src__ =3D __end_of_text__;
> > *(.data)
> > __data_end__ =3D .;
> > } >ram AT>flash
> >=20
> > .bss :=20
> > {
> > __bss_beg__ =3D .;
> > *(.bss)
> > } >ram
> >=20
> > /* Align here to ensure that the .bss section occupies space up to
> > _end. Align after .bss to ensure correct alignment even if the
> > .bss section disappears because there are no input sections. */
> > . =3D ALIGN(32 / 8);
> > }
> > . =3D ALIGN(32 / 8);
> > _end =3D .;
> > _bss_end__ =3D . ; __bss_end__ =3D . ; __end__ =3D . ;
> > PROVIDE (end =3D .);
> >=20
> > /************** Makefile Code **************/
> >=20
> > #RTOS_SOURCE_DIR=3D../../../Source
> > #DEMO_COMMON_DIR=3D../../Common/Minimal
> > #DEMO_INCLUDE_DIR=3D../../Common/include
> > #UIP_COMMON_DIR=3D../../Common/ethernet/uIP/uip-1.0/uip
> >=20
> > RTOS_SOURCE_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Source
> > DEMO_COMMON_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/Minima=
l
> > DEMO_INCLUDE_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Commo
> > n/include
> > SATURN_INCLUDE_DIR=3DC:/Eclipse_Def_WorkSpace/SATURN-II_Webserve
> r/RTOSDemo/inc
> > SATURN_SOURCE_DIR=3DC:/Eclipse_Def_WorkSpace/SATURN-II_Webserver
> /RTOSDemo/src
> > UIP_COMMON_DIR=3DC:/pdf/ARM/FreeRTOSV4.7.0/FreeRTOS/Demo/Common/
> > ethernet/uIP/uip-1.0/uip
> >=20
> > CC=3Darm-elf-gcc
> > OBJCOPY=3Darm-elf-objcopy
> > LDSCRIPT=3Datmel-rom.ld
> > LD =3D arm-elf-ld -v
> >=20
> > CPFLAGS =3D --output-target=3Dbinary
> > ODFLAGS =3D -x --syms
> > #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> > -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a=20
> > -mno-thumb-interwork -lm
> > #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> > -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a=20
> > -mno-thumb-interwork -lc
> > LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> > -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a -lm
> > #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf=20
> > -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libc.a=20
> > libm.a libgcc.a -mno-thumb-interwork -lc
> > #LINKER_FLAGS=3D-mthumb -nostartfiles -Xlinker -oRTOSDemo.out=20
> > -Xlinker -M -Xlinker -Map=3Drtosdemo.map $(OBJECTS) libm.a -lm
> >=20
> > #$(OBJECTS) libc.a libm.a libgcc.a
> >=20
> > DEBUG=3D-g
> > #OPTIM=3D-O3
> > OPTIM=3D-O2
> >=20
> > CFLAGS=3D $(DEBUG) \
> > $(OPTIM) \
> > -T$(LDSCRIPT) \
> > -I . \
> > -I $(SATURN_INCLUDE_DIR) \
> > -I $(RTOS_SOURCE_DIR)/include \
> > -I $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S \
> > -I $(DEMO_INCLUDE_DIR) \
> > -I ./webserver \
> > -I $(UIP_COMMON_DIR) \
> > -I ./SrcAtmel \
> > -I ./USB \
> > -D SAM7_GCC \
> > -D THUMB_INTERWORK \
> > -mcpu=3Darm7tdmi \
> > -D PACK_STRUCT_END=3D__attribute\(\(packed\)\) \
> > -D ALIGN_STRUCT_END=3D__attribute\(\(aligned\(4\)\)\) \
> > -fomit-frame-pointer \
> > -mthumb-interwork
> >=20
> > THUMB_SOURCE=3D \
> > main.c \
> > ./ParTest/ParTest.c \
> > $(DEMO_COMMON_DIR)/BlockQ.c \
> > $(DEMO_COMMON_DIR)/blocktim.c \
> > $(DEMO_COMMON_DIR)/flash.c \
> > $(DEMO_COMMON_DIR)/integer.c \
> > $(DEMO_COMMON_DIR)/GenQTest.c \
> > $(DEMO_COMMON_DIR)/QPeek.c \
> > $(DEMO_COMMON_DIR)/dynamic.c \
> > ./webserver/uIP_Task.c \
> > ./webserver/httpd.c \
> > ./webserver/httpd-cgi.c \
> > ./webserver/httpd-fs.c \
> > ./webserver/http-strings.c \
> > $(UIP_COMMON_DIR)/uip_arp.c \
> > $(UIP_COMMON_DIR)/psock.c \
> > $(UIP_COMMON_DIR)/timer.c \
> > $(UIP_COMMON_DIR)/uip.c \
> > $(RTOS_SOURCE_DIR)/list.c \
> > $(RTOS_SOURCE_DIR)/queue.c \
> > $(RTOS_SOURCE_DIR)/tasks.c \
> > $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/port.c \
> > $(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
> > ./USB/USBSample.c
> >=20
> > #./webserver/SAM7_EMAC.c \
> >=20
> > ARM_SOURCE=3D \
> > enc28j60.c \
> > $(SATURN_SOURCE_DIR)/initSystem.c \
> > $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
> > $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/portISR.c \
> > ./webserver/emac_isr.c \
> > ./SrcAtmel/Cstartup_SAM7.c \
> > ./USB/USB_ISR.c \
> >=20
> >=20
> > # $(SATURN_SOURCE_DIR)/Global_Var.c \
> > # $(SATURN_SOURCE_DIR)/Relay.c \
> > # $(SATURN_SOURCE_DIR)/AT45DB_Flash.c \
> > # $(SATURN_SOURCE_DIR)/i2c_devices.c \
> > # $(SATURN_SOURCE_DIR)/cs5463.c \
> > # $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
> > # $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
> >=20
> >=20
> > # $(SATURN_SOURCE_DIR)/Alarm_PF_Control.c \
> > # $(SATURN_SOURCE_DIR)/cs5463.c \
> > # $(SATURN_SOURCE_DIR)/i2c_devices.c \
> > # $(SATURN_SOURCE_DIR)/TFT_TouchScreen.c \
> >=20
> >=20
> > # ./src/timerisr.c \
> > # ./src/timersetup.c \
> > # ./src/isrsupport.c \
> > # ./src/lowlevelinit.c \
> > # ./src/blinker.c \
> > # ./src/Relay.c \
> > # ./src/TFT_TouchScreen.c \
> > # ./src/Global_Var.c \
> > # ./src/i2c_devices.c \
> > # ./src/AT45DB_Flash.c \
> > # ./src/cs5463.c \
> > # ./src/int_isr.c \
> > # ./src/Alarm_PF_Control.c \
> > # ./src/modbus_485.c \
> > # ./src/cdc_enumerate.c \
> > # ./src/main.c \
> >=20
> > THUMB_OBJS =3D $(THUMB_SOURCE:.c=3D.o)
> > ARM_OBJS =3D $(ARM_SOURCE:.c=3D.o)
> >=20
> > all: RTOSDemo.bin
> >=20
> > #all: RTOSDemo.out RTOSDemo.bin
> > # @ echo "...copying"
> > # $(arm-elf-objcopy) $(--output-target=3Dbinary) RTOSDemo.out=20
> > RTOSDemo.bin
> > # $(OD) $(ODFLAGS) main.out > main.dmp
> > # $(arm-elf-ld -v) $(LINKER_FLAGS) -o RTOSDemo.out RTOSDemo.bin
> >=20
> > RTOSDemo.bin : RTOSDemo.hex
> > $(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin=20
> >=20
> > RTOSDemo.hex : RTOSDemo.elf
> > $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
> >=20
> > #RTOSDemo.out : $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
> > # $(arm-elf-objcopy) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
> >=20
> > #RTOSDemo.out : RTOSDemo.elf
> > # $(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.out
> > # LINKER_FLAGS
> >=20
> > #all: RTOSDemo.out
> > # @ echo "...copying"
> > # $(CP) $(CPFLAGS) RTOSDemo.out RTOSDemo.bin
> > # $(OD) $(ODFLAGS) RTOSDemo.out > RTOSDemo.dmp
> >=20
> > #RTOSDemo.out: $(THUMB_OBJS) $(ARM_OBJS) atmel-rom.ld
> > # @ echo "..linking"
> > # $(LD) $(LFLAGS) -o main.out $(OBJECTS) libc.a libm.a libgcc.a
> > # $(LD) $(LINKER_FLAGS) -o RTOSDemo.out
> >=20
> > #RTOSDemo.out : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
> > # $(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s=20
> > $(LINKER_FLAGS)=20
> >=20
> > RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
> > $(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s=20
> > $(LINKER_FLAGS)=20
> >=20
> > $(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
> > $(CC) -c $(CFLAGS) -mthumb $< -o $@
> >=20
> > $(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
> > $(CC) -c $(CFLAGS) $< -o $@
> >=20
> > clean :
> > rm $(THUMB_OBJS)
> > rm $(ARM_OBJS)
> > touch Makefile
> > rm RTOSDemo.elf
> > rm RTOSDemo.bin
> > rm RTOSDemo.hex
> >=20
> >=20
> >=20
> >=20
>
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )RE: Re: FreeRTOS with AT91SAM7x512 - FreeRTOS info - Jun 2 8:50:48 2009
> #define UIP_CONF_BUFFER_SIZE 1480
> for size of long buffer. I need to change this to start
> webserver. If I don't change this size then I can ping my
> hardware but I cant run webpage. To, make working web server
> I have to do
> #define UIP_CONF_BUFFER_SIZE 65600
>
I don't know why you would want to do that - anything above the Ethernet
frame size will not be used anyway. From the uIP documentation:
/**
* The size of the uIP packet buffer.
*
* The uIP packet buffer should not be smaller than 60 bytes, and does
* not need to be larger than 1500 bytes. Lower size results in lower
* TCP throughput, larger size results in higher TCP throughput.
*
* \hideinitializer
*/
Regards,
Richard.
+ http://www.FreeRTOS.org
Now includes an Atmel SAM3 Cortex M3 demo!
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: FreeRTOS with AT91SAM7x512 - bhavintailor_ec - Jun 4 8:10:23 2009
--- In A...@yahoogroups.com, "FreeRTOS info"
wrote:
>
> > #define UIP_CONF_BUFFER_SIZE 1480
> > for size of long buffer. I need to change this to start
> > webserver. If I don't change this size then I can ping my
> > hardware but I cant run webpage. To, make working web server
> > I have to do
> > #define UIP_CONF_BUFFER_SIZE 65600
> > I don't know why you would want to do that - anything above the Ethernet
> frame size will not be used anyway. From the uIP documentation:
>
> /**
> * The size of the uIP packet buffer.
> *
> * The uIP packet buffer should not be smaller than 60 bytes, and does
> * not need to be larger than 1500 bytes. Lower size results in lower
> * TCP throughput, larger size results in higher TCP throughput.
> *
> * \hideinitializer
> */
>
> Regards,
> Richard.
>
> + http://www.FreeRTOS.org
> Now includes an Atmel SAM3 Cortex M3 demo!
>
I dont like to increase the size of buffer. But if i dont do this than i can not run my
webpage on PC. If i dont increase the size of buffer then i can only ping hardware with
given IP ADDRESS. I have just changes in stack to work with ENC28J60. So, how can i solve
to make working webserver with minimum buffer size. Is it related to ENC28J60. To
configure ENC28J60, i have used one ready made code. This code is based on uIP with LPC
controller without any RTOS. So, instead of LPC Controller SFR, i have put AT91SAM7x512
SFR to communicate with ENC28J60 through SPI Module. I try to debug using WinSHARK to
capture TCP/IP data. With 1480 buffer size in hardware, i found that as request send to
hardware through Internet Explorer for webpage then through ARP Protocol it first find IP
address OK. Then in webpage request through TCP Protocol, hardware send [ACK,RST] flag.
After that it is not procedding further. Currently my webserver is working ok but with
buffer of 65K RAM. And getting [ACK,RST] flag in response with 1480 buffer RAM. So, how
can i solve this ?
And what could be the reason that after 265K of code size with FreeRTOS, it stop
running. If code size is less then 265K then it works ok but as it cross this limit then
code is not showing any result on hardware.
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )