[cpu arm_common]

* added usb ram as heap3
* some feuerware merge adaptation

[projects test_suite]

* fixed some test scripts
dev/timer
Oliver Hahm 11 years ago
parent e49a17f4f7
commit 55bb484b22

@ -14,6 +14,7 @@
#include "bitarithm.h"
#include "hwtimer_cpu.h"
#include "hwtimer_arch.h"
#include "irq.h"
#define VULP(x) ((volatile unsigned long*) (x))

@ -31,9 +31,9 @@ and the mailinglist (subscription via web site)
*
* @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
* @author Michael Baar <michael.baar@fu-berlin.de>
* @version $Revision: 3914 $
* @version $Revision$
*
* @note $Id: syscalls.c 3914 2012-02-14 09:31:06Z hwill $
* @note $Id$
*/
#include <errno.h>
@ -45,16 +45,15 @@ and the mailinglist (subscription via web site)
#include <stdint.h>
// core
#include "kernel.h"
// sys
#include "lpm.h"
#include "tracelog.h"
#include "hal-syscalls.h"
#include "irq.h"
#include "io.h"
/* When using the HAL standard in and out are handled by HAL
devices. */
#if FEUERWARE_CONF_ENABLE_HAL
#include "hal.h"
#include "interface-chardevice.h"
#include "hal-syscalls.h"
#endif
#define DEBUG_SYSCALLS 0
@ -88,8 +87,7 @@ static caddr_t heap[NUM_HEAPS] = {(caddr_t)&__heap1_start,(caddr_t)&__heap3_star
static const caddr_t heap_max[NUM_HEAPS] = {(caddr_t)&__heap1_max,(caddr_t)&__heap3_max,(caddr_t)&__heap2_max};
// start position in heap
static const caddr_t heap_start[NUM_HEAPS] = {(caddr_t)&__heap1_start,(caddr_t)&__heap3_start,(caddr_t)&__heap2_start};
// current heap in use
volatile static uint8_t iUsedHeap = 0;
/** @} */
@ -127,7 +125,7 @@ caddr_t _sbrk_r(struct _reent *r, size_t incr)
uint32_t cpsr = disableIRQ();
/* check all heaps for a chunk of the requested size */
for( ; iUsedHeap < NUM_HEAPS; iUsedHeap++ ) {
for(volatile uint8_t iUsedHeap = 0; iUsedHeap < NUM_HEAPS; iUsedHeap++ ) {
caddr_t new_heap = heap[iUsedHeap] + incr;
#ifdef MODULE_TRACELOG
@ -151,7 +149,7 @@ caddr_t _sbrk_r(struct _reent *r, size_t incr)
#endif
r->_errno = ENOMEM;
return NULL;
return NULL;
}
/*---------------------------------------------------------------------------*/
int _isatty_r(struct _reent *r, int fd)
@ -249,6 +247,9 @@ int _write_r(struct _reent *r, int fd, const void *data, unsigned int count)
#ifdef MODULE_FAT
result = ff_write_r(r, fd, data, count);
#endif
PRINTF("write [%i] data @%p count %i\n", fd, data, count);
PRINTF("write [%i] returned %i errno %i\n", fd, result, r->_errno);
break;
}
@ -262,27 +263,36 @@ int _read_r(struct _reent *r, int fd, void *buffer, unsigned int count)
#ifdef MODULE_FAT
result = ff_read_r(r, fd, buffer, count);
#endif
return result;
PRINTF("read [%i] buffer @%p count %i\n", fd, buffer, count);
PRINTF("read [%i] returned %i\n", fd, result);
return result;
}
/*---------------------------------------------------------------------------*/
int _close_r(struct _reent *r, int fd)
{
int ret = -1;
int result = -1;
r->_errno = EBADF;
#ifdef MODULE_FAT
ret = ff_close_r(r, fd);
#endif
return ret;
PRINTF("close [%i]\n", fd);
PRINTF("close returned %i errno %i\n", result, errno);
return result;
}
/*---------------------------------------------------------------------------*/
int _unlink_r(struct _reent *r, char* path)
{
int ret = -1;
int result = -1;
r->_errno = ENODEV;
#ifdef MODULE_FAT
ret = ff_unlink_r(r, path);
result = ff_unlink_r(r, path);
#endif
return ret;
PRINTF("unlink '%s'\n", path);
PRINTF("unlink returned %i errno %i\n", result, errno);
return result;
}
/*---------------------------------------------------------------------------*/
void _exit(int n)

