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;
}
Hi,
The debug error showed is the following:
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.
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?
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.
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.
Let me know if this helps you.
Best Regards,
Alexis Andalon