Questions tagged [avr-toolchain]
The AVR® Toolchain is a collection of tools/libraries used to create applications for AVR microcontrollers. This collection includes compiler, assembler, linker and Standard C and math libraries.
33 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
151
views
Why does the use of serial.readBytes increase program size by 10kb?
If I put this in my arduino program, in main.cpp, I suddenly run out of memory for flash program size:
if(msgSize > 2) {
//sr::sequentialRead(&serialRead, newTram.hash);
uint8_t bytes[...
1
vote
2
answers
251
views
What's Memory Allocation technique in Arduino
I am currently working on an assignment for my embedded systems course, and my professor has asked us to determine the memory allocation technique employed in Arduino. Specifically, I need to identify ...
1
vote
1
answer
376
views
How do I build and upload a C++ program without the Arduino Library or IDE?
Note: This is a reference question (but feel free to write answers of your own!)
I want to use the AVR tools directly -- no arduino-builder or arduino-cli. I would also like compilation and uploading ...
1
vote
1
answer
2k
views
AVRdude does not read the FUSE byte values correctly
I am exploring the ATmega328p MCU via a standard Arduino UNO, with the help of avr-gcc toolchain and AVRdude (All in the WINAVR package). I have successfully programmed the board a few times with it. ...
2
votes
1
answer
480
views
What happens when you call malloc()/free()/new/delete?
So I understand that generally speaking, dynamic allocation should be avoided. My question isn't how or why, but what happens when you call a function that allocates memory?
On Windows or Linux, when ...
13
votes
1
answer
2k
views
_delay_ms() is much slower than expected (by a factor of 6) on TinyAVR 0/1 (ATTiny1604)
I designed a custom AVR development board using the Atmel ATTiny1604 microcontroller. It belongs to the new Tiny-0 family, due to its recentness, some required changes to relevant toolchains have yet ...
1
vote
1
answer
515
views
What else is consuming Data Segment reported by avr-size?
I am facing a low memory available problem in arduino. I am compiling a big sketch for arduino mega 2560.
Analysing a .elf file, the avr-size tool gives:
text data bss dec hex filename
...
1
vote
1
answer
2k
views
Interleave disassembly + source with avr-objdump
I have a C program for the attiny85, that I want to disassemble and display with interleaved source code.
Here's my program:
test.c
#include <avr/io.h>
int main() {
for(int i=0; i<100; ...
4
votes
1
answer
549
views
MEGA 2560: Simple program - One analogWrite turns off the other
I'm using Windows 10, Arduino 1.8.12 (Windows Store 1.8.33.0)
I have an Arduino MEGA 2560 and a red LED connected to pin 4.
#define RED 4
#define GREEN 2
void setup() {
analogWrite(GREEN, 0);
...
0
votes
1
answer
372
views
Why is Toolchain Not Updated with Arduino IDE Install on Mac
I have not been doing any Arduino work for about a year. The last time I ran the Arduino IDE was in the previous version of MacOS. Now that I have updated to the latest MacOS Version Catalina (10.15....
1
vote
2
answers
506
views
Multiple defintion error, Linker error [closed]
Trying to create an elf file for two sets of files in different folders.
LIDARBOT.h
-----------
#ifndef LIDARBOT_H_
#define LIDARBOT_H_
#include <avr/io.h>
#include "drivers/motors.h"
#endif
...
0
votes
1
answer
75
views
ISR definition causing boot loop?
I am trying to compile and upload code to an Arduino Uno from the command-line, however I seem to be experiencing an odd issue.
When I compile this code:
#include <avr/interrupt.h>
#include &...
0
votes
1
answer
124
views
My software serial code won't work at > 4800bps
I've put together a simple software serial (send-only) implementation for use on my attiny8[45] microcontrollers. I realize that there are more efficient USI-based implementations out there; this was ...
2
votes
1
answer
476
views
AVR-GCC can't call function located on fixed address
I wrote the following code:
#include <avr/io.h>
__attribute__((noinline, section(".app_start"))) void app_start() //app_start section starts at 0xFA0
{
//register_packet_dispatch(...
1
vote
1
answer
5k
views
How would I include Arduino libraries using AVR-gcc without the IDE?
I am writing my own code for the Arduino Uno. I compile my code with AVR-gcc, and then upload it with AVRdude. I am not using the Arduino software, but I do have it installed and working on my PC. I ...
user avatar
user37286