make*** Error 1 lpc1769

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

make*** Error 1 lpc1769

488 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Zahoq on Wed Jan 07 18:02:56 MST 2015
Hello Everyone!

I work with LPCXPRESSO LPC1769, subject is fresh for me. I did project which has to control SHT71 sensor and send that data via uart and ethernet. I tried to convert periph_ethernet example into another file with functions that I'll use in main function. So I adapted enet.c by changing whole int main into:
void ETH_communication(int data1, int data2, int t)
{
uint8_t macaddr[6], *workbuff;
uint32_t physts = 0;
int32_t rxBytes, i;
bool ethpkttgl = true;
volatile int k = 1;
int data3, data4, data5, data6;
data3 = floor(data1/10);
data4 = data1 - data3*10;
data5 = floor(data2/10);
data6 = data2 - data5*10;
SystemCoreClockUpdate();
Board_Init();

/* LED0 is used for the link status, on = PHY cable detected */
/* Initial LED state is off to show an unconnected cable state */
Board_LED_Set(0, false);

/* Setup ethernet and PHY */
#if defined(USE_RMII)
Chip_ENET_Init(LPC_ETHERNET, true);

#else
Chip_ENET_Init(LPC_ETHERNET, false);
#endif

/* Setup MII clock rate and PHY address */
Chip_ENET_SetupMII(LPC_ETHERNET, Chip_ENET_FindMIIDiv(LPC_ETHERNET, 2500000), 1);

lpc_phy_init(true, localMsDelay);

/* Setup MAC address for device */
Board_ENET_GetMacADDR(macaddr);
Chip_ENET_SetADDR(LPC_ETHERNET, macaddr);

/* Setup descriptors */
InitDescriptors();

/* Enable RX/TX after descriptors are setup */
Chip_ENET_TXEnable(LPC_ETHERNET);
Chip_ENET_RXEnable(LPC_ETHERNET);
/* Only if link detected */
if (physts & PHY_LINK_CONNECTED) {
workbuff = ENET_TXBuffGet();
if (workbuff) {
/* Destination is broadcast */
for (i = 0; i < 6; i++) {
workbuff = 0xFF;
}

/* Source is this MAC address */
memcpy(&workbuff[6], macaddr, 6);

/* Size will be 128 bytes (total) */
workbuff[12] = 0;
workbuff[13] = 64;
if(t==1)
{
workbuff[14]=1;
}
if(t==0)
{
workbuff[14]=0;
}
workbuff[14] = data3;
workbuff[15] = data4;
workbuff[16] = data5;
workbuff[17] = data6;

/* Some dummy data, fill beyond end of packet */
for (i = 0; i < 128; i++) {
workbuff[i + 14] = i;                          //(uint8_t) (i & 0xFF);
}

ENET_TXQueue(128);
DEBUGOUT("Packet sent! \r\n");
Board_LED_Set(1, true);
}
}
if (ENET_IsTXFinish()) {
Board_LED_Set(1, false);
}
/* PHY status state machine, LED on when connected. This function will
   not block. */
physts = lpcPHYStsPoll();

/* Only check for connection state when the PHY status has changed */
if (physts & PHY_LINK_CHANGED) {
if (physts & PHY_LINK_CONNECTED) {
Board_LED_Set(0, true);

/* Set interface speed and duplex */
if(physts & PHY_LINK_FULLDUPLX)
Chip_ENET_SetFullDuplex(LPC_ETHERNET);
else
Chip_ENET_SetHalfDuplex(LPC_ETHERNET);
if(physts & PHY_LINK_SPEED100)
Chip_ENET_Set100Mbps(LPC_ETHERNET);
else
Chip_ENET_Set10Mbps(LPC_ETHERNET);
}
else {
Board_LED_Set(0, false);
}

DEBUGOUT("Link connect status: %d\r\n", ((physts & PHY_LINK_CONNECTED) != 0));
}
}


And created simple enet.h:
/*
 * enet.h
 *
 *  Created on: 8 sty 2015
 *      Author: Zahoq
 */

#ifndef ENET_H_
#define ENET_H_

#define ENET_NUM_TX_DESC 4
#define ENET_NUM_RX_DESC 4

