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
2 answers

Preprocessor: missing binary operator before token

I'm trying to set up the USART module in an XMEGA micro controller and stumble over an error I can not find. For clarity I give you the complete code. So nothing in this header file is missing. (F_CPU is defined in the main file) #ifndef…
Peder
  • 345
  • 1
  • 4
  • 14
0
votes
1 answer

Do I have to include stdint in an AVR C++ project?

I'm working on a C++ roject, in Atmel Studio 7. Do I have to include stdbool.h, stdint.h or similar AVR-GCC libraries in my headers/C++ files? bool is a keyword in C++, but I don't know if it applies to microcontroller projects, since not all C++…
klenium
  • 2,468
  • 2
  • 24
  • 47
0
votes
3 answers

inline assembly in avr

void save_context(uint8_t index) { context *this_context = contextArray + index; uint8_t *this_stack = this_context->stack; asm volatile("st %0 r0": "r"(this_stack)); } I have something like this. !!! I would like to store the…
jiadong
  • 135
  • 7
0
votes
0 answers

Error when an executable file is trying to output a file into internal storage in Android

I'm trying to compile Arduino's .ino files in Android. So I am making use of avr-gcc, avr-g++, avr-objcopy executable(binary) files. These files produces certain files as output in a given location. I have used /data/local/tmp…
0
votes
2 answers

Remember the iteration when a condition was met

I'm working on AtMega8 in Eclipse. In a for loop I want to check if pins of PIND are 1. If so I want to have a char array of pins that were 1 in a certain iteration with the number of that iteration. If some pin of PIND was 1 in a certain…
Nollie
  • 141
  • 2
  • 11
0
votes
2 answers

avr-gcc warning: initialization from incompatible pointer type

I'm unsure how to fix the warning for this piece of code (warning pertains to the second line). This is not my code but it does work perfectly. However, I'd like to get rid of the warning but am confused. v is an unsigned long that we want to put to…
user4346741
0
votes
0 answers

AVR inline assembly: output variable changes without instruction to change it

I am trying to write some code in inline assembly for ATmega328P I found that my output variable changes not in way i expected. So i reduced original code to this: uint8_t a=0; __asm__ ( "nop " "\n\t" :"=&r" (a) : …
Alex
  • 2,009
  • 6
  • 24
  • 27
0
votes
1 answer

unable to find a register to spill in class 'POINTER_REGS' (maybe compiler bug)

The issue is that this code will not compile with avr-g++ compiler. It produces the error in the headline. When you comment out either line 15 or 16, it will compile. If you remove ''colourArray'' or ''blackArray'' from the right side of line 15 and…
Zinoex
  • 512
  • 2
  • 8
  • 22
0
votes
0 answers

Makfile, undefined reference to `main'

I'm writing my first Makefile for a AVR-project and ran into some problems. It says "undefined reference to `main'" the first time that I execute "make" but spits out all object files and a main.map file. The next time I execute "make" it completes…
flott
  • 231
  • 1
  • 11
0
votes
1 answer

Using doxygen with avr-gcc variable types

I want to use doxygen for my microcontroller projects with avr-gcc. Doxygen is working good as expected, but i have a problem with the variables. In avr-gcc special variable types are used that are not recognized by doxygen. Like in this…
Karsten
  • 23
  • 4
0
votes
3 answers

Write default values to eeprom

This is my Setup: Atmel studio 7.0 avr-gcc ATmega644PA I'm trying to write default values to the eeprom. I mean: in code, predefined values at a specific place in the eeprom. I can use: __attribute__((section(".eeprom"))) Which works to put the…
Jon V
  • 506
  • 1
  • 3
  • 21
0
votes
1 answer

avrdude programmer is not responding when uploading a .hex file

I'm trying to upload a hex file to atmega328 on my arduino UNO board that I builded with eclipse's AVR plugin but when I run avrdude -pm328p -carduino -P/dev/ttyACM0 -b9600 -Uflash:w:/home/bruno/workspace/testAVR/Release/testAVR.hex:a I get avrdude:…
chosethecake
  • 5
  • 1
  • 4
0
votes
0 answers

Atmel Studio- ATmega128 bootloader

I am trying to write a customized boot-loader for ATmega AVR's. I write a code, and it work perfectly in small AVR's like ATmega32A and ATmega8A. But when i want to use it in ATmega128A, it writes nothing in flash segment. I'm sure Fuses are…
0
votes
1 answer

RPM meter and send value with serial communication

I have a question about how to reading RPM and send value with serial It's my code: char init(void) { UBRRH=(uint8_t) (UBRR_CALC>>8); UBRRL=(uint8_t) UBRR_CALC; UCSRB=(1<
Lukis triya
  • 1
  • 1
  • 4
0
votes
2 answers

Send Decimal with USART in ATMEGA32

I have problem in send a serial data via USART it's send a ASCII not decimal. this is my code : while(!(UCSRA&(1<>8); UBRRL=(uint8_t)…
Lukis triya
  • 1
  • 1
  • 4