git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1733 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2010-03-09 13:43:16 +00:00
parent e4fed0ca86
commit 1585e2851c
8 changed files with 232 additions and 45 deletions

View File

@ -0,0 +1,139 @@
<ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile=".\ch.elf" sate="98" >
<Group Header="port" Marker="-1" OutputFile="" sate="0" >
<NodeASM Path="..\..\..\os\ports\GCC\ARMCM3\crt0.s" Header="crt0.s" Marker="-1" OutputFile=".\bin\crt0.o" sate="0" />
<NodeASM Path="..\..\..\os\ports\GCC\ARMCM3\STM32F103\vectors.s" Header="vectors.s" Marker="-1" OutputFile=".\bin\vectors.o" sate="0" />
<NodeC Path="..\..\..\os\ports\GCC\ARMCM3\nvic.c" Header="nvic.c" Marker="-1" OutputFile=".\bin\nvic.o" sate="0" />
<NodeC Path="..\..\..\os\ports\GCC\ARMCM3\chcore.c" Header="chcore.c" Marker="-1" OutputFile=".\bin\chcore.o" sate="0" />
</Group>
<Group Header="kernel" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\..\os\kernel\src\chcond.c" Header="chcond.c" Marker="-1" OutputFile=".\bin\chcond.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chdebug.c" Header="chdebug.c" Marker="-1" OutputFile=".\bin\chdebug.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chevents.c" Header="chevents.c" Marker="-1" OutputFile=".\bin\chevents.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chheap.c" Header="chheap.c" Marker="-1" OutputFile=".\bin\chheap.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chlists.c" Header="chlists.c" Marker="-1" OutputFile=".\bin\chlists.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chmboxes.c" Header="chmboxes.c" Marker="-1" OutputFile=".\bin\chmboxes.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chmemcore.c" Header="chmemcore.c" Marker="-1" OutputFile=".\bin\chmemcore.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chmempools.c" Header="chmempools.c" Marker="-1" OutputFile=".\bin\chmempools.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chmsg.c" Header="chmsg.c" Marker="-1" OutputFile=".\bin\chmsg.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chmtx.c" Header="chmtx.c" Marker="-1" OutputFile=".\bin\chmtx.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chqueues.c" Header="chqueues.c" Marker="-1" OutputFile=".\bin\chqueues.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chregistry.c" Header="chregistry.c" Marker="-1" OutputFile=".\bin\chregistry.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chschd.c" Header="chschd.c" Marker="-1" OutputFile=".\bin\chschd.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chsem.c" Header="chsem.c" Marker="-1" OutputFile=".\bin\chsem.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chsys.c" Header="chsys.c" Marker="-1" OutputFile=".\bin\chsys.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chthreads.c" Header="chthreads.c" Marker="-1" OutputFile=".\bin\chthreads.o" sate="0" />
<NodeC Path="..\..\..\os\kernel\src\chvt.c" Header="chvt.c" Marker="-1" OutputFile=".\bin\chvt.o" sate="0" />
</Group>
<Group Header="hal" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\..\os\hal\src\adc.c" Header="adc.c" Marker="-1" OutputFile=".\bin\adc.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\can.c" Header="can.c" Marker="-1" OutputFile=".\bin\can.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\hal.c" Header="hal.c" Marker="-1" OutputFile=".\bin\hal.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\mac.c" Header="mac.c" Marker="-1" OutputFile=".\bin\mac.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\mmc_spi.c" Header="mmc_spi.c" Marker="-1" OutputFile=".\bin\mmc_spi.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\pal.c" Header="pal.c" Marker="-1" OutputFile=".\bin\pal.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\pwm.c" Header="pwm.c" Marker="-1" OutputFile=".\bin\pwm.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\serial.c" Header="serial.c" Marker="-1" OutputFile=".\bin\serial.o" sate="0" />
<NodeC Path="..\..\..\os\hal\src\spi.c" Header="spi.c" Marker="-1" OutputFile=".\bin\spi.o" sate="0" />
<Group Header="platform" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\..\os\hal\platforms\STM32\adc_lld.c" Header="adc_lld.c" Marker="-1" OutputFile=".\bin\adc_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\can_lld.c" Header="can_lld.c" Marker="-1" OutputFile=".\bin\can_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\hal_lld.c" Header="hal_lld.c" Marker="-1" OutputFile=".\bin\hal_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\pal_lld.c" Header="pal_lld.c" Marker="-1" OutputFile=".\bin\pal_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\pwm_lld.c" Header="pwm_lld.c" Marker="-1" OutputFile=".\bin\pwm_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\serial_lld.c" Header="serial_lld.c" Marker="-1" OutputFile=".\bin\serial_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\spi_lld.c" Header="spi_lld.c" Marker="-1" OutputFile=".\bin\spi_lld.o" sate="0" />
<NodeC Path="..\..\..\os\hal\platforms\STM32\stm32_dma.c" Header="stm32_dma.c" Marker="-1" OutputFile=".\bin\stm32_dma.o" sate="0" />
</Group>
</Group>
<Group Header="board" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\..\boards\OLIMEX_STM32_P103\board.c" Header="board.c" Marker="-1" OutputFile=".\bin\board.o" sate="0" />
</Group>
<Group Header="test" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\..\test\test.c" Header="test.c" Marker="-1" OutputFile=".\bin\test.o" sate="0" />
<NodeC Path="..\..\..\test\testbmk.c" Header="testbmk.c" Marker="-1" OutputFile=".\bin\testbmk.o" sate="0" />
<NodeC Path="..\..\..\test\testdyn.c" Header="testdyn.c" Marker="-1" OutputFile=".\bin\testdyn.o" sate="0" />
<NodeC Path="..\..\..\test\testevt.c" Header="testevt.c" Marker="-1" OutputFile=".\bin\testevt.o" sate="0" />
<NodeC Path="..\..\..\test\testheap.c" Header="testheap.c" Marker="-1" OutputFile=".\bin\testheap.o" sate="0" />
<NodeC Path="..\..\..\test\testmbox.c" Header="testmbox.c" Marker="-1" OutputFile=".\bin\testmbox.o" sate="0" />
<NodeC Path="..\..\..\test\testmsg.c" Header="testmsg.c" Marker="-1" OutputFile=".\bin\testmsg.o" sate="0" />
<NodeC Path="..\..\..\test\testmtx.c" Header="testmtx.c" Marker="-1" OutputFile=".\bin\testmtx.o" sate="0" />
<NodeC Path="..\..\..\test\testpools.c" Header="testpools.c" Marker="-1" OutputFile=".\bin\testpools.o" sate="0" />
<NodeC Path="..\..\..\test\testqueues.c" Header="testqueues.c" Marker="-1" OutputFile=".\bin\testqueues.o" sate="0" />
<NodeC Path="..\..\..\test\testsem.c" Header="testsem.c" Marker="-1" OutputFile=".\bin\testsem.o" sate="0" />
<NodeC Path="..\..\..\test\testthd.c" Header="testthd.c" Marker="-1" OutputFile=".\bin\testthd.o" sate="0" />
</Group>
<NodeC Path="..\main.c" Header="main.c" Marker="-1" OutputFile=".\bin\main.o" sate="0" />
<Options>
<Config Header="Standard" >
<Set Header="ApplicationBuild" >
<Section Header="General" >
<Property Header="TargetFamily" Value="ARM" />
</Section>
<Section Header="Directories" >
<Property Header="IncDir" Value="..;$(RkitLib)\ARM\include;..\..\..\os\kernel\include;..\..\..\os\ports\GCC\ARMCM3;..\..\..\os\ports\GCC\ARMCM3\cmsis;..\..\..\os\hal\include;..\..\..\os\hal\platforms\STM32;..\..\..\os\hal\platforms\STM32;..\..\..\boards\OLIMEX_STM32_P103;..\..\..\test" Removable="1" />
<Property Header="ListDir" Value="$(ApplicationDir)\lst" Removable="1" />
<Property Header="OutDir" Value="$(ApplicationDir)\bin" Removable="1" />
<Property Header="LinkerOutputDir" Value="Application Directory" Removable="1" />
</Section>
</Set>
<Set Header="Target" >
<Section Header="ProcessorARM" >
<Property Header="Processor" Value="STM32F100RB" />
</Section>
<Section Header="ToolSetARM" >
<Property Header="BuildToolSetARM" Value="ARM\GNU.config" Removable="1" />
</Section>
<Section Header="DebugARM" >
<Property Header="DebugTool_CORTEX" Value="RLINK_CORTEX" Removable="1" />
</Section>
</Set>
<Set Header="LD" >
<Section Header="Startup" >
<Property Header="DEFAULTSTARTUP" Value="No" Removable="1" />
<Property Header="File" Value="" Removable="1" />
</Section>
<Section Header="Scripts" >
<Property Header="SCRIPTFILES" Value="No" Removable="1" />
<Property Header="File" Value="..\ch.ld" Removable="1" />
</Section>
<Section Header="LIB" >
<Property Header="UART0PUTC" Value="0" Removable="1" />
<Property Header="STM32LIB" Value="0" Removable="1" />
</Section>
<Section Header="More" >
<Property Header="More" Value="-Wl,--no-warn-mismatch" />
</Section>
</Set>
<Set Header="GCC" >
<Section Header="OPTIMIZE" >
<Property Header="Optimize" Value="-O2" Removable="1" />
</Section>
<Section Header="More" >
<Property Header="More" Value="-Wall; -Wextra; -Wstrict-prototypes; -fomit-frame-pointer; -falign-functions=16; -mabi=apcs-gnu" />
</Section>
</Set>
</Config>
</Options>
</ApplicationBuild>

