cc1.exe: fatal error: source\fnet_stack: No such file or directory

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

cc1.exe: fatal error: source\fnet_stack: No such file or directory

Jump to solution
3,061 Views
joao_ribeiro
Contributor IV

Hello,

We are trying to develop a simple ethernet project with the K64 Kinetis. For that we are using the fNET stack and right now we are just tring to add the stack to our project according to the tutorial http://fnet.sourceforge.net/manual/how_to_add_fnet.html .

1.PNG

We have already add the path on the project settings in order to point to the new stack folder, but we are still getting a No such file or directory error besides the fact that the folder is there.

3.PNG

2.PNG

Can you please help us figuring out what is the problem? We did not yet, place any code on main.c just the #include “fnet.h” and are getting this error.

 

Thank you in advance

Regards

Tags (3)
1 Solution
2,859 Views
nxf51211
NXP Employee
NXP Employee

Hi,

I followed the same tutorial that you mentioned and was able to add the fNET stack without any issues. For that I started by creating a plain K64 project, then I downloaded the fnet files from the FNET Project Home Page: GitHub - butok/FNET

After this, I copied and pasted the fnet_stack folder into my project's source file and then proceeded to add its path into the project (just as I'm about to show in the following images):

1) Copy fnet_stack to the source folder:

pastedImage_7.png

2) Go to the project's properties, and in its settings include the path to fnet_satck (after including it, click apply):

pastedImage_9.png

3) Go to the source properties (right click on the folder, and then choosing properties) and include the path to the fnet_stack from the workspace option (after this click on appy and close):

pastedImage_17.png

pastedImage_19.png

4) Add the fnet_user_config.h file (which I copied from one of the demo projects inside fnet_demos which is part of the folders you download from the git repository):

pastedImage_11.png

5) Go to the fnet_cpu_config.h file and enable the define corresponding to your board (as I'm using the k64, I only enabled its define):

pastedImage_13.png

6) Build your project and you should see that the issue you mentioned is no longer presented.

I hope this can help you.

Best Regards,

Ricardo Delsordo.

View solution in original post

5 Replies
2,859 Views
joao_ribeiro
Contributor IV

Hello,

I know that this question may be moving a bit from the thread's topic, but am I able to perform a simple ping and open a socket for sending and receiving packages with the enet functions? Or do I need to add the fnet stack on top of the project in order to achieve that?

Thank you

Regards

João 

0 Kudos
Reply
2,859 Views
nxf51211
NXP Employee
NXP Employee

Hi,

Please create a new discussion regarding your last question so an expert can help you.

Best Regards,

Ricardo Delsordo

0 Kudos
Reply
2,859 Views
joao_ribeiro
Contributor IV

Hello

 

As a token of appreciation I would like to share my experience after successfully compiling the project base on Ricardo’s steps.

 

After the Ricardo’s steps I had to add some parts in order to accomplish my simple goal of performing PING on my Kinetis MK64FN1M0VLQ12 and KSZ8081RNA. It may help others.

Here they are:

7) After Ricardo's step 6, I had to comment the following interrupt function, as it was beeing set twice 

1.png

8) I also had to add the fapp_config.h from one of the fnet stak examples as done for the fnet_user_config.h previously

2.PNG

9) In order to define the IP and MAC you should open the fapp_config.h and set it in the define FAPP_CFG_ETH0_IP4_ADDR

3.png

10) Using IDE MCUXpresso you don't really need to set the pins on ConfigPins tool for the fnet_stack to work, as they are set on fnet_mk_eth.c

11) After running this script you should be able to open a Command Prompt and ping 192.168.0.5 and this is the code that worked for me:

[CODE]

#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MK64F12.h"

#include "fnet.h"
#include "fapp_config.h"

/*******************************************************************************
* Definitions
******************************************************************************/
#define DEMO_RING_BUFFER_SIZE 16

struct fapp_netif_init_param
{
fnet_netif_desc_t netif_desc;
fnet_mac_addr_t netif_mac_addr;
fnet_ip4_addr_t netif_ip4_addr;
fnet_ip4_addr_t netif_ip4_subnet_mask;
fnet_ip4_addr_t netif_ip4_gateway;
#if FNET_CFG_DNS
fnet_ip4_addr_t netif_ip4_dns;
#endif
};

