News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

calling avrdude in a user defined tool

Started by noobiept, July 22, 2011, 11:12:51 PM

Previous topic - Next topic

noobiept

Hello, I'm trying to have a tool that calls avrdude to send the program to the board.

The command parameters I have: -p m328p -c arduino -P /dev/ttyACM0 -U flash:w:${TARGET_OUTPUT_BASENAME}.elf.hex

Is there a macro for the microcontroller? - to have instead of m328p.


Anyway, I already have the tool defined, but I'm having a problem with permissions.

When I call the tool, it tells me that I don't have permissions. Ok, I used to execute this as root in the terminal, but I'm not sure how do I do that here.

I've also tried to add permissions: chmod 777 /dev/ttyACM0 and it works, but when I turn off the board and reconnect it, the permissions I set are lost! I think this is probably how linux works...

any ideas?

scarphin

U can try my modified AVR wizard attached at this post:
http://forums.next.codeblocks.org/index.php/topic,13616.msg97519.html#msg97519
It saves the avr type to use on the 'tools' commands. U can find information about how to manage this here:
http://forums.next.codeblocks.org/index.php/topic,13616.msg93862.html#msg93862

noobiept

Hey, I don't really know how to add a new template, I tried copying to /usr/share/codeblocks/templates/wizard/ but doesn't show in codeblocks.

Anyway, how would this deal with the permissions problem?

scarphin

Right click on the template u want to edit on the new project menu and copy paste the code. That won't deal with the permissions problem, it's out of scope. The new template will make ur tools menu more general like u won't have to change ur mcu type on the 'avrdude' tool command everytime u start a new project. U may need to change other options though. I suggest u read all the topic I gave links.

Jenna

Quote from: noobiept on July 23, 2011, 12:55:25 AM
Anyway, how would this deal with the permissions problem?

Which owner and group has the device (/dev/ttyACM0) ?
If you want to use it as normal user, you have to be member of the appropriate group in almost any cases.

noobiept

Ok, I'll read it with more attention and try it out. thanks!



When I write: ls -l /dev/ttyACM0

I get:
crw-rw---- 1 root dialout 166, 0 2011-07-23 13:02 /dev/ttyACM0

I see that its in the dialout group, and my user is in it too.
If i write: groups username
I'm in : adm dialout cdrom plugdev lpadmin admin sambashare

noobiept

Wait, it is working... I just noticed that on the other computer I have I wasn't in the dialout group like in this one. It works now.

Sorry for the trouble, I'll still try out that template.
thanks!