How To Set Up The Midifighter Development Environment - WIN32
Results 1 to 4 of 4
  1. #1
    Tech Guru Fatlimey's Avatar
    Join Date
    Mar 2008
    Location
    Redmond, WA
    Posts
    1,169

    Arrow How To Set Up The Midifighter Development Environment - WIN32

    How To set up the Midifighter Development Environment

    20100224: created by Fatlimey

    Developing under Windows

    Create a project directory that will hold the libraries and tools, say,
    "Midifighter" in an easy to find location. As many of the tools we will be
    using are command-line based, keeping the path to this directory short will
    help keep typing to a minimum. I keep my workspace at "C:\midifighter"

    The source code for the Midifighter firmware can be downloaded from
    Sourceforge at:


    Unzip the source tree into your project directory and you should find the
    source code (.c and .h files) as well as the project Makefile. The source
    code is heavily documented and is broken into logical systems with the main
    program loop residing in "midifighter.c".

    The Midifighter zip archive contains the source code only, and so you will
    need to download two additional sets of libraries that are required to
    produce working binaries. WinAVR is a set of libraries, compilers, debuggers
    and command line tools for the AVR series of processors that can be found
    at:


    WinAVR comes with an installer that installs all the tools and adds the
    install path to the PATH environment variable. This means that all the
    command line tools are instantly available at the command prompt. Part of
    the WinAVR package is a set of Gnu Tools compiled for Win32 that provide
    the Unix command line tools "make", "grep", "find" etc.

    Next you will need to download the LUFA libraries for USB on AVR chips. This
    library, written by he indispensable Dean Camera, can be found at:


    Create a "LUFA" subdirectory inside the project directory and Unzip the LUFA
    project into that place. The resulting layout after installing these tools
    should be:
    Code:
        drive (c:)
         |_ Program Files
         | |_ Atmel
         |    |_ Flip 3.4.1
         |      |_ bin
         |_ ...
         |_ WinAVR
         |  |_ bin
         |  |_ utils
         |_ ...
         |_ midifighter
            |_ LUFA
            | |_ ..
            |_ COPYING.txt
            |_ Makefile
            |_ README.txt
            |_ adc.c
            |_ adc.h
            |_ constants.h
            |_ eeprom.c
            |_ eeprom.h
            |_ expansion.c
            |_ expansion.h
            |_ fourbanks.c
            |_ fourbanks.h
            |_ key.c
            |_ key.h
            |_ led.c
            |_ led.h
            |_ menu.c
            |_ menu.h
            |_ midi.c
            |_ midi.h
            |_ midifighter.c
            |_ selftest.c
            |_ selftest.h
            |_ spi.c
            |_ spi.h
            |_ usb_descriptors.c
            |_ usb_descriptors.h
    To build the firmware, open a command line (from the Start button you can use "All
    Programs/Accessories/Command Prompt", or use the "Run..." option and execute
    "cmd"). Change the directory to your project dir and build the project using
    the make command:
    Code:
        > cd C:\midifighter
        > make -s
    The "-s" on the make command silences printout of the actual commands
    executed (which is optional), but the output should resemble:
    Code:
        -------- begin --------
        avr-gcc (WinAVR 20100110) 4.3.3
        Copyright (C) 2008 Free Software Foundation, Inc.
        This is free software; see the source for copying conditions.  There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
         
        Compiling C: midifighter.c
        Compiling C: eeprom.c
        Compiling C: spi.c
        Compiling C: adc.c
        Compiling C: led.c
        Compiling C: key.c
        Compiling C: midi.c
        Compiling C: menu.c
        Compiling C: selftest.c
        Compiling C: expansion.c
        Compiling C: fourbanks.c
        Compiling C: usb_descriptors.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/DevChapter9.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/Endpoint.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/Host.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/HostChapter9.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/LowLevel.c
        Compiling C: LUFA/LUFA/Drivers/USB/LowLevel/Pipe.c
        Compiling C: LUFA/LUFA/Drivers/USB/HighLevel/Events.c
        Compiling C: LUFA/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
        Compiling C: LUFA/LUFA/Drivers/USB/HighLevel/USBTask.c
        Compiling C: LUFA/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
        Linking: midifighter.elf
        Creating load file for Flash: midifighter.hex
        Creating load file for EEPROM: midifighter.eep
        Creating Extended Listing: midifighter.lss
        Creating Symbol Table: midifighter.sym
        Checking for invalid events...
         
        ---- Compile Time Library Options ----
        NO_STREAM_CALLBACKS
        USB_DEVICE_ONLY
        FIXED_CONTROL_ENDPOINT_SIZE=8
        FIXED_NUM_CONFIGURATIONS=1
        USE_FLASH_DESCRIPTORS
        USE_STATIC_OPTIONS=(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)
        --------------------------------------
         
        --------- Target Information ---------
        AVR Model: at90usb162
        Board:
        Clock: 16000000Hz CPU, 16000000Hz Master
        --------------------------------------
         
        Size after:
        AVR Memory Usage
        ----------------
        Device: at90usb162
         
        Program:    6160 bytes (37.6% Full)
        (.text + .data + .bootloader)
         
        Data:         96 bytes (18.8% Full)
        (.data + .bss + .noinit)
         
        -------- end --------
    At the end of this you will find a firmware image called "midifighter.hex"
    in the project directory.



    Flashing from the Makefile

    The Makefile that comes with the project contains a build target that will
    reflash the Midifighter from the command line.

    If you have already installed the Atmel Flip tool and added the "bin"
    directory from that tool to your PATH environment variable:
    Code:
        > set PATH= %PATH%;C:\Program Files\Atmel\Flip 3.4.1\bin
    we can use the "batchisp" command to do the work. Make sure the Midifighter
    is in Bootloader Mode and execute "make flip". This will execute a script
    that will upload the firmware and reset the Midifighter to start the program
    executing:

    Code:
        > make flip
    
        batchisp -hardware usb -device at90usb162 -operation erase f
        Running batchisp 1.2.4 on Wed Feb 24 01:19:15 2010
         
        AT90USB162 - USB - USB/DFU
         
        Device selection....................... PASS 
        Hardware selection..................... PASS 
        Opening port........................... PASS 
        Reading Bootloader version............. PASS	1.0.5
        Erasing................................ PASS 
         
        Summary:  Total 5   Passed 5   Failed 0
    
        batchisp -hardware usb -device at90usb162 -operation loadbuffer midifighter.hex program
        Running batchisp 1.2.4 on Wed Feb 24 01:19:16 2010
         
        AT90USB162 - USB - USB/DFU
         
        Device selection....................... PASS 
        Hardware selection..................... PASS 
        Opening port........................... PASS 
        Reading Bootloader version............. PASS	1.0.5
        Parsing HEX file....................... PASS	midifighter.hex
        Programming memory..................... PASS	0x00000	0x0180f
         
        Summary:  Total 6   Passed 6   Failed 0
    
        batchisp -hardware usb -device at90usb162 -operation start reset 0
        Running batchisp 1.2.4 on Wed Feb 24 01:19:18 2010
         
        AT90USB162 - USB - USB/DFU
         
        Device selection....................... PASS 
        Hardware selection..................... PASS 
        Opening port........................... PASS 
        Reading Bootloader version............. PASS	1.0.5
        Starting Application................... PASS	RESET	0
         
        Summary:  Total 5   Passed 5   Failed 0
    There are similar targets for programming using the "dfu-programmer" tool or
    hardware programming debugging using Avrdude and a JTAG programmer. If you are familiar with those tools, read the Makefile for more information.
    Last edited by Fatlimey; 04-01-2011 at 02:06 PM.

  2. #2
    Tech Wizard
    Join Date
    Jun 2011
    Location
    Middle East
    Posts
    64

    Default

    i dont really get the point of this... is this for making your own mappings???

  3. #3
    Tech Guru VirtualLogic's Avatar
    Join Date
    Sep 2010
    Location
    Victoria, Australia
    Posts
    611

    Default

    No its not, its to edit how the midifighter interacts with the computer

  4. #4
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Thumbs up These instructions need an update

    Hi All, I just popped on to say that there is an issue with using the code with WinAVR-20100110, it appears that the included avr-gcc has changed the way progmem is addressed, any variables declared with PROGMEM need to be preceded with const at the front.

    The first error occurred in midi.c line 62:
    uint8_t kNoteMap[16] PROGMEM = {
    12, 13, 14, 15,
    8, 9, 10, 11,
    4, 5, 6, 7,
    0, 1, 2, 3,
    };

    changing it to:
    const uint8_t kNoteMap[16] PROGMEM = {
    12, 13, 14, 15,
    8, 9, 10, 11,
    4, 5, 6, 7,
    0, 1, 2, 3,
    };

    And usb_descriptors.c also has a bunch of defines using PROGMEM

    Lastly, I'm using vista 64bit and I got sync with child errors, it appears I had a bug in WinAVR-20100110\utils\msys.dll, I used the fix from here:
    http://www.madwizard.org/electronics...es/winavrvista

    Just download the msys-1.0-vista64.zip, backup your WinAVR-20100110\utils\msys.dll and unzip the copy replacing the original.


    I had no idea that there was source code for the midifighter, I was actually looking for a midi-usb solution for an atmega32u2 board and found this thread via google:
    http://forum.djtechtools.com/showthread.php?t=15442

    I'd like to say thank you to Ean and the dj tech tools team for making the files opensource, kudos for giving back to the dj/controllerist/electronics communities :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •