Questions tagged [avr-gcc]

avr-gcc is a suite of executable software development tools for Atmel AVR RISC processors

avr-gcc is a suite of executable software development tools for Atmel AVR RISC processors, hosted on the Windows platform, has GNU GCC compiler for C/C++.

Atmel provides also an AVR Toolchain, which is a collection of tools/libraries used to create applications for AVR microcontrollers. The collection includes compiler, assembler, linker and Standard C & other math libraries.

Most of these tools are based on efforts from GNU (www.gnu.org), and some are developed by Atmel.

614 questions
0
votes
1 answer

How to tell Make to search for header files

If I wanted to compile a simple AVR C program, I would simply go: avr-gcc -mmcu=atmega2560 -Os avr.c -o avr.o And the code would compile with no errors. However, as soon as I put the above command in a Makefile, I get a compilation error saying…
chao
  • 1,893
  • 2
  • 23
  • 27
0
votes
1 answer

storing characters in EEPROM & echoing back

Am trying to write a program for AVR STK600 board in which am cycling through LEDs. When a switch is pressed, appropriate LEDs turns on (upto this point, everything goes well). Now am adding another functionality to the board, trying to use USART…
sneezy
  • 135
  • 3
  • 12
0
votes
2 answers

Atxmega USART flow control

I'm having some troubles with USART flow control on the Atxmega256. I'm communicating with a modem which uses RTS/CTS for flow control. Once the modem sets CTS to low, I want to stop sending data until it goes high again. I'm currently using…
Fredrik
  • 301
  • 3
  • 10
0
votes
1 answer

defining char datatype and and using with sprintf

I had following setup earlier: String INSERT_SQL = ""; // inserting to sql database on mysql server INSERT_SQL = ""; INSERT_SQL.concat("INSERT INTO arduinoSensorData.sensorLog (out_temperature, out_humidity, "); …
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
0
votes
2 answers

Atmega8 - Compile and link C and Assembly-files with one Makefile

I'm playing arround with the Atmega8 and Assembly. So I came to the point where it would be nice to have a Makefile, wich looks through the folder, grabs every *.S, *.c and *.cpp file, link and compile them to a flashable binary. Im using the…
Nico
  • 320
  • 1
  • 4
  • 12
0
votes
1 answer

itoa function for byte array

Is there an easy way to do the following: Convert a byte array like so {1,3,0,2,4} to a char array like so {'1','3','0','2','4'} or "13024". I can do the following ( I think ) but it is more cumbersome: …
user3493202
0
votes
0 answers

Can registers be referenced in Atmel Studio (ATtiny2313)?

From what I've seen so far, it's legal to use a pointer to a register but there was nothing about references. Is something like that legal? byte ®isters[4] = {DDRA, DDRB, DDRC, DDRD}; I am using Atmel Studio 7.0
Quest
  • 2,764
  • 1
  • 22
  • 44
0
votes
1 answer

Variadic functions not working on arduino

I'm trying to write my own basic libraries to program the Arduino in pure C++. I've tried using a variadic function to implement something similar to Linux's ioctl() to control the SPI module but it just won't work and I have no idea why. I don't…
0
votes
2 answers

Same function within different files returns different results

I'm currently writing a library for learning purposes and I've run into a weird problem. So, 1. I have a function in the main body (main.c) that reads the DDRAM address of an LCD. 2. I move the exact same function into the library file…
Efthymios
  • 253
  • 3
  • 10
0
votes
1 answer

AVR GCC, assembly C stub functions, eor and the required constant value

I'm having this code: uint16_t swap_bytes(uint16_t x) { asm volatile( "eor, %A0, %B0" "\n\t" "eor, %B0, %A0" "\n\t" "eor, %A0, %B0" "\n\t" : "=r" (x) : "0" (x) ); return x; } Which…
milkpirate
  • 267
  • 1
  • 18
0
votes
1 answer

Atmega, avr-gcc, assembly include file from another directory

I can't convince avr-gcc on windows to include a *.h file from another directory: >avr-gcc -Wa,-gdwarf2 -x assembler-with-cpp -c -mmcu=atmega256rfr2 halW1.S C:\Users\me\AppData\Local\Temp\ccjzoYpN.s: Assembler…
user1797147
  • 915
  • 3
  • 14
  • 33
0
votes
1 answer

My program runs well on gnu-gcc but not on gnu gcc for avr

I'm learning C. So I wrote this distance timer program. It runs well with gnu-gcc compiler. But but with gnu-gcc for avr it does compile but when I run it I get only a cmd session that does nothing except disappearing once I press any button. I…
Allan Mayers
  • 185
  • 1
  • 2
  • 8
0
votes
1 answer

I don't have this line: "cc drone.c hex1 clean -o drone"

I make a simple makefile for compile the code for a project. when I use the command: $ make drone The output files are correct, but the make utility gives me a result that I don't understand (from line 10 to line 14): 1: avr-gcc -g -Os…
0
votes
1 answer

youcompleteme and finding h files

I've got an embedded project I'm doing and I'd like to use Vim and YCM to do it. I've got the following code as a quick prototype: #include #define USART_BAUDRATE 9600 #define BAUD_PRESCALE (((F_CPU/(USART_BAUDRATE*16UL)))-1) int…
testname123
  • 1,061
  • 3
  • 20
  • 43
0
votes
1 answer

How can I convert a string sent over UART to integer in python?

I'm having difficulty converting a string I'm receiving over UART to the decimal version of it. I read in one byte with port.read(1) then print it print "%s: %s" % ( time.ctime(time.time()), str) This prints out the expected character that matches…
minnymauer
  • 374
  • 1
  • 4
  • 17