##// END OF EJS Templates
LFR's Leon3 target added and and tested with simple hello world.
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr -
r13:8ca866292111 default
parent child
Show More
@@ -0,0 +1,4
1 int bsp_init()
2 {
3 return 1;
4 }
@@ -0,0 +1,1
1 extern int bsp_init();
@@ -0,0 +1,14
1 TEMPLATE = lib
2
3 lpc17XX.ARCH = sparc-elf-gcc
4 lpc17XX.TARGET = libbsp
5 lpc17XX.TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/LFR-142200
6 lpc17XX.HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LFR-142200
7 lpc17XX.LIBS +=
8 lpc17XX.SOURCES += bsp.c
9 lpc17XX.HEADERS += bsp.h
10
11
12
13
14
@@ -0,0 +1,9
1 TEMPLATE = dir
2 SUBDIRS += helloWorld \
3 IIRFilter
4
5
6
7
8
9
@@ -0,0 +1,12
1 TEMPLATE = app
2 ARCH = sparc-elf-gcc
3 TARGET = helloWorld
4 BSP = LFR-142200
5
6 LIBS += APB
7
8 SOURCES += main.c
9
10
11 HEADERS +=
12
@@ -0,0 +1,15
1 #include <stdio.h>
2 #include <bsp.h>
3
4
5 int main(void)
6 {
7 bsp_init();
8 printf("hello world");
9 return 0;
10 }
11
12
13
14
15
@@ -0,0 +1,122
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPP VHDL IP LIBRARY
3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
22 #include "apb.h"
23 #include <stdio.h>
24
25
26
27 int* apbgetdevice(int PID,int VID,int count)
28 {
29 struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD + sizeof(struct apbPnPreg));
30 int id;
31 id = (PID<<12) | (VID<<24);
32 while(dev != (struct apbPnPreg*)(APB_TBL_HEAD|0xFFF))
33 {
34 if((dev->idReg & 0xFFFFF000) == id)
35 {
36 if(count == 0)
37 {
38 return (int*) (APB_BASE_ADDRS | (dev->bar&0xFFF00000)>>12);
39 }
40 count-=1;
41 }
42 dev += 1;
43 }
44 return NULL;
45 }
46
47
48 void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo)
49 {
50
51 devinfo->productID = (dev->idReg>>12) & 0xFFF;
52 devinfo->vendorID = (dev->idReg>>24) & 0xFF;
53 devinfo->address = ((dev->bar>>12) & 0xFFF00)|APB_BASE_ADDRS;
54 devinfo->irq = dev->idReg & 0x1F;
55 devinfo->mask = (dev->bar>>4)&0xFFF;
56 devinfo->version = (dev->idReg>>5)&0x1F;
57 }
58
59 void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo)
60 {
61 struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD + sizeof(struct apbPnPreg));
62 int id;
63 id = (PID<<12) | (VID<<24);
64 while(dev != (struct apbPnPreg*)(APB_TBL_HEAD|0xFFF))
65 {
66 if((dev->idReg & 0xFFFFF000) == id)
67 {
68 if(count == 0)
69 {
70 devinfo->productID = PID;
71 devinfo->vendorID = VID;
72 devinfo->address = ((dev->bar>>12) & 0xFFF00)|APB_BASE_ADDRS;
73 devinfo->irq = dev->idReg & 0x1F;
74 devinfo->mask = (dev->bar>>4)&0xFFF;
75 devinfo->version = (dev->idReg>>5)&0x1F;
76 return;
77 }
78 count-=1;
79 }
80 dev += 1;
81 }
82 }
83
84
85
86 void apbprintdeviceinfo(struct apbdevinfo devinfo)
87 {
88 printf("Vendor ID = 0x%x\n",devinfo.vendorID);
89 printf("Product ID = 0x%x\n",devinfo.productID);
90 printf("Device address = 0x%x\n",devinfo.address);
91 printf("Device Irq = %d\n",devinfo.irq);
92 printf("Device mask = 0x%x\n",devinfo.mask);
93 printf("Device Version = %d\n",devinfo.version);
94 }
95
96
97 void apbprintdeviceslist()
98 {
99 struct apbdevinfo devinfo;
100 struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD );//+ sizeof(struct apbPnPreg));
101 int i =0;
102 int fisrtBAR;
103 while((dev->idReg == 0) && (i<APB_MAX_DEVICES))
104 {
105 dev += 1;
106 i+=1;
107 }
108 fisrtBAR = dev->bar;
109 for(i=i;i<APB_MAX_DEVICES;i++)
110 {
111 if((dev->idReg != 0 ))
112 {
113 apbgetdeviceinfofromdevptr(dev,&devinfo);
114 printf("\n\n======= new device found========\n");
115 apbprintdeviceinfo(devinfo);
116 }
117 dev += 1;
118 if(dev->bar == fisrtBAR)
119 break;
120 }
121 }
122
@@ -0,0 +1,135
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPP VHDL IP LIBRARY
3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
22 #ifndef LPP_APB_FUNCTIONS_H
23 #define LPP_APB_FUNCTIONS_H
24
25 #define APB_TBL_HEAD 0x800FF000 /**< Start address of APB devices list on AHB2APB bridge*/
26 #define APB_BASE_ADDRS 0x80000000 /**< Start address of APB bus*/
27 #define APB_MAX_DEVICES 256 /**< Maximun device count on APB bus*/
28
29 #include "apb_devices_list.h"
30
31
32 /*! \file lpp_apb_functions.h
33 \brief General purpose APB functions.
34
35 This library is written to work with AHB2APB VHDL module from Gaisler's GRLIB. It help you to find your device
36 on the APB bus by providing scan functions, it extract information such as device Version, IRQ value, Address mask.
37 You can use it to print the APB devices list on your SOC.
38
39 \author Alexis Jeandet alexis.jeandet@lpp.polytechnique.fr
40 \todo implemente a descriptor structure for any APB device
41
42 */
43
44
45 /*! \struct apbPnPreg
46 \brief Structure representing a device descriptor register on Grlib's AHB2APB brige with plug and play feature
47 */
48 struct apbPnPreg
49 {
50 int idReg; /**< \brief id register composed of Vendor ID [31:24], Device ID [23:12], CT [11:10], Version [9:5], IRQ [4:0] */
51 int bar; /**< \brief Bank Address Register composed of Device's ADDRESS [31:20], MASK [14:4], TYPE [3:0] */
52 };
53
54
55 /*! \struct apbdevinfo
56 \brief Structure holding an APB device informations
57
58 This information are extracted from the descriptor registers on Grlib's AHB2APB brige with plug and play feature
59 */
60 struct apbdevinfo
61 {
62 int vendorID; /**< \brief Stores the Vendor ID of the current device */
63 int productID; /**< \brief Stores the Product ID of the current device */
64 int version; /**< \brief Stores the Version of the current device */
65 int irq; /**< \brief Stores the interrupt Number of the current device */
66 int address; /**< \brief Stores the base address of the current device */
67 int mask; /**< \brief Stores the address mask of the current device, it gives the address space of this device */
68 };
69
70
71
72
73 /*! \fn int* apbgetdevice(int PID,int VID,int count);
74 \brief Find device with given VID/PID
75
76 This Function scans APB devices table and returns counth device according to VID and PID
77
78 \param PID The PID of the device you whant to get.
79 \param VID The VID of the device you whant to get.
80 \param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant
81 to use UART1 so count = 2.
82
83 \return The pointer to the device.
84 */
85 int* apbgetdevice(int PID,int VID,int count);
86
87 /*! \fn void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo);
88 \brief Record device informations with given VID/PID
89
90 This Function scans APB devices table and returns counth device informations according VID and PID.
91
92 \param PID The PID of the device you whant to get.
93 \param VID The VID of the device you whant to get.
94 \param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant
95 to use UART1 so count = 2.
96 \param devinfo The device information structure to be populated.
97 \example scanAPB.c
98 */
99 void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo);
100
101
102 /*! \fn void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo);
103 \brief Record device informations with given AHB2APB Plugn'Play register.
104
105 This Function extract device informations from the given AHB2APB Plugn'Play register end write them in devinfo.
106
107 \param dev AHB2APB Plugn'Play register corresponding to the device.
108 \param devinfo The device information structure to be populated.
109 */
110 void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo);
111
112
113
114 /*! \fn void apbprintdeviceinfo(struct apbdevinfo devinfo);
115 \brief Print given device informations in stdout.
116
117 \param devinfo The device information structure to be printed.
118 */
119 void apbprintdeviceinfo(struct apbdevinfo devinfo);
120
121
122
123 /*! \fn void apbprintdeviceslist();
124 \brief Print APB devices informations in stdout.
125
126 This function list all devices on APB bus and print theirs informations.
127
128 \example scanAPB.c
129 */
130 void apbprintdeviceslist();
131
132
133
134 #endif // LPP_APB_FUNCTIONS_H
135
@@ -0,0 +1,16
1 TEMPLATE = lib
2 ARCH = sparc-elf-gcc
3 TARGET = libapb
4 TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_APB)
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR_APB)
6
7 LIBS +=
8
9 SOURCES += apb.c
10
11
12 HEADERS += apb.h \
13 apb_devices_list.h
14
15
16
@@ -0,0 +1,25
1
2
3 /*===============================================================================
4
5 THIS FILE IS GENERATED BY A SCRIPT, DON'T TRY TO EDIT
6
7 TAKE A LOOK AT VHD_LIB/APB_DEVICES FOLDER TO ADD A DEVICE ID OR VENDOR ID
8
9 ===============================================================================*/
10 #define VENDOR_LPP 0x19
11
12 #define ROCKET_TM 0x1
13 #define otherCore 0x2
14 #define LPP_SIMPLE_DIODE 0x3
15 #define LPP_MULTI_DIODE 0x4
16 #define LPP_LCD_CTRLR 0x5
17 #define LPP_UART 0x6
18 #define LPP_CNA 0x7
19 #define LPP_APB_ADC 0x8
20 #define LPP_CHENILLARD 0x9
21 #define LPP_IIR_CEL_FILTER 0x10
22 #define LPP_FIFO_PID 0x11
23 #define LPP_FFT 0x12
24 #define LPP_MATRIX 0x13
25 #define LPP_BALISE 0x14
@@ -0,0 +1,5
1 TEMPLATE = dir
2 SUBDIRS += APB
3
4
5
@@ -8,6 +8,7 all:subdir
8 make -C LandTiger
8 make -C LandTiger
9 make -C LandTigerdualssp
9 make -C LandTigerdualssp
10 make -C mbed
10 make -C mbed
11 make -C LFR-142200
11 @echo Code compiled
12 @echo Code compiled
12
13
13 clean:
14 clean:
@@ -15,5 +16,6 clean:
15 make clean -C LandTiger
16 make clean -C LandTiger
16 make clean -C LandTigerdualssp
17 make clean -C LandTigerdualssp
17 make clean -C mbed
18 make clean -C mbed
19 make clean -C LFR-142200
18 @echo Code compiled
20 @echo Code compiled
19
21
@@ -2,4 +2,12 TEMPLATE = dir
2 SUBDIRS += generic \
2 SUBDIRS += generic \
3 LandTiger \
3 LandTiger \
4 LandTigerdualssp \
4 LandTigerdualssp \
5 mbed
5 mbed \
6 LFR-142200
7
8
9
10
11
12
13
@@ -2,29 +2,8
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4
4
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic
5 all:
6 HEADERS += bsp.h
6 make -f lpc17XX.mk
7 LIBSOURCES += bsp.c
8 OBJDIR = obj
9 BINDIR = bin
10 OBJECTFILES = $(LIBSOURCES:.c=.o)
11 OBJECTFILES := $(addprefix $(OBJDIR)/,$(OBJECTFILES))
12 ARCH = lpc17XX-arm-noabi-gcc
13 ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
14 TARGET=libbsp
15 LIBUC_INCLUDES=
16 LIBUC_LIBRARIES=
17 TARGETINSTALLPATH=$(LIBUC_BSP_BIN_DIR)/generic
18 HEADERSINSTALLPATH=$(LIBUC_BSP_INC_DIR)/generic
19 BSP=generic
20 include $(ARCHFOLDER)/rules.mk
21
22 all:lib
23 @echo Code compiled
24
7
25 clean:
8 clean:
26 rm -f $(OBJDIR)/*.o
9 make clean -f lpc17XX.mk
27 rm -f $(TARGETINSTALLPATH)/*.a
28 rm -f $(HEADERSINSTALLPATH)/*.h
29 rm -f $(DEVSOURCESND)
30 rm -f *.d
@@ -0,0 +1,4
1 int bsp_init()
2 {
3 return 1;
4 }
@@ -0,0 +1,1
1 extern int bsp_init();
@@ -1,12 +1,14
1 TEMPLATE = lib
1 TEMPLATE = lib
2 ARCH = lpc17XX-arm-noabi-gcc
3 TARGET = libbsp
4 TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/generic
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic
6
2
7 LIBS +=
3 lpc17XX.ARCH = lpc17XX-arm-noabi-gcc
8
4 lpc17XX.TARGET = libbsp
9 SOURCES += bsp.c
5 lpc17XX.TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/generic
6 lpc17XX.HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic
7 lpc17XX.LIBS +=
8 lpc17XX.SOURCES += bsp.c
9 lpc17XX.HEADERS += bsp.h
10
10
11
11
12 HEADERS += bsp.h
12
13
14
@@ -8,6 +8,7 all:subdir
8 make -C SDCARD
8 make -C SDCARD
9 make -C SDCARD2
9 make -C SDCARD2
10 make -C MP3Player
10 make -C MP3Player
11 make -C LFR
11 @echo Code compiled
12 @echo Code compiled
12
13
13 clean:
14 clean:
@@ -15,5 +16,6 clean:
15 make clean -C SDCARD
16 make clean -C SDCARD
16 make clean -C SDCARD2
17 make clean -C SDCARD2
17 make clean -C MP3Player
18 make clean -C MP3Player
19 make clean -C LFR
18 @echo Code compiled
20 @echo Code compiled
19
21
@@ -2,4 +2,11 TEMPLATE = dir
2 SUBDIRS += lpc17XX \
2 SUBDIRS += lpc17XX \
3 SDCARD \
3 SDCARD \
4 SDCARD2 \
4 SDCARD2 \
5 MP3Player
5 MP3Player \
6 LFR
7
8
9
10
11
12
@@ -30,16 +30,26
30 #define ledspos2 LED1_ON;LED2_OFF;LED3_ON;LED4_OFF;LED5_ON;LED6_OFF;LED7_ON;LED8_OFF
30 #define ledspos2 LED1_ON;LED2_OFF;LED3_ON;LED4_OFF;LED5_ON;LED6_OFF;LED7_ON;LED8_OFF
31 #define tableSize 256
31 #define tableSize 256
32
32
33 #define data0Size 3
34 volatile int16_t data0[data0Size] __attribute__ ((section (".testData"))) = {0x1234,0x4567,0xFF00};
35 const int* const test1[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
33
36
34 void eepromTest();
37 void eepromTest();
35
38
36 int main (void)
39 int main (void)
37 {
40 {
41 int i=0;
42 volatile int16_t* testptr = 0x2007C000 + (16*1024) - 6;
38 bsp_init();
43 bsp_init();
39 uartsetbaudrate(UART0,38400);
44 uartsetbaudrate(UART0,38400);
40 eepromTest();
45 eepromTest();
41 libucprintf("CPU Freq =%dMHz\n\r",currentCpuFreq/1000000);
46 libucprintf("CPU Freq =%dMHz\n\r",currentCpuFreq/1000000);
42 libucprintf("IIC Freq =%dKHz\n\r",i2cgetdatarate(IIC0)/1000);
47 libucprintf("IIC Freq =%dKHz\n\r",i2cgetdatarate(IIC0)/1000);
48 libucprintf("data0 = %x",data0);
49 for(i=0;i<data0Size;i++)
50 libucprintf("data0[%d] = %x",i,0xFFFF&data0[i]);
51 for(i=0;i<20;i++)
52 libucprintf("test1[%d] = %x",i,test1[i]);
43 while(1)
53 while(1)
44 {
54 {
45 ledspos1;
55 ledspos1;
@@ -7,6 +7,7 all:subdir
7 make -C common/UHANDLE
7 make -C common/UHANDLE
8 make -C lpc21XX
8 make -C lpc21XX
9 make -C lpc17XX
9 make -C lpc17XX
10 make -C LEON3
10 make -C common
11 make -C common
11 make -C apps
12 make -C apps
12 @echo Code compiled
13 @echo Code compiled
@@ -15,6 +16,7 clean:
15 make clean -C common/UHANDLE
16 make clean -C common/UHANDLE
16 make clean -C lpc21XX
17 make clean -C lpc21XX
17 make clean -C lpc17XX
18 make clean -C lpc17XX
19 make clean -C LEON3
18 make clean -C common
20 make clean -C common
19 make clean -C apps
21 make clean -C apps
20 @echo Code compiled
22 @echo Code compiled
@@ -2,103 +2,124
2 # LIBRARY DEFINITIONS
2 # LIBRARY DEFINITIONS
3 #---------------------------------------------------------------------------------
3 #---------------------------------------------------------------------------------
4 LIBUC_LIBS =
4 LIBUC_LIBS =
5 LIBUC_LIBS_CORE = -static -lcore
5
6 LIBUC_LIBS_UCSTRINGS = -static -lucstrings
6 LIBUC_LIBS_CORE = -static -lcore
7 LIBUC_LIBS_UART = -static -luart
7 LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE
8 LIBUC_LIBS_SPI = -static -lspi
8 LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE)
9 LIBUC_LIBS_SSP = -static -lssp
9 LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE
10 LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE)
11
12 LIBUC_LIBS_APB = -static -lapb
13 LIBUC_LIBS_DIR_APB = $(LIBUC_LIBS_DIR)/APB
14 LIBUC_LIBS_DIR_APB_CMD = -L $(LIBUC_LIBS_DIR_APB)
15 LIBUC_INC_DIR_APB = $(LIBUC_INC_DIR)/APB
16 LIBUC_INC_DIR_APB_CMD = -I $(LIBUC_INC_DIR_APB)
17
18 LIBUC_LIBS_UCSTRINGS = -static -lucstrings
19 LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH)
20 LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS)
21 LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH)
22 LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS)
23
24 LIBUC_LIBS_UART = -static -luart
25 LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART
26 LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART)
27 LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART
28 LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART)
29
30 LIBUC_LIBS_SPI = -static -lspi
31 LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI
32 LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI)
33 LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI
34 LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI)
35
36 LIBUC_LIBS_SSP = -static -lssp
37 LIBUC_LIBS_DIR_SSP = $(LIBUC_LIBS_DIR)/SSP
38 LIBUC_LIBS_DIR_SSP_CMD = -L $(LIBUC_LIBS_DIR_SSP)
39 LIBUC_INC_DIR_SSP = $(LIBUC_INC_DIR)/SSP
40 LIBUC_INC_DIR_SSP_CMD = -I $(LIBUC_INC_DIR_SSP)
41
10 LIBUC_LIBS_IIC = -static -liic
42 LIBUC_LIBS_IIC = -static -liic
43 LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC
44 LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC)
45 LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC
46 LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC)
47
11 LIBUC_LIBS_ADC = -static -ladc
48 LIBUC_LIBS_ADC = -static -ladc
12 LIBUC_LIBS_24LC0X = -static -l24lc0X
49 LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC
13 LIBUC_LIBS_SDCARD = -static -lsdcard
50 LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC)
14 LIBUC_LIBS_BLKDEVICE = -static -lblkdevice
51 LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC
15 LIBUC_LIBS_FAT32 = -static -lfat32
52 LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC)
16 LIBUC_LIBS_VS10XX = -static -lvs10XX
17 LIBUC_LIBS_UHANDLE = -static -luhandle
18 LIBUC_LIBS_HEXVIEWER = -static -lhexviewer
19 LIBUC_LIBS_MBR = -static -lmbr
20 LIBUC_LIBS_UCDIRENT = -static -lucdirent
21 LIBUC_LIBS_FS = -static -lfs
22 LIBUC_LIBS_ALLFS = $(LIBUC_LIBS_UCDIRENT) $(LIBUC_LIBS_FS) $(LIBUC_LIBS_MBR) $(LIBUC_LIBS_FAT32) $(LIBUC_LIBS_SDCARD) $(LIBUC_LIBS_BLKDEVICE)
23 LIBUC_LIBS_FSEXPLORER = -static -lfsexplorer
24
53
25 LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE
54 LIBUC_LIBS_24LC0X = -static -l24lc0X
26 LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH)
27 LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART
28 LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI
29 LIBUC_LIBS_DIR_SSP = $(LIBUC_LIBS_DIR)/SSP
30 LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC
31 LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC
32 LIBUC_LIBS_DIR_24LC0X = $(LIBUC_LIBS_DIR)/24LCXX/24LC0X
55 LIBUC_LIBS_DIR_24LC0X = $(LIBUC_LIBS_DIR)/24LCXX/24LC0X
33 LIBUC_LIBS_DIR_SDCARD = $(LIBUC_LIBS_DIR)/SDCARD
56 LIBUC_LIBS_DIR_24LC0X_CMD = -L $(LIBUC_LIBS_DIR_24LC0X)
34 LIBUC_LIBS_DIR_VS10XX = $(LIBUC_LIBS_DIR)/VS10XX
57 LIBUC_INC_DIR_24LC0X = $(LIBUC_INC_DIR)/24LCXX/24LC0X
35 LIBUC_LIBS_DIR_BLKDEVICE = $(LIBUC_LIBS_DIR)/BLKDEVICE
58 LIBUC_INC_DIR_24LC0X_CMD = -I $(LIBUC_INC_DIR_24LC0X)
36 LIBUC_LIBS_DIR_FAT32 = $(LIBUC_LIBS_DIR)/FAT32
37 LIBUC_LIBS_DIR_UHANDLE = $(LIBUC_LIBS_DIR)/UHANDLE
38 LIBUC_LIBS_DIR_HEXVIEWER = $(LIBUC_LIBS_DIR)/HEXVIEWER
39 LIBUC_LIBS_DIR_MBR = $(LIBUC_LIBS_DIR)/MBR
40 LIBUC_LIBS_DIR_UCDIRENT = $(LIBUC_LIBS_DIR)/UCDIRENT
41 LIBUC_LIBS_DIR_FS = $(LIBUC_LIBS_DIR)/FS
42 LIBUC_LIBS_DIR_FSEXPLORER = $(LIBUC_LIBS_DIR)/FSEXPLORER
43
59
44 LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE)
60 LIBUC_LIBS_SDCARD = -static -lsdcard
45 LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS)
61 LIBUC_LIBS_DIR_SDCARD = $(LIBUC_LIBS_DIR)/SDCARD
46 LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART)
62 LIBUC_LIBS_DIR_SDCARD_CMD = -L $(LIBUC_LIBS_DIR_SDCARD)
47 LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI)
63 LIBUC_INC_DIR_SDCARD = $(LIBUC_INC_DIR)/SDCARD
48 LIBUC_LIBS_DIR_SSP_CMD = -L $(LIBUC_LIBS_DIR_SSP)
64 LIBUC_INC_DIR_SDCARD_CMD = -I $(LIBUC_INC_DIR_SDCARD)
49 LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC)
65
50 LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC)
66 LIBUC_LIBS_VS10XX = -static -lvs10XX
51 LIBUC_LIBS_DIR_24LC0X_CMD = -L $(LIBUC_LIBS_DIR_24LC0X)
67 LIBUC_LIBS_DIR_VS10XX = $(LIBUC_LIBS_DIR)/VS10XX
52 LIBUC_LIBS_DIR_SDCARD_CMD = -L $(LIBUC_LIBS_DIR_SDCARD)
68 LIBUC_LIBS_DIR_VS10XX_CMD = -L $(LIBUC_LIBS_DIR_VS10XX)
53 LIBUC_LIBS_DIR_VS10XX_CMD = -L $(LIBUC_LIBS_DIR_VS10XX)
69 LIBUC_INC_DIR_VS10XX = $(LIBUC_INC_DIR)/VS10XX
54 LIBUC_LIBS_DIR_BLKDEVICE_CMD = -L $(LIBUC_LIBS_DIR_BLKDEVICE)
70 LIBUC_INC_DIR_VS10XX_CMD = -I $(LIBUC_INC_DIR_VS10XX)
55 LIBUC_LIBS_DIR_FAT32_CMD = -L $(LIBUC_LIBS_DIR_FAT32)
71
56 LIBUC_LIBS_DIR_UHANDLE_CMD = -L $(LIBUC_LIBS_DIR_UHANDLE)
72 LIBUC_LIBS_BLKDEVICE = -static -lblkdevice
57 LIBUC_LIBS_DIR_HEXVIEWER_CMD = -L $(LIBUC_LIBS_DIR_HEXVIEWER)
73 LIBUC_LIBS_DIR_BLKDEVICE = $(LIBUC_LIBS_DIR)/BLKDEVICE
58 LIBUC_LIBS_DIR_MBR_CMD = -L $(LIBUC_LIBS_DIR_MBR)
74 LIBUC_LIBS_DIR_BLKDEVICE_CMD = -L $(LIBUC_LIBS_DIR_BLKDEVICE)
59 LIBUC_LIBS_DIR_UCDIRENT_CMD = -L $(LIBUC_LIBS_DIR_UCDIRENT)
75 LIBUC_INC_DIR_BLKDEVICE = $(LIBUC_INC_DIR)/BLKDEVICE
60 LIBUC_LIBS_DIR_FS_CMD = -L $(LIBUC_LIBS_DIR_FS)
76 LIBUC_INC_DIR_BLKDEVICE_CMD = -I $(LIBUC_INC_DIR_BLKDEVICE)
61 LIBUC_LIBS_DIR_ALLFS_CMD = $(LIBUC_LIBS_DIR_UCDIRENT_CMD) $(LIBUC_LIBS_DIR_FS_CMD) $(LIBUC_LIBS_DIR_MBR_CMD) $(LIBUC_LIBS_DIR_FAT32_CMD) $(LIBUC_LIBS_DIR_SDCARD_CMD) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD)
77
62 LIBUC_LIBS_DIR_FSEXPLORER_CMD = -L $(LIBUC_LIBS_DIR_FSEXPLORER)
78 LIBUC_LIBS_FAT32 = -static -lfat32
79 LIBUC_LIBS_DIR_FAT32 = $(LIBUC_LIBS_DIR)/FAT32
80 LIBUC_LIBS_DIR_FAT32_CMD = -L $(LIBUC_LIBS_DIR_FAT32)
81 LIBUC_INC_DIR_FAT32 = $(LIBUC_INC_DIR)/FAT32
82 LIBUC_INC_DIR_FAT32_CMD = -I $(LIBUC_INC_DIR_FAT32)
83
84 LIBUC_LIBS_UHANDLE = -static -luhandle
85 LIBUC_LIBS_DIR_UHANDLE = $(LIBUC_LIBS_DIR)/UHANDLE
86 LIBUC_LIBS_DIR_UHANDLE_CMD = -L $(LIBUC_LIBS_DIR_UHANDLE)
87 LIBUC_INC_DIR_UHANDLE = $(LIBUC_INC_DIR)/UHANDLE
88 LIBUC_INC_DIR_UHANDLE_CMD = -I $(LIBUC_INC_DIR_UHANDLE)
63
89
64 LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE
90 LIBUC_LIBS_HEXVIEWER = -static -lhexviewer
65 LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH)
91 LIBUC_LIBS_DIR_HEXVIEWER = $(LIBUC_LIBS_DIR)/HEXVIEWER
66 LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART
92 LIBUC_LIBS_DIR_HEXVIEWER_CMD = -L $(LIBUC_LIBS_DIR_HEXVIEWER)
67 LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI
93 LIBUC_INC_DIR_HEXVIEWER = $(LIBUC_INC_DIR)/HEXVIEWER
68 LIBUC_INC_DIR_SSP = $(LIBUC_INC_DIR)/SSP
94 LIBUC_INC_DIR_HEXVIEWER_CMD = -I $(LIBUC_INC_DIR_HEXVIEWER)
69 LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC
95
70 LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC
96 LIBUC_LIBS_MBR = -static -lmbr
71 LIBUC_INC_DIR_24LC0X = $(LIBUC_INC_DIR)/24LCXX/24LC0X
97 LIBUC_LIBS_DIR_MBR = $(LIBUC_LIBS_DIR)/MBR
72 LIBUC_INC_DIR_SDCARD = $(LIBUC_INC_DIR)/SDCARD
98 LIBUC_LIBS_DIR_MBR_CMD = -L $(LIBUC_LIBS_DIR_MBR)
73 LIBUC_INC_DIR_VS10XX = $(LIBUC_INC_DIR)/VS10XX
99 LIBUC_INC_DIR_MBR = $(LIBUC_INC_DIR)/MBR
74 LIBUC_INC_DIR_BLKDEVICE = $(LIBUC_INC_DIR)/BLKDEVICE
100 LIBUC_INC_DIR_MBR_CMD = -I $(LIBUC_INC_DIR_MBR)
75 LIBUC_INC_DIR_FAT32 = $(LIBUC_INC_DIR)/FAT32
76 LIBUC_INC_DIR_UHANDLE = $(LIBUC_INC_DIR)/UHANDLE
77 LIBUC_INC_DIR_HEXVIEWER = $(LIBUC_INC_DIR)/HEXVIEWER
78 LIBUC_INC_DIR_MBR = $(LIBUC_INC_DIR)/MBR
79 LIBUC_INC_DIR_UCDIRENT = $(LIBUC_INC_DIR)/UCDIRENT
80 LIBUC_INC_DIR_FS = $(LIBUC_INC_DIR)/FS
81 LIBUC_INC_DIR_FSEXPLORER = $(LIBUC_INC_DIR)/FSEXPLORER
82
101
83 LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE)
102 LIBUC_LIBS_UCDIRENT = -static -lucdirent
84 LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS)
103 LIBUC_LIBS_DIR_UCDIRENT = $(LIBUC_LIBS_DIR)/UCDIRENT
85 LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART)
104 LIBUC_LIBS_DIR_UCDIRENT_CMD = -L $(LIBUC_LIBS_DIR_UCDIRENT)
86 LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI)
105 LIBUC_INC_DIR_UCDIRENT = $(LIBUC_INC_DIR)/UCDIRENT
87 LIBUC_INC_DIR_SSP_CMD = -I $(LIBUC_INC_DIR_SSP)
106 LIBUC_INC_DIR_UCDIRENT_CMD = -I $(LIBUC_INC_DIR_UCDIRENT)
88 LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC)
107
89 LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC)
108 LIBUC_LIBS_FS = -static -lfs
90 LIBUC_INC_DIR_24LC0X_CMD = -I $(LIBUC_INC_DIR_24LC0X)
109 LIBUC_LIBS_DIR_FS = $(LIBUC_LIBS_DIR)/FS
91 LIBUC_INC_DIR_SDCARD_CMD = -I $(LIBUC_INC_DIR_SDCARD)
110 LIBUC_LIBS_DIR_FS_CMD = -L $(LIBUC_LIBS_DIR_FS)
92 LIBUC_INC_DIR_VS10XX_CMD = -I $(LIBUC_INC_DIR_VS10XX)
111 LIBUC_INC_DIR_FS = $(LIBUC_INC_DIR)/FS
93 LIBUC_INC_DIR_BLKDEVICE_CMD = -I $(LIBUC_INC_DIR_BLKDEVICE)
112 LIBUC_INC_DIR_FS_CMD = -I $(LIBUC_INC_DIR_FS)
94 LIBUC_INC_DIR_FAT32_CMD = -I $(LIBUC_INC_DIR_FAT32)
113
95 LIBUC_INC_DIR_UHANDLE_CMD = -I $(LIBUC_INC_DIR_UHANDLE)
114 LIBUC_LIBS_FSEXPLORER = -static -lfsexplorer
96 LIBUC_INC_DIR_HEXVIEWER_CMD = -I $(LIBUC_INC_DIR_HEXVIEWER)
115 LIBUC_LIBS_DIR_FSEXPLORER = $(LIBUC_LIBS_DIR)/FSEXPLORER
97 LIBUC_INC_DIR_MBR_CMD = -I $(LIBUC_INC_DIR_MBR)
116 LIBUC_LIBS_DIR_FSEXPLORER_CMD = -L $(LIBUC_LIBS_DIR_FSEXPLORER)
98 LIBUC_INC_DIR_UCDIRENT_CMD = -I $(LIBUC_INC_DIR_UCDIRENT)
117 LIBUC_INC_DIR_FSEXPLORER = $(LIBUC_INC_DIR)/FSEXPLORER
99 LIBUC_INC_DIR_FS_CMD = -I $(LIBUC_INC_DIR_FS)
118 LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LIBUC_INC_DIR_FSEXPLORER)
100 LIBUC_INC_DIR_ALLFS_CMD = $(LIBUC_INC_DIR_UCDIRENT_CMD) $(LIBUC_INC_DIR_FS_CMD) $(LIBUC_INC_DIR_MBR_CMD) $(LIBUC_INC_DIR_FAT32_CMD) $(LIBUC_INC_DIR_SDCARD_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD)
119
101 LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LIBUC_INC_DIR_FSEXPLORER)
120 LIBUC_LIBS_DIR_ALLFS_CMD = $(LIBUC_LIBS_DIR_UCDIRENT_CMD) $(LIBUC_LIBS_DIR_FS_CMD) $(LIBUC_LIBS_DIR_MBR_CMD) $(LIBUC_LIBS_DIR_FAT32_CMD) $(LIBUC_LIBS_DIR_SDCARD_CMD) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD)
121 LIBUC_INC_DIR_ALLFS_CMD = $(LIBUC_INC_DIR_UCDIRENT_CMD) $(LIBUC_INC_DIR_FS_CMD) $(LIBUC_INC_DIR_MBR_CMD) $(LIBUC_INC_DIR_FAT32_CMD) $(LIBUC_INC_DIR_SDCARD_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD)
122 LIBUC_LIBS_ALLFS = $(LIBUC_LIBS_UCDIRENT) $(LIBUC_LIBS_FS) $(LIBUC_LIBS_MBR) $(LIBUC_LIBS_FAT32) $(LIBUC_LIBS_SDCARD) $(LIBUC_LIBS_BLKDEVICE)
102
123
103
124
104
125
@@ -110,3 +131,21 LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LI
110
131
111
132
112
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@@ -45,6 +45,15 SECTIONS
45 *(.rodata .rodata*)
45 *(.rodata .rodata*)
46 *(.gnu.linkonce.r.*)
46 *(.gnu.linkonce.r.*)
47 } >IROM
47 } >IROM
48 .testData :
49 {
50 _sitestdata = LOADADDR (.testData);
51 . = ALIGN(4);
52 _stestdata = .;
53 *(.testData .testData.*)
54 . = ALIGN(4);
55 _etestdata = . ;
56 } >IRAM1 AT >IROM
48
57
49 /******************************************/
58 /******************************************/
50 /* .ctors .dtors are used for c++ constructors/destructors */
59 /* .ctors .dtors are used for c++ constructors/destructors */
@@ -85,6 +85,10 extern unsigned long _etext;
85 extern unsigned long _sidata; /* start address for the initialization values of the .data section. defined in linker script */
85 extern unsigned long _sidata; /* start address for the initialization values of the .data section. defined in linker script */
86 extern unsigned long _sdata; /* start address for the .data section. defined in linker script */
86 extern unsigned long _sdata; /* start address for the .data section. defined in linker script */
87 extern unsigned long _edata; /* end address for the .data section. defined in linker script */
87 extern unsigned long _edata; /* end address for the .data section. defined in linker script */
88 extern unsigned long _sitestdata; /* start address for the initialization values of the .data section. defined in linker script */
89 extern unsigned long _stestdata; /* start address for the .data section. defined in linker script */
90 extern unsigned long _etestdata;
91
88
92
89 extern unsigned long _sifastcode; /* start address for the initialization values of the .fastcode section. defined in linker script */
93 extern unsigned long _sifastcode; /* start address for the initialization values of the .fastcode section. defined in linker script */
90 extern unsigned long _sfastcode; /* start address for the .fastcode section. defined in linker script */
94 extern unsigned long _sfastcode; /* start address for the .fastcode section. defined in linker script */
@@ -199,6 +203,12 void Reset_Handler(void)
199 *(pulDest++) = *(pulSrc++);
203 *(pulDest++) = *(pulSrc++);
200 }
204 }
201 }
205 }
206 if (&_sitestdata != &_stestdata) { // only if needed
207 pulSrc = &_sitestdata;
208 for(pulDest = &_stestdata; pulDest < &_etestdata; ) {
209 *(pulDest++) = *(pulSrc++);
210 }
211 }
202
212
203 // Copy the .fastcode code from ROM to SRAM
213 // Copy the .fastcode code from ROM to SRAM
204
214
@@ -1,92 +1,156
1 #/*------------------------------------------------------------------------------
1 #/*------------------------------------------------------------------------------
2 #-- This file is a part of the libuc, microcontroler library
2 #-- This file is a part of the libuc, microcontroler library
3 #-- Copyright (C) 2011, Alexis Jeandet
3 #-- Copyright (C) 2011, Alexis Jeandet
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
19 #-- Author : Alexis Jeandet
19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@gmail.com
21 #-------------------------------------------------------------------------------*/
21 #-------------------------------------------------------------------------------*/
22
22
23 #---------------------------------------------------------------------------------
23 #---------------------------------------------------------------------------------
24 # GCC EXECUTABLES
24 # GCC EXECUTABLES
25 #---------------------------------------------------------------------------------
25 #---------------------------------------------------------------------------------
26 LIBUC_PREFIX = sparc-elf-
26 LIBUC_PREFIX = sparc-elf-
27 LIBUC_CC = $(LIBUC_PREFIX)gcc
27 LIBUC_CC = $(LIBUC_PREFIX)gcc
28 LIBUC_CXX = $(LIBUC_PREFIX)g++
28 LIBUC_CXX = $(LIBUC_PREFIX)g++
29 LIBUC_AR = $(LIBUC_PREFIX)ar
29 LIBUC_AR = $(LIBUC_PREFIX)ar
30 LIBUC_SIZE = $(LIBUC_PREFIX)size
30 LIBUC_AS = $(LIBUC_PREFIX)as
31 LIBUC_READELF = $(LIBUC_PREFIX)readelf
31 LIBUC_LD = $(LIBUC_PREFIX)ld
32 LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy
32 LIBUC_SIZE = $(LIBUC_PREFIX)size
33
33 LIBUC_STRIP = $(LIBUC_PREFIX)strip -s
34
34 LIBUC_READELF = $(LIBUC_PREFIX)readelf
35
35 LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy
36 #---------------------------------------------------------------------------------
36 LIBUC_OBJDUMP=$(LIBUC_PREFIX)objdump
37 # GCC FLAGS
37
38 #---------------------------------------------------------------------------------
38
39 LIBUC_FMCU =
39
40 LIBUC_CFLAGS = $(LIBUC_FMCU)
40 #---------------------------------------------------------------------------------
41 LIBUC_CFLAGS_WARN_ON = -Wall
41 # GCC FLAGS
42 LIBUC_CFLAGS_WARN_OFF = -w
42 #---------------------------------------------------------------------------------
43 LIBUC_CFLAGS_RELEASE = -O2
43 LIBUC_FMCU =
44 LIBUC_CFLAGS_DEBUG = -g
44 LIBUC_CFLAGS = $(LIBUC_FMCU)
45 LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
45 LIBUC_CFLAGS = --std=gnu99 -fgnu89-inline
46 LIBUC_CFLAGS_STATIC_LIB += -fPIC
46 LIBUC_CFLAGS +=
47 LIBUC_CFLAGS_SOFT_FPU = -msoft-float
47 LIBUC_LDFLAGS =
48 LIBUC_CFLAGS_HARD_FPU =
48 LIBUC_ODFLAGS = -x --syms
49
49 LIBUC_CPFLAGS =
50 LIBUC_CXXFLAGS = $(LIBUC_FMCU)
50 LIBUC_CFLAGS_WARN_ON = -Wall
51 LIBUC_CXXFLAGS_WARN_ON = -Wall
51 LIBUC_CFLAGS_WARN_OFF = -w
52 LIBUC_CXXFLAGS_WARN_OFF = -w
52 LIBUC_CFLAGS_RELEASE = -O2
53 LIBUC_CXXFLAGS_RELEASE = -O2
53 LIBUC_CFLAGS_DEBUG = -g
54 LIBUC_CXXFLAGS_DEBUG = -g
54 LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
55 LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
55 LIBUC_CFLAGS_STATIC_LIB = -fPIC
56 LIBUC_CXXFLAGS_STATIC_LIB = -fPIC
56 LIBUC_CFLAGS_SOFT_FPU = -msoft-float
57 LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float
57 LIBUC_CFLAGS_HARD_FPU =
58 LIBUC_CXXFLAGS_HARD_FPU =
58
59
59 LIBUC_CXXFLAGS = $(LIBUC_FMCU)
60 LIBUC_LIBS =
60 LIBUC_CXXFLAGS += -g -gdwarf-2
61 LIBUC_LIBS_UART = -luart
61 LIBUC_CXXFLAGS += -Wextra -Wundef -Wcast-align -msoft-float
62 LIBUC_LIBS_SPI = -lspi
62 LIBUC_CXXFLAGS_WARN_ON = -Wall
63 LIBUC_LIBS_IIC = -liic
63 LIBUC_CXXFLAGS_WARN_OFF = -w
64 LIBUC_LIBS_ADC = -ladc
64 LIBUC_CXXFLAGS_RELEASE = -O2
65 LIBUC_LIBS_APB = -ladc
65 LIBUC_CXXFLAGS_DEBUG = -g
66
66 LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
67 LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/LEON3
67 LIBUC_CXXFLAGS_STATIC_LIB = -fPIC
68 LIBUC_LIBS_DIR_UART = -L $(LIBUC_LIBS_DIR)/UART
68 LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float
69 LIBUC_LIBS_DIR_SPI = -L $(LIBUC_LIBS_DIR)/SPI
69 LIBUC_CXXFLAGS_HARD_FPU =
70 LIBUC_LIBS_DIR_IIC = -L $(LIBUC_LIBS_DIR)/IIC
70
71 LIBUC_LIBS_DIR_ADC = -L $(LIBUC_LIBS_DIR)/ADC
71 #---------------------------------------------------------------------------------
72 LIBUC_LIBS_DIR_APB = -L $(LIBUC_LIBS_DIR)/APB
72 # LIBRARY DEFINITIONS
73
73 #---------------------------------------------------------------------------------
74
74
75 LIBUC_INC_DIR = $(LIBUC)/lib/includes/LEON
75 LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/LEON3
76 LIBUC_INC_DIR_UART = -L $(LIBUC_INC_DIR)/UART
76 LIBUC_INC_DIR = $(LIBUC)/lib/includes/LEON3
77 LIBUC_INC_DIR_SPI = -L $(LIBUC_INC_DIR)/SPI
77 include $(LIBUC)/rules/common/libsrules.mk
78 LIBUC_INC_DIR_IIC = -L $(LIBUC_INC_DIR)/IIC
78
79 LIBUC_INC_DIR_ADC = -L $(LIBUC_INC_DIR)/ADC
79 #---------------------------------------------------------------------------------
80 LIBUC_INC_DIR_APB = -L $(LIBUC_INC_DIR)/APB
80 # BOARD SUPORT PACKAGES
81
81 #---------------------------------------------------------------------------------
82
82 LIBUC_BSP_DIR=$(LIBUC)/bsp
83
83 LIBUC_BSP_BIN_DIR= $(LIBUC_BSP_DIR)/bin
84
84 LIBUC_BSP_INC_DIR= $(LIBUC_BSP_DIR)/includes
85
85 LIBUC_BSP = -L $(LIBUC_BSP_BIN_DIR)/$(BSP) -static -lbsp
86
86 LIBUC_BSP_INC = -I $(LIBUC_BSP_INC_DIR)/$(BSP)
87
87 #---------------------------------------------------------------------------------
88
88 # DEVICE SPECIAL FILES
89
89 #---------------------------------------------------------------------------------
90
90
91
91
92
92
93 #---------------------------------------------------------------------------------
94 # RULES
95 #---------------------------------------------------------------------------------
96
97 all:
98 @echo "sparc-elf-gcc rules"
99
100
101 bin: $(BINDIR)/$(TARGET).bin $(BINDIR)/$(TARGET).hex
102 @echo "compile bin"
103
104
105
106 lib: $(TARGETINSTALLPATH)/$(TARGET).a
107 @echo "compile lib"
108
109 %.a: $(OBJECTFILES)
110 mkdir -p $(TARGETINSTALLPATH)
111 mkdir -p $(HEADERSINSTALLPATH)
112 $(LIBUC_AR) rcs $@ $(OBJECTFILES) #$(LIBUC_AR) rcs $(TARGETINSTALLPATH)/$@ $(OBJECTFILES)
113 cp -f $(HEADERS) $(HEADERSINSTALLPATH)/
114
115
116
117 $(OBJECTFILES) : $(OBJDIR)/%.o : %.c $(INC_LIBS_DEPS) $(HEADERS)
118 mkdir -p $(OBJDIR)
119 $(LIBUC_CC) -O3 -I $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -c $(LIBUC_CFLAGS) $< -o $@
120
121
122 %.elf: $(OBJECTFILES)
123 mkdir -p $(BINDIR)
124 $(LIBUC_CC) $(LIBUC_LDFLAGS) $^ -o $@ $(LIBUC_BSP) $(LIBUC_LIBRARIES)
125
126
127 %.bin: %.elf $(BIN_LIBS_DEPS)
128 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O binary $< $*.bin
129
130
131 %.hex: %.elf
132 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O ihex $< $*.hex
133
134
135 clean:
136 rm -f *.o *.d *.bin *.hex *.dump *.map *.a
137 rm -f $(OBJECTFILES)
138 rm -f $(BINDIR)/*.bin
139 rm -f $(BINDIR)/*.hex
140 rm -f $(BINDIR)/*.dump
141 rm -f $(BINDIR)/*.map
142 rm -f $(BINDIR)/*.a
143 rm -f $(DEVSOURCESND)
144
145 distclean:
146 rm -f $(TARGETINSTALLPATH)/*.bin
147 rm -f $(TARGETINSTALLPATH)/*.a
148
149
150
151
152
153
154
155
156
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (530 lines changed) Show them Hide them
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now