uint8_t my_data[256000]; Compiles?

That’s great! I am glad that it is working better!

I still think you will be better off scoping down the time you have CC3000 interrupts disabled to just right around the calls to sFLASH_ReadBuffer(). You are asking a for buffer overrun and reboot if network traffic is running.

Maybe @david_s5 could give us some guidance here as to the best way to allow the TI module to continue to work while allowing priority access to the external FLASH on the same bus?

Darn, I knew I got something wrong! The SPI bus for the CC3000 is only shared with the external flash, not the user SPI. However, bko is correct in that the read/write flash code IS experimental at this time. I know that david_s5 wants to take a look at creating an SPI arbitrator so that you don’t have to disable all those interrupts, which as you know, could cause data dropouts in relations to the CC3000. It is not a solution as you pointed out. Nonetheless, it shows that sFLASH_ReadBuffer() is susceptible to these interrupts.

Obviously, the external flash and the CC3000 work together during OTA firmware updates but at the low level, the external flash code may need synchronization that is only done at a higher level. I think other Spark Elite may have a better understanding than me.

@seulater @bko @peekay123

*Danger Will Robinson, Danger. :slight_smile:

Frankly I am lost in the discussion that started in uint8_t and ended in SPI and DMA low level disables*. It would help me a great deal to see a schematic and a summary of the issues faced, solved and remaining.

@seulater (et all)we can discuss this on skype if you like. PM Me

1 Like

david_s5, you are so correct! I did not notice how off-topic we went. The latest part of this thread deals with the ability to use the low level sFLASH_ReadBuffer() to read data without crashing as seulater found when he did not disable CC3000 related interrupts.

So it boils down to getting a solid external flash library. I believe mattande is working on one as mentioned in this topic. Thanks helpiing out! :smile:

david_s5, and I talked via skype about everything. He has a great knowledge of the whole CC3000 & related code. He offered some suggestion i will try. Its not a solid fix mind you, more of a work around for other reasons.

Just to give some closure on this thread which did get way off topic :slight_smile: Basically, it turns out to be a race condition between the CC3000 IRQ’s and talking to the external flash is the issue.

I want to thank everyone for their help and suggestions here, in the end at least we now know what the issue is.