#if defined(CHIP_LPC175X_6X)
#define ENET_RX_DESC_BASE        (0x2007C000)
#else
/* The Ethernet Block can only access Peripheral SRAM and External Memory. In this example,
   Peripheral SRAM is selected for storing descriptors, status arrays and send/receive buffers.*/
#define ENET_RX_DESC_BASE        (0x20000000UL)
#endif
#define ENET_RX_STAT_BASE        (ENET_RX_DESC_BASE + ENET_NUM_RX_DESC * sizeof(ENET_RXDESC_T))
#define ENET_TX_DESC_BASE        (ENET_RX_STAT_BASE + ENET_NUM_RX_DESC * sizeof(ENET_RXSTAT_T))
#define ENET_TX_STAT_BASE        (ENET_TX_DESC_BASE + ENET_NUM_TX_DESC * sizeof(ENET_TXDESC_T))
#define ENET_RX_BUF_BASE         (ENET_TX_STAT_BASE + ENET_NUM_TX_DESC * sizeof(ENET_TXSTAT_T))
#define ENET_TX_BUF_BASE         (ENET_RX_BUF_BASE  + ENET_NUM_RX_DESC * ENET_ETH_MAX_FLEN)
#define ENET_RX_BUF(i)           (ENET_RX_BUF_BASE + ENET_ETH_MAX_FLEN * i)
#define ENET_TX_BUF(i)           (ENET_TX_BUF_BASE + ENET_ETH_MAX_FLEN * i)

void ETH_communication(int data1, int data2, int t);

#endif /* ENET_H_ */


I added same includes as periph_ethernet example uses. MCU Linker is configured like in image. And still I receive make *** ERROR 1, can anyone help me with that issue? What I'm doing wrong?
0 Kudos
5 Replies

379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Zahoq on Thu Jan 08 09:13:45 MST 2015
Yea, my project looks like a dumpster :(
Thank you very much for such a quick respond! I'll follow your advices, hope it will help :)
0 Kudos

379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jan 08 08:57:07 MST 2015
Your project is an accumulation of several files and headers  :((

I would strongly recommend to use / learn LPCOpen and restart it  :)

Your errors:

1- Delete DSP library. See http://www.lpcware.com/content/faq/lpcxpresso/creating-linking-library-projects

2. Change your library to Redlib (semihosting)

See:

http://www.lpcware.com/content/faq/lpcxpresso/switching-selected-c-library

http://www.lpcware.com/content/faq/lpcxpresso/using-printf

Then your project is compiling without errors.
But your main problem is that you are mixing files which requires old CMSIS2.0 and LPCOpen... 

So restarting your project with LPCOpen is a good idea  :)


0 Kudos

379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Zahoq on Thu Jan 08 08:19:04 MST 2015
I included DSP at the beggining of crating project to be sure everything will work, I don't know exactly what it does
My project was made as a normal C project, not LPCOpen, but periph_ethernet is made in LPCOpen so I had to include it libs.

Everything works fine when I don't use
ETH_communication(temp1, temp2, 1);
in main function (SHT71.c).
Can you help me fix it please?

Project attached
0 Kudos

379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Jan 08 01:13:00 MST 2015
As R2D2 says, you should not mix the old CMSIS library projects with the use of LPCOpen. And LPCOpen is the recommended way for new project development.

I would suggest that you read the User Guide supplied within the LPCXpresso IDE, and probably also watch the video at http://www.lpcware.com/lpcxpresso.

With regards to the actual error you are seeing, this is just the make utility (which actually carries out a build) saying that there has been an error during the build process. Look at the build log (or the Problems view) for more details as to what the actual problem is.

http://www.lpcware.com/content/faq/lpcxpresso/build-console

Regards,
LPCXpresso Support


0 Kudos

379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Jan 07 20:50:50 MST 2015

Quote: Zahoq
And still I receive make *** ERROR 1, can anyone help me with that issue? What I'm doing wrong?



Please post your project, it's difficult to guess what you are doing (wrong) in detail  :) 

If that's an LPCOpen project it's not useful to add another CMSIS lib (CMSIS_CORE_...), LPCOpen is including CMSIS already...

You've also included DSP, do you really use it ?
0 Kudos