View File

@ -0,0 +1,4 @@
<Project Header="Project 'ch'" Path=".\ch.rprj" Project="Yes" OutputFile="" sate="96" ActiveApp="ch" >
<ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile=".\ch.elf" sate="98" />
</Project>

View File

@ -10,15 +10,15 @@
<Set Header="RCST7" >
<Section Header="Model" >
<Property Header="GlobalMemory" Value="" Removable="1" />
</Section>
</Set>
</Config>
</Options>
</NodeC>
<NodeC Path="..\..\os\kernel\src\chlists.c" Header="chlists.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chlists.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chmboxes.c" Header="chmboxes.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chmboxes.obj" sate="0" />
@ -34,15 +34,15 @@
<Set Header="RCST7" >
<Section Header="Model" >
<Property Header="GlobalMemory" Value="" Removable="1" />
</Section>
</Set>
</Config>
</Options>
</NodeC>
<NodeC Path="..\..\os\kernel\src\chsem.c" Header="chsem.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chsem.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chsys.c" Header="chsys.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chsys.obj" sate="0" />
@ -53,17 +53,17 @@
<Set Header="RCST7" >
<Section Header="Model" >
<Property Header="GlobalMemory" Value="" Removable="1" />
</Section>
</Set>
</Config>
</Options>
</NodeC>
</Group>
<Group Header="test" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\test\test.c" Header="test.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\test.obj" sate="0" />
@ -78,12 +78,11 @@
<NodeC Path="..\..\test\testqueues.c" Header="testqueues.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testqueues.obj" sate="0" />
<NodeC Path="..\..\test\testsem.c" Header="testsem.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testsem.obj" sate="0" />
<NodeC Path="..\..\test\testthd.c" Header="testthd.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testthd.obj" sate="0" />
</Group>
<Group Header="port" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\os\ports\RC\STM8\chcore.c" Header="chcore.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chcore.obj" sate="0" />
<NodeASM Path="..\..\os\ports\RC\STM8\chcoreasm.asm" Header="chcoreasm.asm" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chcoreasm.obj" sate="0" />
</Group>
<Group Header="hal" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\os\hal\src\adc.c" Header="adc.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\adc.obj" sate="0" />
@ -98,11 +97,11 @@
<NodeC Path="..\..\os\hal\platforms\STM8\hal_lld.c" Header="hal_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\hal_lld.obj" sate="0" />
<NodeC Path="..\..\os\hal\platforms\STM8\serial_lld.c" Header="serial_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\serial_lld.obj" sate="0" />
<NodeC Path="..\..\os\hal\platforms\STM8\pal_lld.c" Header="pal_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\pal_lld.obj" sate="0" />
</Group>
<Group Header="board" Marker="-1" OutputFile="" sate="96" >
<NodeC Path="..\..\boards\RAISONANCE_REVA_STM8S\board.c" Header="board.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\board.obj" sate="0" />
</Group>
<NodeC Path=".\main.c" Header="main.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\main.obj" sate="0" />
<Options>
@ -110,57 +109,58 @@
<Set Header="ApplicationBuild" >
<Section Header="General" >
<Property Header="TargetFamily" Value="ST7" />
</Section>
<Section Header="Directories" >
<Property Header="IncDir" Value="$(RkitInc);$(RkitInc)\ST7;..\..\os\kernel\include;..\..\os\ports\RC\STM8;..\..\os\hal\include;..\..\os\hal\platforms\STM8;..\..\boards\RAISONANCE_REVA_STM8S;..\..\test" Removable="1" />
<Property Header="OutDir" Value="$(ApplicationDir)/bin" Removable="1" />
<Property Header="ListDir" Value="$(ApplicationDir)/lst" Removable="1" />
<Property Header="LinkerOutputDir" Value="Output Directory" Removable="1" />
</Section>
</Set>
<Set Header="Target" >
<Section Header="ProcessorST7" >
<Property Header="Processor" Value="STM8S208MB" Removable="1" />
</Section>
<Section Header="ToolSetST7" >
<Property Header="BuildToolSetST7" Value="ST7\RaisonanceTools.config" Removable="1" />
<Property Header="ArelocInfo" Value="" Removable="1" />
<Property Header="Areloc" Value="REM" Removable="1" />
</Section>
<Section Header="DebugST7" >
<Property Header="Startup" Value="1" Removable="1" />
<Property Header="DebugTool_STM8" Value="RLINK_STM8" Removable="1" />
</Section>
</Set>
<Set Header="RCST7" >
<Section Header="CodeGen" >
<Property Header="ENUMTYPE" Value="ET(CHAR)" Removable="1" />
</Section>
<Section Header="Model" >
<Property Header="GlobalMemory" Value="DGC(DATA)" Removable="1" />
<Property Header="ModelP" Value="STM8(SMALL)" Removable="1" />
</Section>
<Section Header="OPTIM" >
<Property Header="OTLEVEL" Value="3" Removable="1" />
<Property Header="SPEEDSIZE" Value="SPEED" Removable="1" />
</Section>
</Set>
<Set Header="MAST7" >
<Section Header="Set" >
<Property Header="Defines" Value="STM8S208RB" Removable="1" />
</Section>
</Set>
</Config>
</Options>

