Why is my Atmega328p program freezing when I add a function?Java program FreezesProgram freezes when called by script!Why does this class freeze the program?ATtiny programming a function - appears to freezeHow to store additional code sections in FLASH memory (AVR, GCC)Why does the java program freeze on 113882?Reading EEPROM AVRC# Program freezes in for loopWhy is my command prompt freezing on Windows 10?python program freezes when running for a few days
How would a developer who mostly fixed bugs for years at a company call out their contributions in their CV?
Why does FOO=bar; export the variable into my environment
Why isn't Earth tidally locked to the sun?
Can we assume that a hash function with high collision resistance also means highly uniform distribution?
How to teach an undergraduate course without having taken that course formally before?
Why would a rational buyer offer to buy with no conditions precedent?
Are there any German nonsense poems (Jabberwocky)?
Is it legal to have an abortion in another state or abroad?
Cardio work for Muay Thai fighters
What is the difference between LORD and GOD?
Are runways booked by airlines to land their planes?
Co-author wants to put their current funding source in the acknowledgements section because they edited the paper
Did this character show any indication of wanting to rule before S8E6?
Is keeping the forking link on a true fork necessary (Github/GPL)?
Why did Jon Snow do this immoral act if he is so honorable?
shell script is not executed after adding it as a crontab job
Freedom of Speech and Assembly in China
Why A=2 and B=1 in the call signs for Spirit and Opportunity?
3 prong range outlet
Why isn't 'chemically-strengthened glass' made with potassium carbonate? To begin with?
“For nothing” = “pour rien”?
Why does splatting create a tuple on the rhs but a list on the lhs?
What is the recommended procedure to land a taildragger in a crosswind?
What were the Ethiopians doing in Xerxes' army?
Why is my Atmega328p program freezing when I add a function?
Java program FreezesProgram freezes when called by script!Why does this class freeze the program?ATtiny programming a function - appears to freezeHow to store additional code sections in FLASH memory (AVR, GCC)Why does the java program freeze on 113882?Reading EEPROM AVRC# Program freezes in for loopWhy is my command prompt freezing on Windows 10?python program freezes when running for a few days
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm trying to create a simple program on an Atmega328p. When I include only the main function it works fine, but adding another function (even without calling it) causes the microcontroller to freeze (the light doesn't blink at all).
I've narrowed it down to simply adding an empty function. The below freezes - by simply commenting out the function it works fine (light blinks).
#include <util/delay.h>
#include <avr/io.h>
int main(void)
DDRB
void Somerandomcrap(char data)
$ avr-gcc -mmcu=atmega328p -Os -Wall -DF_CPU=16000000 -I inc/ -c -o src/main.o src/main.c
$ avr-gcc -o main.elf src/main.o
$ avr-objcopy -O ihex main.elf main.hex
$ avrdude -c usbtiny -p atmega328p -U flash:w:main.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (80 bytes):
Writing | ################################################## | 100% 0.16s
avrdude: 80 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 80 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.09s
avrdude: verifying ...
avrdude: 80 bytes of flash verified
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)
avrdude done. Thank you.
freeze avr-gcc
add a comment |
I'm trying to create a simple program on an Atmega328p. When I include only the main function it works fine, but adding another function (even without calling it) causes the microcontroller to freeze (the light doesn't blink at all).
I've narrowed it down to simply adding an empty function. The below freezes - by simply commenting out the function it works fine (light blinks).
#include <util/delay.h>
#include <avr/io.h>
int main(void)
DDRB
void Somerandomcrap(char data)
$ avr-gcc -mmcu=atmega328p -Os -Wall -DF_CPU=16000000 -I inc/ -c -o src/main.o src/main.c
$ avr-gcc -o main.elf src/main.o
$ avr-objcopy -O ihex main.elf main.hex
$ avrdude -c usbtiny -p atmega328p -U flash:w:main.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (80 bytes):
Writing | ################################################## | 100% 0.16s
avrdude: 80 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 80 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.09s
avrdude: verifying ...
avrdude: 80 bytes of flash verified
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)
avrdude done. Thank you.
freeze avr-gcc
add a comment |
I'm trying to create a simple program on an Atmega328p. When I include only the main function it works fine, but adding another function (even without calling it) causes the microcontroller to freeze (the light doesn't blink at all).
I've narrowed it down to simply adding an empty function. The below freezes - by simply commenting out the function it works fine (light blinks).
#include <util/delay.h>
#include <avr/io.h>
int main(void)
DDRB
void Somerandomcrap(char data)
$ avr-gcc -mmcu=atmega328p -Os -Wall -DF_CPU=16000000 -I inc/ -c -o src/main.o src/main.c
$ avr-gcc -o main.elf src/main.o
$ avr-objcopy -O ihex main.elf main.hex
$ avrdude -c usbtiny -p atmega328p -U flash:w:main.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (80 bytes):
Writing | ################################################## | 100% 0.16s
avrdude: 80 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 80 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.09s
avrdude: verifying ...
avrdude: 80 bytes of flash verified
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)
avrdude done. Thank you.
freeze avr-gcc
I'm trying to create a simple program on an Atmega328p. When I include only the main function it works fine, but adding another function (even without calling it) causes the microcontroller to freeze (the light doesn't blink at all).
I've narrowed it down to simply adding an empty function. The below freezes - by simply commenting out the function it works fine (light blinks).
#include <util/delay.h>
#include <avr/io.h>
int main(void)
DDRB
void Somerandomcrap(char data)
$ avr-gcc -mmcu=atmega328p -Os -Wall -DF_CPU=16000000 -I inc/ -c -o src/main.o src/main.c
$ avr-gcc -o main.elf src/main.o
$ avr-objcopy -O ihex main.elf main.hex
$ avrdude -c usbtiny -p atmega328p -U flash:w:main.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (80 bytes):
Writing | ################################################## | 100% 0.16s
avrdude: 80 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 80 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.09s
avrdude: verifying ...
avrdude: 80 bytes of flash verified
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)
avrdude done. Thank you.
freeze avr-gcc
freeze avr-gcc
edited Mar 23 at 23:13
Brian
asked Mar 23 at 23:08
BrianBrian
32
32
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Figured it out - it was because I was passing the MCU type only in the compiler stage, but not in the linker stage.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319209%2fwhy-is-my-atmega328p-program-freezing-when-i-add-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Figured it out - it was because I was passing the MCU type only in the compiler stage, but not in the linker stage.
add a comment |
Figured it out - it was because I was passing the MCU type only in the compiler stage, but not in the linker stage.
add a comment |
Figured it out - it was because I was passing the MCU type only in the compiler stage, but not in the linker stage.
Figured it out - it was because I was passing the MCU type only in the compiler stage, but not in the linker stage.
answered Mar 26 at 4:09
BrianBrian
32
32
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319209%2fwhy-is-my-atmega328p-program-freezing-when-i-add-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown