Flash core said undefined: What does this mean

Using the spark cli to upload I got the message: flash core said undefined

What is this supposed to mean?

In other news the core seems to have given up and is flashing green at me… can take care of that in a minute.

I just tried building my firmware locally for the first time and I receive the same error:

$ spark flash cloud 50ff71065067545628110287 core-firmware.bin

attempting to flash firmware to your core 50ff71065067545628110287
flash core said  undefined

The Core I attempted to flash kept breathing cyan. No magenta or anything. Flashing (different code) works fine from the Sparkulator.

Got the code uploaded… but, Now my core is just acting weird, its randomly sinking into bouts of flashing green. I should note that normally it connects to my network just fine.

The only thing different is that I connected up 9DOF and the Bluefruit ez-key, could these be drawing too much power?

I figured mine out. I had an issue in ~/.spark/spark.config.json. I’m getting proper error messages now. :wink:

inof8or, based on the datasheets, the 9DOF consumes little current (< 10ma) and Bluefruit takes about 25-30ma for a total of about 45ma. If you are running off the Spark 3.3V line, then it should be able to supply these devices. You can try powering then off a separate 3.3V supply to be sure.

You code my behave oddly because of… your code! I can try an help but I’ll need to see your code You can PM me and use github if you are concerned with privacy :smile:

Even when I have made sure the code compiles before “spark could flash myCore myDir/”?

I can post the code though! Today I was just going for a basic mouse emulator.


inof8or, have you tested each of the pieces independently? As in making sure the 9DOF puts out data on a continuous basis. Then, testing the button code and finally the Bluefruit. Ideally, you have simple test code for each. Integration often leads to problems but I can’t see anything obvious.

One thing however troubles me and that is the proximity of the bluefruit to the Spark. Both operate in the same radio spectrum and if they are too close, this may cause your flashing green problem.

Your right, I have got a bit too confident in throwing things together like that. Started isolating parts last night.

Passing the 9dof axis data directly into mouseCommand() seems to overflow it: as I suspected. This might have cause the spark to “reset” (flash green randomly) .

Individual press information is handled improperly for some reason its sending a press without a release. I suspect this is a flow control issue.

Finally something that I have relized to be an issue is that I need to start utilizing objective pricipals for the button code in order to handle more then one button properly without mixing static function variables. This way multiple instences of pressEvent() and surePress can be defined per button pin. I’m just learning how to do that however.

Got to this point of debuging on the usb lilypad. When I get to the point of understanding how to make my code work I’ll port and push to the spark version and try again. At this point my original post seemed to be for a fluke issue… “flash core said undefined” seems to mean reset your core and try again, for anyone thats wondering.

Ahh, sorry about that! “undefined” is really not a helpful error message! I’ll make a task for myself to improve that.



inof8or, the big thing to keep in mind is to watch variables “types” between libraries for passed variables. This is a classic problem. Furthermore, the Spark is a 32bit processor so type sizes will change. Keep me posted!

1 Like

You mean a byte will be more then 8 bits! Is there a referance for variable interpertation on the core?

Should be a different address space in the case for degree of change params right?

mouseCommand asks to be passed “uint8_t”. Was under the impression that “uint8_t” was explicitly 8 unsigned bits and a “byte” was more or less depending on the system variation?

inof8or, I typically use explicitly sized variables to avoid problems when I have “sensitive” code. The uint8_t IS explicitly defined as an 8bit variable and byte is defined in spark_wiring.h as typedef unsigned char byte;

For all intents and purposes, they are the same in the Spark. The fun comes when you work with “int” which on the Arduino is 2bytes but on the Spark is 4bytes. I often see “word” being used which is uint16_t on the Spark.

1 Like

+1 for correct usage (instead of “intensive purposes”).