View File

@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.5.3
PROJECT_NUMBER = 1.5.4
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View File

@ -38,7 +38,7 @@
/**
* @brief Kernel version string.
*/
#define CH_KERNEL_VERSION "1.5.3unstable"
#define CH_KERNEL_VERSION "1.5.4unstable"
/**
* @brief Kernel version major number.
@ -53,7 +53,7 @@
/**
* @brief Kernel version patch number.
*/
#define CH_KERNEL_PATCH 3
#define CH_KERNEL_PATCH 4
/*
* Common values.

View File

@ -24,9 +24,41 @@
* @addtogroup STM8_CORE
* @{
*/
#pragma SRC("tmp.asm")
#include "ch.h"
/**
* @brief Performs a context switch between two threads.
*
* @param otp the thread to be switched out
*/
void _port_switch(Thread *otp) {
(void)otp;
/* Asm because unoptimal code would generated by using _getSP_().*/
#pragma ASM
EXTRN PAGE0(rlist)
LDW Y,SP ; old context pointer
LDW (005H,X),Y ; SP saved in otp->p_ctx.sp
LDW X,rlist + 0DH ; r_current (currp) field
LDW X,(005H,X) ; currp->p_ctx.sp
LDW SP,X ; new context pointer
#pragma ENDASM
}
/**
* @brief Thread start code.
*/
void _port_thread_start(void) {
#pragma ASM
RIM
POPW X
#pragma ENDASM
}
/**
* @brief Halts the system.
* @details This function is invoked by the operating system when an

View File

@ -46,6 +46,13 @@
*/
typedef uint8_t stkalign_t;
/**
* @brief Generic STM8 function pointer.
* @note It is used to allocate the proper size for return addresses in
* context-related structures.
*/
typedef void (*stm8func_t)(void);
/**
* @brief Interrupt saved context.
* @details This structure represents the stack frame saved during a
@ -75,7 +82,7 @@ struct extctx {
*/
struct intctx {
uint8_t _next;
uint16_t pc;
stm8func_t pc; /* Function pointer sized return address. */
};
/**
@ -85,10 +92,10 @@ struct intctx {
*/
struct startctx {
uint8_t _next;
uint16_t ts; /* Trampoline address. */
uint16_t arg; /* Thread argument. */
uint16_t pc; /* Thread function address. */
uint16_t ret; /* chThdExit() address. */
stm8func_t ts; /* Trampoline address. */
void *arg; /* Thread argument. */
stm8func_t pc; /* Thread function address. */
stm8func_t ret; /* chThdExit() address. */
};
/**
@ -109,10 +116,10 @@ struct context {
struct startctx *scp; \
scp = (struct startctx *)((uint8_t *)workspace + wsize - \
sizeof(struct startctx)); \
scp->ts = (uint16_t)_port_thread_start; \
scp->arg = (uint16_t)arg; \
scp->pc = (uint16_t)pf; \
scp->ret = (uint16_t)chThdExit; \
scp->ts = _port_thread_start; \
scp->arg = arg; \
scp->pc = (stm8func_t)pf; \
scp->ret = (stm8func_t)chThdExit; \
tp->p_ctx.sp = (struct intctx *)scp; \
}

View File

@ -56,6 +56,11 @@
*** Releases ***
*****************************************************************************
*** 1.5.4 ***
- NEW: Added support for the STM8 large memory model to the STM8 port.
- NEW: Added RIDE7 project files to the STM32 demo. The normal makefile is
still available of course.
*** 1.5.3 ***
- FIX: Removed C99-style variables declarations (bug 2964418)(backported
in 1.4.2).