struct fapp_netif_init_param fapp_netif_init_param_list[] =
{
#if FNET_CFG_CPU_ETH0
{
.netif_desc = FNET_CPU_ETH0_IF,
.netif_mac_addr = FAPP_CFG_CPU_ETH0_MAC_ADDR,
.netif_ip4_addr = FAPP_CFG_ETH0_IP4_ADDR,
.netif_ip4_subnet_mask = FAPP_CFG_ETH0_IP4_MASK,
.netif_ip4_gateway = FAPP_CFG_ETH0_IP4_GW,
#if FNET_CFG_DNS
.netif_ip4_dns = FAPP_CFG_ETH0_IP4_DNS,
#endif
},
#endif
#if FNET_CFG_CPU_ETH1
{
.netif_desc = FNET_CPU_ETH1_IF,
.netif_mac_addr = FAPP_CFG_CPU_ETH1_MAC_ADDR,
.netif_ip4_addr = FAPP_CFG_ETH1_IP4_ADDR,
.netif_ip4_subnet_mask = FAPP_CFG_ETH1_IP4_MASK,
.netif_ip4_gateway = FAPP_CFG_ETH1_IP4_GW,
#if FNET_CFG_DNS
.netif_ip4_dns = FAPP_CFG_ETH1_IP4_DNS,
#endif
},
#endif
#if FNET_CFG_CPU_WIFI
{
.netif_desc = FNET_CPU_WIFI_IF,
.netif_ip4_addr = FAPP_CFG_WIFI_IP4_ADDR,
.netif_ip4_subnet_mask = FAPP_CFG_WIFI_IP4_MASK,
.netif_ip4_gateway = FAPP_CFG_WIFI_IP4_GW,
#if FNET_CFG_DNS
.netif_ip4_dns = FAPP_CFG_WIFI_IP4_DNS,
#endif
},
#endif
/* Here put your new network interfaces.*/
{.netif_desc = FNET_NULL} /* END */
};

/*
* @brief Application entry point.
*/
int main(void) {

fnet_return_t result = FNET_OK;
fnet_index_t i = 0;
fnet_netif_desc_t netif;
static fnet_uint8_t stack_heap[FAPP_CFG_HEAP_SIZE];//stack_heap[FAPP_CFG_HEAP_SIZE];
struct fnet_init_params init_params;
int j;

/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();

printf("\r\nEthernet example start.\r\n");

/* Enable interrupts */
fnet_cpu_irq_enable(0);

/* Input parameters for FNET stack initialization */
init_params.netheap_ptr = stack_heap;
init_params.netheap_size = sizeof(stack_heap);

/* FNET Initialization */
if (fnet_init(&init_params) != FNET_ERR)
{
printf("TCP/IP stack initialization is done.\n");

netif = fapp_netif_init_param_list[0].netif_desc;
result = fnet_netif_init(netif, fapp_netif_init_param_list[0].netif_mac_addr, sizeof(fnet_mac_addr_t));
if(result == FNET_ERR)
{
i = i+1;//break;
printf("\r\n fnet_netif_init = FNET_ERR\r\n");
}
else
{
fnet_netif_set_ip4_addr(netif, fapp_netif_init_param_list[0].netif_ip4_addr, fapp_netif_init_param_list[0].netif_ip4_subnet_mask);
fnet_netif_set_ip4_gateway(netif, fapp_netif_init_param_list[0].netif_ip4_gateway);
printf("IP 5 set to %d \n", fapp_netif_init_param_list[0].netif_ip4_addr);
}
}
else
{
printf("Error:TCP/IP stack initialization is failed.\n");
}

for(;;)
{
}
}

[/CODE]

The schematic that I used as a base was the FRDM's - Link

I hope this post help others

Regards

João 

0 Kudos
Reply
2,860 Views
nxf51211
NXP Employee
NXP Employee

Hi,

I followed the same tutorial that you mentioned and was able to add the fNET stack without any issues. For that I started by creating a plain K64 project, then I downloaded the fnet files from the FNET Project Home Page: GitHub - butok/FNET

After this, I copied and pasted the fnet_stack folder into my project's source file and then proceeded to add its path into the project (just as I'm about to show in the following images):

1) Copy fnet_stack to the source folder:

pastedImage_7.png

2) Go to the project's properties, and in its settings include the path to fnet_satck (after including it, click apply):

pastedImage_9.png

3) Go to the source properties (right click on the folder, and then choosing properties) and include the path to the fnet_stack from the workspace option (after this click on appy and close):

pastedImage_17.png

pastedImage_19.png

4) Add the fnet_user_config.h file (which I copied from one of the demo projects inside fnet_demos which is part of the folders you download from the git repository):

pastedImage_11.png

5) Go to the fnet_cpu_config.h file and enable the define corresponding to your board (as I'm using the k64, I only enabled its define):

pastedImage_13.png

6) Build your project and you should see that the issue you mentioned is no longer presented.

I hope this can help you.

Best Regards,

Ricardo Delsordo.

2,859 Views
joao_ribeiro
Contributor IV

Hello

 

Thank you very much for your reply.

 

I have followed your guide and it compiled successfully.

 

You have helped immensely.

I am very grateful for the NXP community support!

Please keep with the good work!

 

Regards

João

0 Kudos
Reply