Where to place custom .h and .c files to include in to Device code


I’m interested to use in imp003 code some additional C files .h and .c. and include in to device code (usually placed in library folder).
Probably it is described in “How to Include Libraries in Your Code” under Code Libraries section but I haven’t access to that resource : https://docapi-stage.codeenigma.net/libraries/libraryguide/.
So - what actions I must take to place .c and .h files for later including in to Device code?


The imp does not run C code, so “.c” and “.h” files are not applicable to imp development. It’s the squirrel VM that helps provide the application sandboxing that ensures security and makes bricking a device almost impossible.

If you would like to work on multi-file projects, then look at the impWorks tools here https://developer.electricimp.com/tools/impworks


Thanks, Hugo! I’m still looking for possibility to integrate FFT. Include all lines of code typically located in .c and .h (or other, depending form language) seems not an easy task due to many lines of code - difficult to find mistakes :slight_smile:
I’ll take a look on impWorks and probably that will be not so complicated.


Yeah, unfortunately no good way to perform an FFT on the imp right now; squirrel is likely too slow for this. We have customers who use a small Cortex M0 externally to do intensive tasks like that - this actually works really well as the external CPU can do hard real time tasks as it isn’t doing anything non-deterministic like network I/O.

You can also update the firmware of the slave micro over DFU via the imp, so it’s easy to manage at scale.

Ideally what you want is an MCU with built in protections, like the Trustzone-M. This isn’t really shipping yet from any major vendors, although it’s coming.


Thanks, Hugo!
I see. So there are no way (or it is to complicated or not stable or not enough reliable or…etc.) to use CMSIS DSP arm_cfft_radix2 math library (http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html), or similar, with eCos and Squirrel? It can be a wasted time if you say that at moment squirrel is to slow.
For applications without WiFi currently I usually relay on Cortex_M4 MK66FX1M0 (for quick development Teensy 3.6 board is great), for application with WiFi I always use imp.
Both together also do the job very well (just some mess with programming)…:slight_smile:
Simple idea was - try to use just one Cortex, less space, less energy…
Trustzone-M, Oh, thats new fro me :slight_smile: Must check out (currently information at least)


It is possible for us to add this functionality to impOS (there’s an FFT task in our tracker from 2014) - but we have a lot of requests, so they tend to be prioritized for commercial customers… and as yet no commercial customer has required a fast FFT.


Ok, I see. Then I must become a commercial customer.