/unesp_mdt

Unesp Microcontroller Development Tools

Primary LanguageCMozilla Public License 2.0MPL-2.0

Unesp Microcontroller Development Tools

The Unesp MDT provides you the API libraries and developer tools necessary to build, test, and debug apps for Microcontroller.

With a single download, the Eclipse MDT bundle includes everything you need to begin developing apps:

Eclipse IDE for C/C++ Developers
LM4Flash Tools
Tiva SW-TM4C-2.0.1.11577 Platform-tools

Once installed MDT perform the following steps:

  1. Install the required gcc/g++

    sudo apt-get update && sudo apt-get install gcc-4.7 g++ build-essential libusb-1.0-0-dev openjdk-7-jdk
  2. Add repository GCC for Arm Embedded

    sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded && sudo apt-get update && sudo apt-get install gcc-arm-none-eabi
  3. Compile LM4Flash

    git submodule foreach git pull
     cd lm4tools/lm4flash
     
     sudo cp lm4tools/lm4flash/lm4flash /usr/bin/
    
  4. Add user for root group

    sudo usermod -aG users < username >
  5. Enabled usb for device (Example: Tiva)

    echo 'ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", GROUP="users", MODE="0660"' | \ sudo tee /etc/udev/rules.d/99-stellaris-launchpad.rules
  6. Configuration Eclipse

    6.1 Launch Eclipse, You'll be asked to select a directory for the workspace. Select workspace directory, under your home (/home// in my PC):

    Screenshot

    6.2 Click in File -> New -> C Project, enter your information:

     6.2.1 Select Project Type: Empty Project;
    
     6.2.2 Select Toolchains: Cross GCC and click Next.
    

    Screenshot

    6.3 Now click in Advanced Settings

    Screenshot

    6.4 Select C/C++ Build/Settings in the tree. In the Configuration combo box, select [ All configurations ]. Make sure you keep [ All configurations ] selected for all the following steps. In the Tool Settings tab, in the Cross Settings section write "arm-none-eabi-" into the Prefix text box and Path write "/usr/lib/arm-none-eabi":

    Screenshot

    6.5 Click Symbols under Cross GCC Compiler. Add the following symbols: PART_LM4F120H5QR, ARM_MATH_CM4, TARGET_IS_BLIZZARD_RA1:

    Screenshot

    6.6 Jump to the Includes section and add the path to Tiva libraries. It should be in "../boards/SW-TM4C-2.0.1.11577/" directory, under your home: Screenshot

    6.7 In the Miscellaneous section, in the Other flags: text box, you should see "-c -fmessage-length=0". To these two flags, add these all: "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections".

    Screenshot

    6.8 It's time to add Tiva driver library. Go to the Cross GCC Linker / Libraries section, "../boards/SW-TM4C-2.0.1.11577/driverlib/" prefixed by your home to the Library search path (-L) list.

    Screenshot

    6.9 In the Miscellaneous section add the following Linker flags: "-Wl,--static,--gc-sections,-T ../def/project.ld -mthumb -mcpu=cortex-m4 -lm -lc": Screenshot

    6.10 Go to the Build Steps tab, and in the Command text box inside the Post-build steps frame, type "arm-none-eabi-objcopy -O binary ${ProjName}.elf ${ProjName}.bin". Then in the Description: text box below, type "Generate binary file from elf file": Screenshot

    6.11 Switch to the Build Artifact tab and add ".elf" to the "${ProjName}" text inside the Artifact name: text box. The resulting string should be "${ProjName}.elf". When finished, click OK:

    Screenshot

    6.12 That was a long configuration, but when you click Finish, the project will be ready. You might need to advance to the next step before the Finish button becomes enabled. If that's the case, click the Next > button to advance to the next step, enter "arm-none-eabi-" in the Cross compiler prefix text box, and finally click Finish. Screenshot

    7.0 Compile programs

    Right Click Project, then click Build Project Screenshot

    Result Screenshot

    8.0 Flashing programs

    Click Run/External Tools/External Tools Configurations...: Screenshot

    Right click Program, then click New: Screenshot

    Change Name for example to "Upload", Location to the place where lm4flash is (we installed it to ".../lm4tools/lm4flash/lm4flash" under your home), Working Directory to "${workspace_loc:/Template/Debug}" or "${workspace_loc:/Template/Release}" (Release or Debug directory of your project) and Arguments to "Template.bin" (the binary file we want to flash):

    Screenshot

    Click in Run, now been transferred to the device

    Screenshot

    Now just use your imagination and good codes. Url to download the installers: http://goo.gl/a1kHU2

    sudo apt-get -o Dpkg::Options::="--force-overwrite" install gdb-arm-none-eabi

    Thanks.