LPC1769 Ethernet Bare metal

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1769 Ethernet Bare metal

664 次查看
sahakagopyan
Contributor I

Hi, 

I have a custom board based on lpc1769 with ethernet.

I've seen that in LPCopen library, the ethernet driver uses the interrupts only with an RTOS.

I needed to use the ethernet with a bare-metal application, and wanted to enable the interrupt , to manage ethernet.

I modified the IRQHandler (since the default one, in the driver disables the ETH IRQ ) . I moved the packet management out of the IRQ handler.

void ETH_IRQHandler(void)
{
//NVIC_DisableIRQ(ETHERNET_IRQn);

/* Interrupts are not used without an RTOS */
uint32_t ints;
uint32_t prevtick=timerTick;

ints = Chip_ENET_GetIntStatus(LPC_ETHERNET);
if (ints & RXINTGROUP) {

   struct pbuf *p;

   struct eth_hdr *ethhdr;
   int print_i;
   /* move received packet into a new pbuf */

   p = lpc_low_level_input(p_lpc_netif);
   if (p != NULL) {
      list_add_element(&g_rx_pbuf_list,p);
   }
}
if (ints & TXINTGROUP) {

}

Chip_ENET_ClearIntStatus(LPC_ETHERNET, ints);

}

My problem is that, randomly, i have droped packets, since theses are corrupted, and some time after, a hard fault appears. It happens that the Hard fault appears without any droped packet.  I suppose that i'm doing something wrong, but i don't get whey it does not work.

I assume that there is a reason why on lpcopen, the ethernet management is not done with interrupt on a bare metal system, but i can't figure out the reason.

Thx for your time :smileyhappy: If you have any solution ? something i missed in the documentation ? 

标记 (1)
0 项奖励
1 回复

511 次查看
soledad
NXP Employee
NXP Employee

Hi,

Please check the following thread and let me know if this helps,

simple Ethernet example [LPC1769] 


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励