int retVal; // Verify JLINK is not already connected if (JLINKARM_IsConnected()) // if communication is already opened { printf("JLINK should not have been connected yet\n"); return TRUE; } // establish connection with M4 core if(JLINKARM_Open()) { printf("JLINK failed to connect\n"); return FALSE; } retVal=JLINKARM_IsConnected(); // check communication to core if(!retVal) { printf("JTAG should have been connected\n"); // return FALSE; } // Set JTAG Speed to 3000 - doesn't fix the problem SpeedValue = 3000; JLINKARM_SetSpeed((UINT32)SpeedValue); retVal=JLINKARM_IsConnected(); // check communication to core if(!retVal) { printf("JTAG should have been connected\n"); //return FALSE; } SpeedValue = 0; JLINKARM_SetSpeed((UINT32)SpeedValue); // now it is fixed! retVal=JLINKARM_IsConnected(); // check communication to core if(!retVal) { printf("JTAG should have been connected\n"); return FALSE; }