Firefly Design LLC

Product Design Consulting

Firefly Ice: Getting Started with Firmware Development

Posted by denisbohm on May 02, 2013. 0 Comments

Compiling the Firmware

The Firefly firmware uses freely available libraries and tools.  To get setup for building the Firefly Ice firmware you will need the following:

  • GNU Tools for ARM Embedded Processors
  • EnergyMicro CMSIS Software
  • Firefly version of the EnergyMicro CMSIS USB Software
  • Firefly Ice Firmware

The following commands can be used in the Mac OS X terminal to download and extract all of the above:

curl -O https://launchpadlibrarian.net/135590305/gcc-arm-none-eabi-4_7-2013q1-20130313-mac.tar.bz2
tar jxf gcc-arm-none-eabi-4_7-2013q1-20130313-mac.tar.bz2
export PATH=`pwd`/gcc-arm-none-eabi-4_7-2013q1/bin:$PATH

curl -O http://cdn.energymicro.com/dl/packages/EM_CMSIS_3.0.2.zip
unzip -d energymicro EM_CMSIS_3.0.2.zipgit clone https://github.com/denisbohm/energymicro-usb.git
git clone https://github.com/denisbohm/firefly-ice-firmware.git
cd firefly-ice-firmware
mkdir obj bin

Finally, from within the firefly-ice-firmware directory you can build the firmware using make:

make

The resulting FireflyIce.elf binary file can be found in the bin directory.

Loading the Firmware

It's time to get the hardware setup.  In addition to a Firefly Ice PCBA, you will need the following:

Connect everything together, plug the USB cable from the ARM-USB-TINY-H into your Mac, and plug the USB cable from the Firefly Ice into any USB port for power.

connections

The Firefly Flash production software will be used to load the compiled FireflyIce.elf binary into the Firefly Ice PCBA.  Download and run FireflyFlash.zip (it should automatically unzip when downloaded by Safari).

FireflyFlash

Click on "Select firmware ELF file..." and select the FireflyIce.elf file that you compiled in the steps above.  Click "Program" and in a few seconds the indicators on the Firefly Ice should indicate that the firmware is running.

Debugging the Firmware

The Firefly Flash software acts as a gdb remote target for debugging.  To start debugging with gdb:

arm-none-eabi-gdb

then enter the following gdb commands:

target extended-remote tcp:127.0.0.1:9000
set architecture armv3m
file bin/FireflyIce.elf

Now you can use gdb commands for debugging.

Alternatives

The process above is one way to build, run, and debug Firefly Ice.  But it isn't the only option.  For example, a project file for the Rowley Associates CrossWorks for ARM development system is included in the Firefly Ice firmware repository as well.  CrossWorks runs on Windows, Linux, and the Mac.

Any ARM Cortex-M3 gcc distribution could be used for compiling.

Any JTAG with SWD capability and the associated tool chain could be used for running and debugging.  For example, the Olimex ARM-JTAG-SWD in combination with the Olimex ARM-JTAG-20-10 can be used instead of the Rowley ARM SWD Adapter with the same tool chain as above.

References

Comments

There are no comments

Post Comment