• AVR Freaks

Using AVRDUDE from within MPLAB X (Mac OS X)

Author
ChrisLyttle
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2013/10/18 14:21:41
  • Location: Belfast
  • Status: offline
2013/10/18 14:36:23 (permalink)
0

Using AVRDUDE from within MPLAB X (Mac OS X)

Hello all! First time using this forum so wasn't too sure where to put this thread so apologies if its in the wrong forum! I've also posted this on the chipKIT forums but i thought i'd stick it up here too. 

Anyway, student/n00b programmer here and i've got myself a Fubarino mini board and hope to program it using C in MPLAB. I've found a guide (link below) on how to get this going with Windows (which i haven't been able to get working on my windows machine yet) but i wanted to know if it was possible to do something similar within OS X. Anyone know if this is possible? I've a pickit 3 but was hoping to be able to program it using the bootloader. I don't think i was ever able to get the pickit working on my macbook anyway.

Anyway, the guide i was reading is on this link under "Using AVRDUDE from within MPLAB X"

http://chipkit.net/tag/bootloaders

Cheers!
post edited by ChrisLyttle - 2013/10/18 15:10:41
#1

6 Replies Related Threads

    andersm
    Super Member
    • Total Posts : 2740
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/10/18 20:45:04 (permalink)
    0
    The steps should be the same, just change the paths. Note that I would not recommend putting extra files inside MPLAB X's folder structure, as that's a good way to break things during upgrades etc.
    #2
    ChrisLyttle
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2013/10/18 14:21:41
    • Location: Belfast
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/10/18 23:38:19 (permalink)
    0
    Ok, I'll have a go then! One question though, in the line of code to be executed after build, I have to change the COM port number. How do I find this out? Or if its different in OS X, what's its equivalent?

    Cheers.
    #3
    andersm
    Super Member
    • Total Posts : 2740
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/10/18 23:56:16 (permalink)
    5 (1)
    Open a Terminal window and type "ls /dev/tty*". The right device will look something like "/dev/tty.usbserial-FTE2ZIRS". Note that you must install the FTDI usb-serial drivers first.
    #4
    ChrisLyttle
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2013/10/18 14:21:41
    • Location: Belfast
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/10/19 06:48:11 (permalink)
    0
    Cool. I get it now. In mpide instead of COMx etc it was showing something similar to that. Think I know what to insert now.
    I've the FTDI drivers already installed so I'm ok with that. Is there anything I need to do with the linker script? My lecturer mentioned having to do something with two linker files and editing two lines of code somewhere also
    post edited by ChrisLyttle - 2013/10/20 04:33:11
    #5
    ChrisLyttle
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2013/10/18 14:21:41
    • Location: Belfast
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/10/20 04:39:25 (permalink)
    0
    OK, i seem to be getting somewhere but i've still a bit to go before i get it working.

    I think i've the correct paths entered for avrdude and avrdude.conf and i'm using usbmodem1a21 in place of the COM port. 

    When i try to compile it seems to work up until a point then the build fails. Been trying to paste the output but the board keeps giving me an Access Denied error. Note i haven't been able to add a linker script to the project because i can't find one for the MX250F128B. There seems only to be a file for the MX250F128.

    Also its telling me it can't find any USB device when it fails. Any ideas what i need to do next? 
    Cheers!
     
    Edit, this doesn't seem to be letting me post any code style text so i'll just paste in a couple of things of note from the output in MPLAB.
    User configuration file is ( path ) avrduderc         User configuration file does not exist or is not a regular file, skipping
    did not find any USB device "usbmodem1a21"
    post edited by ChrisLyttle - 2013/10/20 04:43:57
    #6
    Ian_McCrum
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2013/10/07 11:40:57
    • Location: 0
    • Status: offline
    Re:Using AVRDUDE from within MPLAB X (Mac OS X) 2013/11/02 07:17:15 (permalink)
    0
    Chris, I succeeded by following the link you gave and experimenting a bit. I copied four files from MPIDE-0023. These are avrdude.exe and avrdude.conf, you could keep them were they are but I though it cleaner to move them to my MPLAB X folders. The other files are moved to your current project folder and need added to the linker file section of your project (right click on "Linker Files" in the project navigator.)
     
    The files come from 
    C:\Program Files\mpide-0023-windows-20120122-test\hardware\pic32\cores\pic32 and are named 
    chipKIT-application-32MX250F128.ld  and 
    chipKIT-application-COMMON.ld.
     
    You need to edit these files. In the first remove the comments on the last line so it now reads INCLUDE "chipKIT-application-COMMON.ld" and edit line 571 of the second file by surrounding it with comments /* and */ ( // won't work in a linker file).
    The line should read /* ASSERT (SIZEOF(.header_info) == 76, “MPIDE Version not specified correctly”) */
     
    You then start an MPLAB X project and tell it you are using the simulator, you need to change the project properties -> build properties to run a command line after building (tick the box) and for this line you need to know which COM port the bootloader comes up as.
     
    Paste this into the white box that gets run after building.
     
    "C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\bin\avrdude.exe" -C "C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\bin\avrdude.conf" -v -p 32MX250F128B -c stk500v2 -P COM14 -b 115200 -U flash:w:${ImagePath}
     
    This works for simple programs but I had bother getting some interrupt code to run, I gave up and reverted to using the pickit 3.
     
    Regards
    Ian McCrum, www.eej.ulst.ac.uk
    #7
    Jump to:
    © 2020 APG vNext Commercial Version 4.5