Jump to content
fulltimenoob

problem compiling example application

Recommended Posts

I've compiled the demo application qs-rgb, but it doesn't work on my launchpad.

To compile, I used "make", the compiler is arm-none-eabi-gcc. It compiles without problems, but when I flash the launchpad (using lm4flash), the LEDs stay off. When I flash the precompiled binary, everything is working as expected.

Does anyone have an idea why the self-compiled binary doesn't work? I am completely new to C and microcontrollers, having only programmed in higher languages so far.

Share this post


Link to post
Share on other sites

Hello,

 

Based on the post I assume you are using Linux for the developments.

 

Did you try building the project using Code Composer Studio?

 

Are there any errors/warnings in your compilations? What is the command you ran to flash the binary to the firmware? 

Share this post


Link to post
Share on other sites

Yes, I am using Linux.

I did not try Code Composer Studio.

 

The compilation works without errors or warnings. To flash the binary, I use

"lm4flash qs-rgb.bin"

 

The blinky and project0 examples worked well after compiling myself (using "make") and flashing to the launchpad. I also modified one of the examples to flash the LED in a specific color when holding one of the buttons, and it works well for the left button, but the right one doesn't do anything.

I assume it is a compilation problem, but have no idea why.

Share this post


Link to post
Share on other sites

I hope you are compiling the application from "StellarisWare\boards\ek-lm4f120xl\blinky" directory. 

 

The blinky and project0 examples worked well after compiling myself (using "make") and flashing to the launchpad. I also modified one of the examples to flash the LED in a specific color when holding one of the buttons, and it works well for the left button, but the right one doesn't do anything.
I assume it is a compilation problem, but have no idea why.

 

I believe the button issue is related to some error in your configuration. Cannot say without checking the code. 

Share this post


Link to post
Share on other sites

Just one thing I observed in the qs-rgb example 'Makefile'.

 

There is a line,

 

 

CFLAGSgcc=-DTARGET_IS_BLIZZARD_RA2 -DUART_BUFFERED

 

Try commenting that line.

 

Are you using Stellaris launchpad or Tiva launchpad?

Share this post


Link to post
Share on other sites

I have tried building and flashing the qs-rgb binary to my Stellaris launchpad. It worked without any issue.

 

Steps,

 

  1. Set up the arm-none-eabi toolchain. I used 'arm-2013.11-24-arm-none-eabi-i686-pc-linux-gnu' toolchain. But any newer versions should ideally work too.
  2. Set up the $PATH variable to point to the 'bin' directory of the toolchain.
  3. Clone the lm4flash application using 'git clone https://github.com/utzig/lm4tools.git'
  4. Build the lm4flash application using 'make'
  5. Navigate to 'qs-rgb' project folder in the Stellarisware/boards/ek-lm4f120...
  6. Run 'make clean'
  7. Run 'make'
  8. The binaries will be created in 'gcc' folder.
  9. Copy the binaries to the location of 'lm4flash' application folder.
  10. Connect the device.
  11. Run 'lm4flash qs-rgb.bin' (I hade to use sudo too)

This should work without any changes.

Share this post


Link to post
Share on other sites

I hope you are compiling the application from "StellarisWare\boards\ek-lm4f120xl\blinky" directory.

 

No, I have a Tiva launchpad; on the box it says "TM4C123G" and "EK-TM4C123GXL". I am therefore compiling in "examples/boards/ek-tm4c123gxl/qs-rgb/".

 

I believe that flashing works correctly, because all applications that I have tested work as expected when I flash the binary initially provided in the package. Only when I compile by myself does the application not work.

 

There is a line,

 

 

CFLAGSgcc=-DTARGET_IS_BLIZZARD_RA2 -DUART_BUFFERED

 

Try commenting that line.

When I do that, I get plenty of compilation errors of undefined references to 'ROM_*' functions.

 

 

I am using the current version (4.9.1-1) of arm-none-eabi-gcc of the Archlinux distribution, and have also installed the arm-none-eabi-binutils (2.24-1).

Share this post


Link to post
Share on other sites

Hello,

 

Just now I tried the whole process on my Tiva-Ware launchpad and I did not get any issue. I tried with toolchains I got from CodeBench (http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/) and also from launchpad.net (https://launchpad.net/gcc-arm-embedded).

 

When I do that, I get plenty of compilation errors of undefined references to 'ROM_*' functions.

 

You do not need to do that. Even with that line it works. I was checking StellarisWare previously.

 

 

I am using the current version (4.9.1-1) of arm-none-eabi-gcc of the Archlinux distribution, and have also installed the arm-none-eabi-binutils (2.24-1).

 

This might be the issue. Try downloading the toolchains that I used (I added the links to make it easy for you). It may be an issue related to the toolchain. I tried with the archlinux (gcc version 4.9.1 (Arch Repository)) from https://www.archlinux.org/packages/community/x86_64/arm-none-eabi-gcc/ but it did not even compile. It looks like it does not know about -mcpu=cortex-m4.

 

Moreover, the lm4flash version I used is,

 

LM4Flash version 0.1.3 - Flasher for Stellaris Launchpad ICDI boards
Copyright © 2012 Fabio Utzig <fabio@@utzig.net>
Copyright © 2012 Peter Stuge <peter@stuge.se>
 

Hope this would solve your issue.

 

-Pradeepa

Share this post


Link to post
Share on other sites

I too am facing the same issue. If i compile the stellarisware and load the code, it is still working but for Tivaware I am out of luck. I tried changing my compiler versions still the issue is not solved.

 

ie,

I have both stellarisware and Tivaware and have executed make in both. 
When i execute the command 
paul@paul:~/Documents/Project/tivaware/examples/boards/dk-tm4c123g/blinky/gcc$ lm4flash blinky.bin 

Found ICDI device with serial: 0E102CEA
ICDI version: 9270
Result -The Controller LED is not blinking.

But when I execute
paul@paul:~/Documents/Project/stellaris/boards/ek-lm4f120xl/blinky/gcc$ lm4flash blinky.bin 
Found ICDI device with serial: 0E102CEA
ICDI version: 9270

Result:- The Controller LED is blinking green.

I have seen the same result in both the boards I have ek-lm4f120xl and dk-tm4c123g.

Any suggestions??
gcc version 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278] (GNU Tools for ARM Embedded Processors) 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×