Compare commits
No commits in common. "master" and "newlib" have entirely different histories.
4626 changed files with 122581 additions and 126419 deletions
9213
.gitattributes
vendored
9213
.gitattributes
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,15 +0,0 @@
|
|||
# Example makefile for use with the command-line C32 compiler and newlib
|
||||
# Taken from Phillip Burgess's c32-build script
|
||||
|
||||
HEX = test.hex
|
||||
DEVICE = 32MX360F512L
|
||||
CC = pic32mx-gcc -s -Wl,-Map,test.map -Os -mips16 -mprocessor=$(DEVICE)
|
||||
|
||||
all: $(HEX)
|
||||
|
||||
$(HEX): test.elf
|
||||
pic32mx-bin2hex -a test.elf
|
||||
|
||||
test.elf: test.c
|
||||
$(CC) test.c -o test.elf
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
/* Example "blinkenlights" program for the PIC32 Starter Kit and C32 compiler.
|
||||
Demonstrates software PWM, use of floating-point library functions, etc.
|
||||
|
||||
10/17/2008 - Phillip Burgess - pburgess@dslextreme.com */
|
||||
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <math.h>
|
||||
|
||||
#pragma config \
|
||||
FPLLIDIV = DIV_2, \
|
||||
FPLLMUL = MUL_20, \
|
||||
FPLLODIV = DIV_1, \
|
||||
FWDTEN = OFF, \
|
||||
POSCMOD = XT, \
|
||||
FNOSC = PRIPLL, \
|
||||
FPBDIV = DIV_2
|
||||
|
||||
#define DEG2RAD (M_PI / 180.0)
|
||||
|
||||
static void pwm(
|
||||
const short a,
|
||||
const short b,
|
||||
const short c)
|
||||
{
|
||||
int bits;
|
||||
short i;
|
||||
|
||||
bits = a ? BIT_0 : 0;
|
||||
if(b > 0) bits |= BIT_1;
|
||||
if(c > 0) bits |= BIT_2;
|
||||
mPORTDSetBits(bits);
|
||||
|
||||
for(i=0;i<=1000;i++)
|
||||
{
|
||||
bits = (i >= a) ? BIT_0 : 0;
|
||||
if(i >= b) bits |= BIT_1;
|
||||
if(i >= c) bits |= BIT_2;
|
||||
|
||||
mPORTDClearBits(bits);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
double d;
|
||||
|
||||
PORTSetPinsDigitalOut(IOPORT_D, BIT_0 | BIT_1 | BIT_2);
|
||||
|
||||
#if 0
|
||||
for(d = 0.0;;d += 0.005)
|
||||
{
|
||||
pwm((int)(pow(0.5 + cos(d ) * 0.5,3.0) * 1000.0),
|
||||
(int)(pow(0.5 + cos(d + 120.0 * DEG2RAD) * 0.5,3.0) * 1000.0),
|
||||
(int)(pow(0.5 + cos(d + 240.0 * DEG2RAD) * 0.5,3.0) * 1000.0));
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
129
MAINTAINERS
129
MAINTAINERS
|
@ -1,3 +1,128 @@
|
|||
Pic32 port of Newlib
|
||||
Please feel free to add, edit, delete this file.
|
||||
Please do not make ChangeLog entries.
|
||||
|
||||
- Justin Hammond (justin@dynam.ac)
|
||||
COPYING, COPYING.LIB, README
|
||||
http://gnu.org.
|
||||
|
||||
Makefile.*; configure; configure.ac; src-release
|
||||
Any global maintainer can approve changes to these
|
||||
files, but they should be aware that they need to
|
||||
be kept in sync with their counterparts in the GCC
|
||||
repository. Also please notify the following of
|
||||
any committed patches:
|
||||
binutils@sources.redhat.com
|
||||
gdb-patches@sources.redhat.com
|
||||
|
||||
bfd/; binutils/; elfcpp/; gas/; gold/; gprof/; ld/; opcodes/; cpu/;
|
||||
BFD's part of include/
|
||||
|
||||
binutils: http://sources.redhat.com/binutils/
|
||||
Patches to binutils@sources.redhat.com.
|
||||
Please notify the following of any interface changes:
|
||||
gdb-patches@sources.redhat.com
|
||||
|
||||
cgen/; cgen parts of opcodes/, sim/ & include/
|
||||
cgen: http://sources.redhat.com/cgen/
|
||||
Patches to cgen@sources.redhat.com
|
||||
May need separate opcodes/ or sim/ approval for
|
||||
commits of regenerated files there.
|
||||
|
||||
config.guess; config.sub; readline/support/config.{sub,guess}
|
||||
config: http://savannah.gnu.org/projects/config
|
||||
Patches to config-patches@gnu.org.
|
||||
Changes need to be done in tandem with the official CONFIG
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge. When updating any of these files, please be
|
||||
sure to update all of them.
|
||||
Please notify the following of any committed patches:
|
||||
binutils@sources.redhat.com
|
||||
gdb-patches@sources.redhat.com
|
||||
|
||||
depcomp
|
||||
Send bug reports and patches to bug-automake@gnu.org.
|
||||
|
||||
gdb/; readline/; sim/; GDB's part of include/
|
||||
GDB: http://www.gnu.org/software/gdb/
|
||||
Patches to gdb-patches@sources.redhat.com.
|
||||
See also gdb/MAINTAINERS and sim/MAINTAINERS.
|
||||
|
||||
include/
|
||||
See binutils/, gdb/, sid/, gcc/, libiberty/ etc.
|
||||
|
||||
intl/; config.rhost; libiberty/; libiberty's part of include/
|
||||
gcc: http://gcc.gnu.org
|
||||
Changes need to be done in tandem with the official GCC
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge. Note: approved patches in gcc's libiberty or
|
||||
intl are automatically approved in this libiberty and intl also;
|
||||
feel free to merge them yourself if needed sooner than the next
|
||||
merge. Otherwise, changes are automatically merged, usually
|
||||
within a day.
|
||||
|
||||
libdecnumber/
|
||||
See libiberty. The master copy of this directory is in the GCC
|
||||
repository.
|
||||
|
||||
ltconfig; ltmain.sh; ltcf-*.sh
|
||||
libtool: http://www.gnu.org/software/libtool/
|
||||
Changes need to be done in tandem with the official LIBTOOL
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge.
|
||||
|
||||
mkinstalldirs; move-if-change
|
||||
autoconf: http://gnu.org
|
||||
Patches to autoconf-patches@gnu.org.
|
||||
Changes need to be done in tandem with the official AUTOCONF
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge.
|
||||
|
||||
symlink-tree
|
||||
gcc: http://gcc.gnu.org
|
||||
See libiberty.
|
||||
|
||||
newlib/; libgloss/
|
||||
http://sources.redhat.com/newlib/
|
||||
Patches to newlib@sources.redhat.com.
|
||||
|
||||
sid/; SID's part of cgen/
|
||||
sid: http://sources.redhat.com/sid/
|
||||
Patches to sid@sources.redhat.com
|
||||
|
||||
texinfo/texinfo.tex
|
||||
texinfo: http://ftp.gnu.org.
|
||||
Latest version can be found on ftp://ftp.gnu.org and can be
|
||||
imported at any (reasonable) time.
|
||||
Please not use GCC's texinfo. Please do not import texinfo.
|
||||
|
||||
tcl/; tix/; itcl/; tk/; libgui/
|
||||
insight: http://sources.redhat.com/insight/
|
||||
Contact insight@sources.redhat.com.
|
||||
|
||||
winsup/
|
||||
cygwin: http://sources.redhat.com/cygwin
|
||||
Patches to cygwin-patches@sources.redhat.com.
|
||||
General discussion cygwin@sources.redhat.com.
|
||||
See also winsup/MAINTAINERS.
|
||||
|
||||
config-ml.in; makefile.vms; mkdep; setup.com;
|
||||
etc/; utils/;
|
||||
Any global maintainer can approve changes to these
|
||||
files and directories.
|
||||
|
||||
compile; depcomp; install-sh; missing; ylwrap;
|
||||
config/
|
||||
Any global maintainer can approve changes to these
|
||||
files and directories, but they should be aware
|
||||
that they need to be kept in sync with their
|
||||
counterparts in the GCC repository.
|
||||
|
||||
modules file
|
||||
Obviously changes to this file should not go through
|
||||
overseers@sources.redhat.com. If you understand the file
|
||||
format (or can cut-and-paste existing entries), modify it. If
|
||||
it scares you, get someone who does understand it to help you.
|
||||
Be prepared to fix it if you do break it.
|
||||
|
||||
/* Local variables: */
|
||||
/* change-log-default-name: "/dev/null" */
|
||||
/* End: */
|
||||
|
|
55844
Makefile.in
Normal file
55844
Makefile.in
Normal file
File diff suppressed because it is too large
Load diff
90
README
90
README
|
@ -1,67 +1,47 @@
|
|||
Bef installation instructions
|
||||
README for GNU development tools
|
||||
|
||||
What you need:
|
||||
1) The C32 Suite installed and access to copy them to your unix box
|
||||
2) A installed/functioning C32 GCC compiler for your unix box (See
|
||||
http://www.paintyourdragon.com/uc/osxpic32/index.html but read below for
|
||||
important info)
|
||||
This directory contains various GNU compilers, assemblers, linkers,
|
||||
debuggers, etc., plus their support routines, definitions, and documentation.
|
||||
|
||||
3) The pic32 port of newlib
|
||||
(http://svn.neostats.net/svn/pic32-newlib/Trunk/)
|
||||
If you are receiving this as part of a GDB release, see the file gdb/README.
|
||||
If with a binutils release, see binutils/README; if with a libg++ release,
|
||||
see libg++/README, etc. That'll give you info about this
|
||||
package -- supported targets, how to use it, how to report bugs, etc.
|
||||
|
||||
What my assumptions are:
|
||||
1) I'm not installing to the system wide directory, but to a private home
|
||||
directory (hence, the c32 install.sh script is not valid)
|
||||
It is now possible to automatically configure and build a variety of
|
||||
tools with one command. To build all of the tools contained herein,
|
||||
run the ``configure'' script here, e.g.:
|
||||
|
||||
What you do:
|
||||
1) Firstly, follow the instructions to build your GCC version that is
|
||||
contained on Phillip Burgess's page above.
|
||||
./configure
|
||||
make
|
||||
|
||||
(I made one change to the build.sh directory - On Line 48, changed the
|
||||
--prefix option to "/home/pic32/". I suggest for the moment you do the same,
|
||||
as I don't know if the newlib files will mess up your System Include files
|
||||
or not - If you do this, you also should add the new /home/pic32/bin
|
||||
directory to your Path)
|
||||
To install them (by default in /usr/local/bin, /usr/local/lib, etc),
|
||||
then do:
|
||||
make install
|
||||
|
||||
2) Ignore the install.sh script that Phillip Burgess provides, as we will be
|
||||
using only a limited number of files (for now) from the C32 Suite
|
||||
(If the configure script can't determine your type of computer, give it
|
||||
the name as an argument, for instance ``./configure sun4''. You can
|
||||
use the script ``config.sub'' to test whether a name is recognized; if
|
||||
it is, config.sub translates it to a triplet specifying CPU, vendor,
|
||||
and OS.)
|
||||
|
||||
3) In the GCC directory, you can execute "make install" and this should
|
||||
install the GCC files into directories such as /home/pic32/bin and
|
||||
/home/pic32/lib etc
|
||||
If you have more than one compiler on your system, it is often best to
|
||||
explicitly set CC in the environment before running configure, and to
|
||||
also set CC when running make. For example (assuming sh/bash/ksh):
|
||||
|
||||
4) From the C32 Suite, Place the following files (preserving directory
|
||||
structures etc) into the following directory:
|
||||
/home/pic32/pic32mx/include
|
||||
CC=gcc ./configure
|
||||
make
|
||||
|
||||
(from C32 Suite)
|
||||
pic32-libs/include/cp0defs.h -> /home/pic32/pic32mx/include/cp0defs.h
|
||||
pic32-libs/include/peripheral/* -> /home/pic32/pic32mx/include/peripheral/*
|
||||
pic32-libs/include/p32xxxx.h -> /home/pic32/pic32mx/include/p32xxxx.h
|
||||
pic32-libs/include/plib.h -> /home/pic32/pic32mx/include/plib.h
|
||||
pic32-libs/include/proc/* -> /home/pic32/pic32mx/include/proc/*
|
||||
pic32-libs/include/sys/attribs.h -> /home/pic32/pic32mx/include/sys/attribs.h
|
||||
A similar example using csh:
|
||||
|
||||
pic32-libs/c/startup/crt0.S -> (the directory where you are reading this
|
||||
file)/newlib/libgloss/pic32mx/crt0.S
|
||||
setenv CC gcc
|
||||
./configure
|
||||
make
|
||||
|
||||
(you may need one or two other files, please let me know if thats the case)
|
||||
Much of the code and documentation enclosed is copyright by
|
||||
the Free Software Foundation, Inc. See the file COPYING or
|
||||
COPYING.LIB in the various directories, for a description of the
|
||||
GNU General Public License terms under which you can copy the files.
|
||||
|
||||
5) Now, you can build newlib ->
|
||||
cd into the newlib directory and type:
|
||||
"./configure --prefix=/home/pic32/ --target=pic32mx --enable-target-optspace --disable-newlib-atexit-alloc"
|
||||
(you can read about the options i used in the newlib documentation)
|
||||
|
||||
6) Now type "make" and go have a cup of coffee, or a beer :)
|
||||
|
||||
7) When finished, type "make install"
|
||||
|
||||
8) optional, edit the GCC Spec file to specify what default libs to include:
|
||||
/home/pic32/lib/gcc/pic32mx/3.4.4/specs
|
||||
Go to Line 51 and Change it so it looks like this:
|
||||
--start-group -lc -lm -le -lpic32 %{!mno-peripheral-libs:-lmchp_peripheral %{mprocessor=*:-lmchp_peripheral_%*}} --end-group
|
||||
(basically, remove -ldsp and replace with -lpic32)
|
||||
|
||||
Now, you are ready to go!
|
||||
|
||||
(for a Example Makefile, look in the example directory)
|
||||
REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
|
||||
on where and how to report problems.
|
||||
|
|
15
TODO
15
TODO
|
@ -1,15 +0,0 @@
|
|||
newlib/libgloss/pic32/exceptions.c
|
||||
* Code the Stack Save/Restore in _general_exception_context()
|
||||
* figure out why I can't have both a nomips16 and weak attribute on the
|
||||
same function
|
||||
|
||||
newlib/libgloss/pic32/crt0.S
|
||||
* either import Microchips version (after we get approval) or Write our own
|
||||
|
||||
newlib/libgloss/pic32/read.c, write.c
|
||||
* output to USART2 as per the standard Microchip libc
|
||||
|
||||
Misc:
|
||||
* Test atexit() function calls really do "run" when exit() is called
|
||||
* Check what other "syscalls" are missing from the pic32mx libgloss
|
||||
function (ie, libpic32.a - the Hardware Abrastraction Layer for newlib)
|
0
newlib/config.guess → config.guess
vendored
0
newlib/config.guess → config.guess
vendored
4
newlib/config.sub → config.sub
vendored
4
newlib/config.sub → config.sub
vendored
|
@ -894,10 +894,6 @@ case $basic_machine in
|
|||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pic32mx)
|
||||
basic_machine=pic32mx-mchp
|
||||
os=-elf
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue