I will have to look at the code, but the cc3000 should be able to tolerate a short periods of the interrupts being off as long as the restoration is conditional on the state of the interrupts at the time of disable.
typedef uint32_t intState;
inline intState DISABLE_INT()
{
intState is = __get_PRIMASK();
__disable_irq();
return is;
}
inline int ENABLE_INT(intState is)
{
int rv = ((is & 1) == 0);
if ((is & 1) == 0) {
__enable_irq();
}
return rv;
}
The other real possibility is a fault that is currently not displayed in the current spark build. Had one my self see
I would try a debug build and capture the Serial1 output using
rm -rf git_master_new
mkdir git_master_new
cd git_master_new
git clone GitHub - Spark-Works/core-firmware: Firmware for the Spark Core, a tiny Wi-Fi development kit.
git clone GitHub - Spark-Works/core-common-lib: Common library for projects that use the Spark Core with the CC3000
git clone GitHub - particle-iot-archived/core-communication-lib: Embedded C++ library for communication between Core & Cloud
cd core-firmware
git checkout spark_master_new
cd ../core-common-lib
git checkout spark_master_new
Then build with make clean && make DEBUG_BUILD=y
The debug output will come from tx,rx 3,3V pins.
Once that works. Update application.cpp to your code and add
void debug_output_(const char *p)
{
static boolean once = false;
if (!once)
{
once = true;
Serial1.begin(115200);
}
Serial1.print(p);
}
and see what the log says.
log out put will look like:
0000000001:<DEBUG> int main() (103):Hello from Spark!
0000001994:<DEBUG> int Spark_Connect() (616):sparkSocket Now =-1
0000002000:<DEBUG> int Spark_Disconnect() (654):
0000002004:<DEBUG> set_socket_active_status (810):Sd=0, Status SOCKET_STATUS_ACTIVE
0000002012:<DEBUG> int Spark_Connect() (623):socketed sparkSocket=0
0000002018:<DEBUG> int Spark_Connect() (644):connect
0000002164:<DEBUG> int Spark_Connect() (646):connected connect=0
0000002306:<DEBUG> int Spark_Receive(unsigned char*, int) (366):bytes_received 40
0000002314:<PANIC> char* _sbrk(int) (139):Out Of Heap