avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Setting pin to high in function instead of main, inst


From: Richard Zetterberg
Subject: Re: [avr-gcc-list] Setting pin to high in function instead of main, instructions in main never run?
Date: Thu, 01 Mar 2012 16:00:50 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for the input Georg-Johann and Johannes.

Georg-Johann: I double checked the fuses and the watchdog is not active.

Johannes: I'm not sure how I would go about doing that. But I just
read a document called "Getting started with GCC for AVR32" and found
the following:

"The linking process needs information about code and data memory
location. Using a linker script provides this. If specifying which
device you are compiling code for by using the ?-mpart=<part>? option
in avr32-gcc, a default linker script for that device will be used."

That got me thinking, maybe that's the problem, that I don't provide
the mmcu when linking. So I changed this line in the makefile:

elf:
        avr-gcc example.o -o example.elf

To this:

elf:
        avr-gcc -mmcu=atmega328 example.o -o example.elf


And after I compiled, linked, hexed and upload the problem was no
longer present.

With my no-existing experience I conclude that's the source of the
problem, and thus the problem is solved.

Does that make sense or is that just a coincidence that it is now
working?

On 3/1/12 3:30 PM, Georg-Johann Lay wrote:
> 
> You are sure there is no watchdog active?
> 

On 3/1/12 3:24 PM, Johannes Bauer wrote:
> 
> Why don't you include the whole program assembly (i.e. after
> linking), but only compile units? This would also show the startup
> code, where a fault in setting up the stack pointer would be
> visible (i.e. would cause the "call" to fail and therefore
> resetting the MCU instead of the behavior you desire).
> 
> Best regards, Joe
> 
> _______________________________________________ AVR-GCC-list
> mailing list address@hidden 
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPT48iAAoJEP99n2Mvs+ma1sgP/RQVupZ9lSFGzLrgbbZDmdIk
Mb5QCZZbNtWNM4X6qswZr9I5ACJhlhDpB69CdHghWZdIFkH5bIMkPO2x1HKBwduN
hIwCmaSPqirtMy9ktO07LqSwsfzh9WMNGTCNmfDvl0DjwW/dS0HyW/9ZjCpzHz4a
EvB/KJuiJ6c8iOEA15gwYsaUdJeNezlK9Q2LgFk6cX8dOdGZ5Tds9dU+Jbb+B6PC
f1c+SnsHGK4q5qjf+sGrM0cRwDbBH0CY9Vuzb5Sx5gHF2m31HiZQMg1cb/24DSeI
PGq7wadQM+5dOjYtOFNIpCA/mXoKuQtyxloY35phG8DHWECRPaumQ6gPNbZPl329
HvakR32djZskGcuxzyJ1o5ObSAf+0istIcV/zh4Q4Lkpw7eopbGYevdpjfbA+nOC
1qicoQA8eIoTG5WztDLluAiCVZ7k1XKlQFDBxAdbs503W3P3X7jhP/c2n4TPR6tG
gzF6ljK+30MtpIjgBNALNEZOfVma0y7FaOXNgO2NC2vM7iGVzkldjbcdyen/rrA3
aYiTkfTSV01Hvri4zzYZTSEX/hWsujiNgIjGxnGSYAO5+svyGs/fVDAIx5tvMgID
cJGaswgt3yhMrjDH3G7i/zVWDzLONOzOH0ky/0L9f9FJnlWtLkYN1zrHu3f7T7YN
YpbHJ+hWAEOKvroiLhQ/
=ma5I
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]