I recently posted how to do the Turnigy 9X resistor fix on rcgroups. Somebody pointed out that you could do the fix without opening the radio itself. You could apply the fix to the wireless module on the back of the 9X itself. I felt a little 'hackish' tonight, so I thought I'd give it a try and post a video HowTo.
Pages
▼
Friday, July 8, 2011
Monday, July 4, 2011
How to generate .hex files from Code Red's LPCXpresso to use with FlashMagic
Recently I struggled to be able to use with the LPC serial bootloader and FlashMagic with the LPCXpresso software from Code Red. All I wanted was a .hex file to load onto an LPC1759. LPCXpresso generates a binary AXF file. FlashMagic requires an ihex file. The hex file actually is just the binary file converted to an ascii file. Unfortunately, due to the rich features of LPCXpresso, you have to dig to figure out how to automatically convert the .axf into a .hex. These steps should bring you a step closer to flashing code to your LPC chip over serial.
Code Red provides two links with information on how to convert your program into a usable .hex for FlashMagic.
In order to begin, you need to open your project settings. Once the project properties are open, choose 'C/C++ Build' -> 'Settings'. On the right, select the 'Build Steps' tab.
Now, edit the 'Post-build steps' command and add the steps to create a .hex that FlashMagic can use.
I got these steps from a thread on NXP's user forum. They agree with the knowledge base article.
Add the following steps to your Post-build Steps -> Commands
Now, when you rebuild your project, LPCXpresso should generate a .hex file that FlashMagic will be able to use.
Next, getting your code to actually run...
Official Code Red and LPCXpresso Documentation
Code Red provides two links with information on how to convert your program into a usable .hex for FlashMagic.
- Generating srec (Motorola S format), binary, ihex (Intel Hex) files
- Post-processing your linked application
Changing the project settings
In order to begin, you need to open your project settings. Once the project properties are open, choose 'C/C++ Build' -> 'Settings'. On the right, select the 'Build Steps' tab.
Now, edit the 'Post-build steps' command and add the steps to create a .hex that FlashMagic can use.
Steps to go from a ELF to a FlashMagic compatible HEX file
I got these steps from a thread on NXP's user forum. They agree with the knowledge base article.
Add the following steps to your Post-build Steps -> Commands
- ELF=>BIN without CRC:
arm-none-eabi-objcopy -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin";
- BIN=>BIN with CRC (this is useful for USB ISP mode with LPC13xx parts):
checksum -v "${BuildArtifactFileBaseName}.bin";
- BIN with CRC => HEX with CRC:
arm-none-eabi-objcopy -I binary "${BuildArtifactFileBaseName}.bin" -O ihex "${BuildArtifactFileBaseName}.hex";
- Save your project properties, and then repeat for your other Build Configurations (Debug/Release).
Now, when you rebuild your project, LPCXpresso should generate a .hex file that FlashMagic will be able to use.
Next, getting your code to actually run...
Sunday, July 3, 2011
XBee Enabled Joystick, part II
This is a continuation of XBee Enabled Joystick, part I, that involved the physical hacking of the joystick. Part II consists of setting up the XBee to spit out sensor data from the joystick to another XBee.
Alright, it has been awhile, but I decided to finally finish off this project. Sort of. For today, I will just be doing something simple with the final result, eventually, I may even hook the XBee enabled joystick up to something that moves.
What is an XBee anyway?
Before I begin, I'm going to explain a little about what an XBee really is. Most people think of XBees as wireless modems, and not much more. XBees do much more, however, than just act as a modem, transporting bits from here to there.
First, XBees contain a processor, which takes care of the communication processing, taking care of packet routing, buffering data, power management, and more. Now, if you are putting a micro processor into something that has ADCs, PWMs, GPIOs and more, why not use them? For this reason, the XBee can do much more than just act as a method to communicate. Some of the later versions of XBees even allow you to load and execute your own code in the spare memory.
With all the extra functionality, Maxstream hoped that the XBee could function on its own without an additional processor to carry out simple tasks, such as reading sensor data.
First steps first, configuring the XBees to talk to each other. For this, I will simply be setting them up with short 16 bit addresses that point to each other. Perhaps in the future, I might do a post more in depth about configuring XBees with coordinators and such.