I designed a board with the RCM4010 that needs to use serial ports B,C,D, and F. But as soon as I try to enable port F (on PE2 and PE3) the debugger hangs. I used IOCONFIG to make a file. Here is all the code, with the library pasted in for simplicity. It only opens portd B and F. It hangs after executing the line marked with “***”. Any ideas?
void BoardInit();
void ClockCheck();
void SetupSerial();
#define BINBUFSIZE 31
#define BOUTBUFSIZE 31
#define SERB_TXPORT PCDR
#define BDRIVE_TXD 4
#define SERB_RXPORT PCDR
#define BDRIVE_RXD 5
#define FINBUFSIZE 31
#define FOUTBUFSIZE 31
#define SERF_TXPORT PEDR
#define FDRIVE_TXD 2
#define SERF_RXPORT PEDR
#define FDRIVE_RXD 3
void ClockCheck()
{
if (freq_divider != 96) // 29.49 MHz, doubled
{
exception(-ERR_LIBCLOCKSPEED);
}
}
void SetupSerial()
{
serBopen(9600L);
serFopen(9600L);
WrPortI(SFCR,&SFCRShadow, 0x21);
}
void BoardInit()
{
ClockCheck();
// The following differ from BIOS settings
SetupSerial();
WrPortI(PCALR,&PCALRShadow,0x30); // Serial Port F
WrPortI(PCFR,&PCFRShadow,0x50); // Serial Port F
WrPortI(PEALR,&PEALRShadow,0x30); // Serial Port F
WrPortI(PEDDR,&PEDDRShadow,0x04); // Serial Port F
// *** this is the line that causes the problem
WrPortI(PEFR,&PEFRShadow,0x04); // Serial Port F
// *** never gets here
WrPortI(SCCR,&SCCRShadow,0x30); // Port E Input and output Pins
}
int main()
{
printf("here 1
");
BoardInit();
printf("here2
");
serBwrite("Hello B
",9);
printf("here 3
");
return 0;
}