lpcware

Sigtrap on reading gpio state

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Croman13n3c on Fri Nov 30 04:13:33 MST 2012
I am trying read state of 29 pin on PORT4 (lpc1756,for detect sd card present)

When start firmware with inserted card - ok, then if i eject card - ok. But when i insert card back, generating sigtrap and programm stop.

SDPresent = LPC_GPIO4->FIOPIN&(1<<29);

GPIO init :

PINSEL_CFG_Type PinCfg ;
PinCfg.Funcnum   = PINSEL_FUNC_0;
PinCfg.OpenDrain = PINSEL_PINMODE_NORMAL;
PinCfg.Pinmode   = PINSEL_PINMODE_PULLUP;
PinCfg.Pinnum    = 29;
PinCfg.Portnum   = 4;
PINSEL_ConfigPin(&PinCfg);

Outcomes