Ethernet init problem with LPCopen and CMSIS

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

Ethernet init problem with LPCopen and CMSIS

2,901 Views
ramazan_kurban3
Contributor III

Hi. I need to use LPCOpen and CMSIS together. My webserver code is written at LWIP lpcopen and my main code written at cmsis. when ı add webserver to main code, ethernet init function is halted and debugger is freeze. 

I think, that's not the only the problem, is there any some major problem ?

How can ı solved this problem? How can ı run lwip server at lpcopen with cmsis.

I add some photo from options,codes and workspace.

Debugger is halted at pENET->MAC.MAC1 = ENET_MAC1_PARF;

void Chip_ENET_Init(LPC_ENET_T *pENET, bool useRMII)
{
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_ENET);
resetENET(pENET);

/* Initial MAC configuration for full duplex,
100Mbps, inter-frame gap use default values */
pENET->MAC.MAC1 = ENET_MAC1_PARF;
pENET->MAC.MAC2 = ENET_MAC2_FULLDUPLEX | ENET_MAC2_CRCEN | ENET_MAC2_PADCRCEN;

if (useRMII) {
pENET->CONTROL.COMMAND = ENET_COMMAND_FULLDUPLEX | ENET_COMMAND_PASSRUNTFRAME | ENET_COMMAND_RMII;
}
else {
pENET->CONTROL.COMMAND = ENET_COMMAND_FULLDUPLEX | ENET_COMMAND_PASSRUNTFRAME;
}

pENET->MAC.IPGT = ENET_IPGT_FULLDUPLEX;
pENET->MAC.IPGR = ENET_IPGR_P2_DEF;
pENET->MAC.SUPP = ENET_SUPP_100Mbps_SPEED;
pENET->MAC.MAXF = ENET_ETH_MAX_FLEN;
pENET->MAC.CLRT = ENET_CLRT_DEF;

/* Setup default filter */
pENET->CONTROL.COMMAND |= ENET_COMMAND_PASSRXFILTER;

/* Clear all MAC interrupts */
pENET->MODULE_CONTROL.INTCLEAR = 0xFFFF;

/* Disable MAC interrupts */
pENET->MODULE_CONTROL.INTENABLE = 0;
}

pastedImage_2.png

pastedImage_3.pngpastedImage_4.pngpastedImage_5.png

Labels (1)
Tags (3)
0 Kudos
Reply
4 Replies

2,724 Views
mircodemarchi
Contributor I

Hi, 

I finally found someone that has my same problem. My mbed NXP LPC1768 halted in Chip_ENET_Init() function, but it didn't always halt in pENET->MAC.MAC1 = ENET_MAC1_PARF line, but could also stop inside the resetENET(pENET) call in a indeterministic way. 

The debug error showed is the following:

Schermata 2020-11-15 alle 18.35.00.png

and than, if I try to rerun the project a “Cannot halt processor” console error appears and after this error I become no longer able to test any project on the LPC1768 with MCUXpresso, because if I try to run any project, the error always return.

The only way to recover the LPC platform is to use MBED Studio to build a .bin execution file, and load it in the device driver of LPC1768. After power-cycle the board by disconnecting and reconnecting the cable, I can still use MCUXpresso to run projects.

Moreover I found that the 0x50000000 address, showed in the debug console error, is the ethernet peripherals base address. Why should an access on the ethernet peripherals base address give this error?

Trying to eliminate the preprocessor declaration __USE_LPCOPEN as suggested by Alexis nothing changed, the problem remains and the behavior is the same. 

Schermata 2020-11-15 alle 18.35.57.png

What can I do to solve this problem? Every demo project with an ethernet communication stop with this error on Chip_ENET_Init() function, while a freertos demo project without an ethernet communication works well (for example the freertos_blinky project). I think that the problem is on the ethernet peripherals base address. Could it be? 

 

0 Kudos
Reply

2,407 Views
dvednere
Contributor I

same problem with LPC1758 board. How did you solve it?

0 Kudos
Reply

2,715 Views
converse
Senior Contributor V

Check that the peripheral is enabled. It sound exactly like it is disabled. I think this is changed in the PCONP register, but it’s been a while since I used this chip, so could have the register name wrong.

0 Kudos
Reply

2,762 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Ramazan,

In case you're using CMSIS in the LPCOpen Library you should eliminate the preprocessor declaration 

__USE_LPCOPEN, this due to the discrepancy in the IRQ name, in the CMSIS library is called differently.

pastedImage_7.png

Let me know if this helps you.

Best Regards,

Alexis Andalon

0 Kudos
Reply