@ -27,11 +27,11 @@ and the mailinglist (subscription via web site)
/* specify the LPC2387 memory areas (see LPC2387 datasheet page 15) */
MEMORY
{
flash : ORIGIN = 0, LENGTH = 512K /* FLASH ROM */
flash : ORIGIN = 0, LENGTH = 504K /* FLASH ROM 512kByte without ISP bootloader*/
infomem : ORIGIN = 0x0007D000, LENGTH = 4K /* Last sector in FLASH ROM for config data */
ram_battery : ORIGIN = 0xE0084000, LENGTH = 2K /* Battery RAM */
ram : ORIGIN = 0x40000000, LENGTH = 64K /* LOCAL ON-CHIP STATIC RAM */
ram_usb : ORIGIN = 0x7FD00000, LENGTH = 16K /* USB RAM */
ram_usb : ORIGIN = 0x7FD00000, LENGTH = 16K /* USB RAM !!! first 1024 bytes are occupied from GPDMA for MCI */
ram_ethernet : ORIGIN = 0x7FE00000, LENGTH = 16K /* ethernet RAM */
}
@ -177,7 +177,27 @@ SECTIONS
*(.gnu.linkonce.d*)
} >ram /* put all the above into RAM (but load the LMA copy into FLASH) */
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_edata = .; /* define a global symbol marking the end of the .data section */
_edata = .; /* define a global symbol marking the end of the .data section */
/*
* Exception frames (newer linker versions generate these but they use of
* most of the RAM.
*/
/DISCARD/ : /* discard exception frames */
{
*(.eh_*)
}
/* to enable exception frames */
/*
.eh_frame :
{
KEEP (*(.eh_frame))
} > ram
. = ALIGN(4);
*/
_end = .; /* define a global symbol marking the end of application RAM */
__heap1_size = ORIGIN(ram) + LENGTH(ram) - . - __stack_size;
@ -219,12 +239,23 @@ SECTIONS
PROVIDE(__heap2_max = .); /* _heap shall always be < _heap_max */
} > ram_ethernet
. = ORIGIN(ram_usb);
.usbdata (NOLOAD) : /* USB RAM section, may be used otherwise if USB is disabled */
{
*(.usbdata)
} > ram_usb
.batteryram (NOLOAD) : /* battery ram stay on during powerdown but needs to be handled specially */
.heap3 ALIGN(0x1000) (NOLOAD) :
{
__heap3_size = ORIGIN(ram_usb) + LENGTH(ram_usb) - ABSOLUTE(.);
PROVIDE(__heap3_start = . );
. += __heap3_size;
PROVIDE(__heap3_max = .);
} > ram_usb
__heap_size = SIZEOF(.heap3);
.batteryram (NOLOAD) : /* battery ram stays on during powerdown but needs to be handled specially */
{
*(.batteryram)
} > ram_battery

@ -4,8 +4,11 @@ set timeout 5
spawn pseudoterm $env(PORT)
sleep 1
send "\n"
send "\n"
expect {
">$" {}
">" {}
timeout { exit 1 }
}
@ -16,7 +19,7 @@ expect {
}
expect {
">$" {}
">" {}
timeout { exit 1 }
}

@ -4,8 +4,11 @@ set timeout 5
spawn pseudoterm $env(PORT)
sleep 1
send "\n"
send "\n"
expect {
">$" {}
">" {}
timeout { exit 1 }
}
@ -16,7 +19,7 @@ expect {
}
expect {
">$" {}
">" {}
timeout { exit 1 }
}

@ -4,8 +4,11 @@ set timeout 5
spawn pseudoterm $env(PORT)
sleep 1
send "\n"
send "\n"
expect {
">$" {}
">" {}
timeout { exit 1 }
}
@ -16,7 +19,7 @@ expect {
}
expect {
">$" {}
">" {}
timeout { exit 1 }
}

Loading…
Cancel
Save