NE64 - handle incoming frame in interrupt

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

NE64 - handle incoming frame in interrupt

2,275 Views
DiegoNunes
Contributor I
I'm trying to handle incoming frames by interrupt, but the receive buffer seems not working.
I've added debug code, but the emac_rx_b_ac_isr was not called.
I created a new project and added driver files. I'm working with Raw Ethernet frames and I don't need OpenTCP stack, so I want a minimal code.
Obs: The gotlink variable works fine.


Thanks,
Diego Nunes.
-----------------------
in main.c
#include "ne64driver.h"

void main(void) {
 PE_low_level_init();
 EtherInit();
 while(1) {
   if(gotlink) {
     // debug here
   }
 }
}


in ne64driver.c

interrupt void emac_rx_b_a_c_isr(void) {
 // My Handle frame code
 // debug here
}
Labels (1)
0 Kudos
4 Replies

465 Views
mjbcswitzerland
Specialist V
Hi
Setting up the EMAC to receive is more complicated than setting up the PHY to give a link change interrupt. This means that more can go wrong.
Here's a check list:
1. Ensure that the EMAC rx buffers are set up correcty
2. Ensure that the controller is configured. Best to use promiscuous mode so than any frame will interrupt. Ensue also that ETCTL is configured to respond to at least IPV4 and ARP frames
3. Ensure that the EMAC interrupt(s) are enabled.
4. Ensure that the EMAC is finally enabled to work.

Regards

Mark

www.uTasker.com

0 Kudos

465 Views
DiegoNunes
Contributor I
Thanks Mark!
 
I made it work by copying PRM linker file from Startup Demo Project. I'm testing if Flat or Balnked memory model was geting the problem.
0 Kudos

465 Views
DiegoNunes
Contributor I
I didn't use PE. I created a new blank project and added some files from Startup Demo, like ne64driver.c, cpu.c and vectors.c and its headers.
The interrupt ephy_isr is working fine, changing correctly the state of variable gotlink.
0 Kudos

465 Views
PsychoDebugger
Contributor I
Sometimes the solution is more simple that you image, i'll try.
I suppose you use processore Expert, have you activated the interrupt?
0 Kudos