Monday, June 21, 2010

nRF24LE1 SDK with AES for SDCC

For all of those interested, I have been working on an SDK for the nRF24LE1 chip to use with SDCC. I mainly wrote it for my purposes, but I want to release what I have written. The code is public domain, but I would definitely appreciate it if you linked back to the site if you use it in a project! The nRF24LE1 SDCC SDK lives here.

As it stands, not all of the hardware systems have been implemented (the most glaring omission is probably I2C). Also, some of the subsystems have not been fully tested (the power control block being one of them). If there are any bugs, feel free to let me know.

For those interested, there is a second SDK that I'm releasing (currently set up to build with SDCC for the 24LE1, but can be reconfigured). I have fully implemented AES in this SDK, as well as ported my ARC4 implementation (and made it object-oriented, as well). That library can be found here. It is released under the same terms as the nRF24LE1 SDK.

The AES library can be configured to use the nRF24LE1's built-in AES hardware accelerator or to use an included library function that does the Galois multiplication in software. This means that you can also use the same AES implementation with other microcontrollers than the 24LE1, since it doesn't tie you to using the hardware accelerator. This should make it easier if you're using the 24LE1 as a data collection node that reports information wirelessly to a more powerful central microcontroller, but you want the central microcontroller to also be able to encrypt/decrypt AES data.

If you want to use these libraries, you have to let SDCC know where to find the header files and libraries. For the compile step, you should add "-I [PathToLibrary]/include" (without quotes) to your command line. For the link step, you should add "-L [PathToLibrary]/lib" (without quotes) to your command line. Replace "[PathToLibrary]" with whatever the path is to the top level of the library on your system (including the top level folder, which would be either nrf24le1_sdk or cryptography).

Labels: , , ,