avrdudes / avr-libc Goto Github PK
View Code? Open in Web Editor NEWThe AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
Home Page: https://avrdudes.github.io/avr-libc/
License: Other
The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
Home Page: https://avrdudes.github.io/avr-libc/
License: Other
Tue 25 Mar 2003 10:09:57 AM CET
Conversion works, but endptr is set to end of string rather than end of number.
This issue was migrated from https://savannah.nongnu.org/bugs/?2924
Tue 04 Nov 2003 05:57:42 PM CET
strlcpy_P and strlcat_P functions are missing in the documentation, even in the 1.0.1 docs. These functions were previously contributed by Reiner Patommel and are in the library.
This issue was migrated from https://savannah.nongnu.org/bugs/?6359
Thu 10 Apr 2003 10:13:49 PM CEST
In a larger ATmega128 project,
the original submitter of this bug (in AVRfreaks) suddenly
got:
itoa.o(.text+0x20): relocation truncated to fit: R_AVR_13_PCREL __udivmodhi4
This corresponds with
XCALL _U(__udivmodhi4); quotient in r23:r22, remainder in r25:r24
; clobbered: r0, r21, r26, r27
; call-used but preserved: r18, r19, r20, r30, r31
subi r24, 0xd0 ; + '0'
in libc/misc/itoa.S. XCALL is supposed to be an absolute
call for the avr5 target, but extracting itoa.o from
avr5/libc.a, and disassembling it reveals that it has
been assembled as an rcall.
Other functions migh probably be affected as well.
This issue was migrated from https://savannah.nongnu.org/bugs/?3184
Wed 08 Oct 2003 08:58:42 AM CEST
In definitions for UCSR0A: bit 2 is defined as PE0, this should be UPE0. In definitions for UCSR1A: bit 2 is defined as PE1, this should be UPE1. This according to datasheet for Atmega162(V) rev: 2513E-AVR-09/03
I guess this is the reson why PORTE bits are defined as PORTE0, PORTE1.... instead of PE0, PE1.. as would be normal.
I am usign WinAVR-20030913
This issue was migrated from https://savannah.nongnu.org/bugs/?5799
Mon 22 Sep 2003 04:51:32 PM CEST
Can you provide a small test case so this can be reproduced?
This issue was migrated from https://savannah.nongnu.org/bugs/?5454
Fri 21 Feb 2003 08:14:16 PM CET
When using WinAVR release 20030115, this code:
set_sleep_mode(SLEEP_MODE_IDLE);
returns parse error when -mmcpu=atmega8, this code:
set_sleep_mode(SLEEP_MODE_IDLE));
does not (I have no idea how MCU-specific this error is, I haven't investigated further).
This issue was migrated from https://savannah.nongnu.org/bugs/?2633
Wed 31 Mar 2004 08:20:00 PM CEST
Fuse-Mask in boot.h may be wrong. In current (31 Mar 04):
/* Define the bit positions of the Boot Lock Bits. */
#define BLB12 5
#define BLB11 4
#define BLB02 3
#define BLB01 2
#define __BOOT_LOCK_BITS_MASK (_BV(BLB01) | _BV(BLB02)
| _BV(BLB11) | BV(BLB12))
didn't work for me in an AVRStuido STK500-plugin-compatible bootloader on an ATmega16. To fix this issue here it has been changed like this:
/* Define the bit positions of the Boot Lock Bits. */
#define BLB12 5
#define BLB11 4
#define BLB02 3
#define BLB01 2
// mt:
#define LB2 1
#define LB1 0
#define LOCK6 6
#define LOCK7 7
#define __BOOT_LOCK_BITS_MASK (_BV(LB1) | _BV(LB2) |
_BV(LOCK6) | _BV(LOCK7))
BTW. The bug I've submited regarding sleep.h and ATmega169 haven't been fixed so far. At least a remark in the documentation (like the one in/for eeprom.h) would avoid time-consuming debugging on the users-side until someone has time to fix this bug.
This issue was migrated from https://savannah.nongnu.org/bugs/?8391
Mon 17 Mar 2003 06:52:40 PM CET
This is a bug in doxygen (as Joerg noted). The work around is to move the dox from the stdio.h header to the fdevopen.c source file.
This issue was migrated from https://savannah.nongnu.org/bugs/?2845
Fri 24 Oct 2003 12:52:45 PM CEST
The Functions printf() and printf_P assume, that the caller allways did a fdevopen() before.
If not, they writing to the registers (printf_P, line 44)
My Solution looks like this:
insert the following code at printf.c:41 and printf_p.c:43.
if (stdout == NULL) {
return EOF;
}
The check in printf.c protects the called vfprintf function.
This issue was migrated from https://savannah.nongnu.org/bugs/?6141
Wed 07 May 2003 05:46:31 PM CEST
Reduced severity as it's a documentation change.
This issue was migrated from https://savannah.nongnu.org/bugs/?3485
Mon 08 Sep 2003 08:47:25 AM CEST
Target: AT90S8515 8MHz
AVR-GCC 3.3, downloaded latest pgmspace.h for the new LPM_word_classic() macro, wich by the way works fine...
When i had to recompile a previous project containing printf_P(PSTR(...)); i received error message "pgmspace.h nested to deep."
This issue was migrated from https://savannah.nongnu.org/bugs/?5129
Thu 19 Jun 2003 01:01:57 AM CEST
Fixed with patch from Reiner Patommel.
This issue was migrated from https://savannah.nongnu.org/bugs/?3576
Thu 11 Mar 2004 08:34:50 PM CET
The _wdt_write(value) macro in wdt.h doesn't work with the ATmega169. The problem is that Atmel moved the WDTCR register to location 0x60, which is outside the range of an OUT instruction.
This issue was migrated from https://savannah.nongnu.org/bugs/?8119
Mon 09 Jun 2003 11:26:15 PM CEST
Doc bug only: set to lower priority
This issue was migrated from https://savannah.nongnu.org/bugs/?3839
Tue 26 Nov 2002 11:04:25 PM CET
When doing a "make install", the "Fixing transparency..."
message is displayed even though the previous "make"
already performed this step.
This is not supposed to happen, "make install" should
handle the source tree in a read-only manner.
This issue was migrated from https://savannah.nongnu.org/bugs/?1808
Thu 02 Jan 2003 06:36:03 PM CET
In sfr_defs.h, the bit_is_clear macro is declared as follow:
#define bit_is_clear(sfr, bit) (~inb(sfr) & _BV(bit))
If I watch code generated by compiler, the code is not sufficient. But
with this macro the size of code is decreazed (I ve just tested that on atmega target).
#define bit_is_clear(sfr,bit) !bit_is_set(sfr,bit)
Have you the same results and do you think it's interesting to replace the old version with this version ?
Best regards
Frantz
This issue was migrated from https://savannah.nongnu.org/bugs/?2111
Sat 14 Dec 2002 11:00:59 PM CET
Suggested fix applied in rev 1.6 of
include/avr/iom169.h.
Thanks!
This issue was migrated from https://savannah.nongnu.org/bugs/?1984
Thu 03 Apr 2003 03:58:29 PM CEST
Preprocessor logic in the sleep.h results in _SLEEP_TYPE = 2 for ATtiny26 and ATtiny15. It prohibits processing the SLEEP_MODE_ADC definition.
This issue was migrated from https://savannah.nongnu.org/bugs/?3088
Sat 30 Nov 2002 12:32:52 AM CET
In iom8.h:
The register is named GICR on the ATmega8 instead of GIMSK.
This issue was migrated from https://savannah.nongnu.org/bugs/?1836
Tue 28 Jan 2003 11:34:23 PM CET
The latest (and prior versions?) compiler generates the following code to disable the watchdog --- wdt_disable()---:
Outside interrupt routines:
in tmp_reg,SREG
cli
wdr
out 33,r24
out SREG,tmp_reg
out 33,r18
// 33 is the WDTCR
Inside interrupt routines:
ldi r24,lo8(24)
ldi r25,hi8(24)
out 33, r24
out 33, zero_reg
If the user is using any watchdog timeout other than 17ms, the interrupt version of the watchdog disable may actually cause a watchdog reset! To prevent this, the WDR instruction should be added in front of the interrupt code as in the non-interrupt code, or the prescaler bits should be preserved during the disable operation. In 'C' the user can avoid the problem by issuing a wdt_reset() instruction just before the wdt_disable() instruction.
In other words, any time you wish to disable the watchdog inside an interrupt routine use the following:
This issue was migrated from https://savannah.nongnu.org/bugs/?2419
Mon 23 Dec 2002 12:07:11 AM CET
Incidentally, Brian Dean reported a similar problem to
me a few hours ago. It turns out that gcc might
optimize calls to printf() using constant strings into
calls to puts() or putchar(), so i added a bunch of
functions that are reuqired by the standard.
(I always meant to write them some day... ;-)
This issue was migrated from https://savannah.nongnu.org/bugs/?2043
Mon 06 Jan 2003 04:18:55 PM CET
I believe I've found in bug that exists in the malloc() implementation in the
snapshots from 17dec2002 and 04nov2002.
Here's (basically) the code I'm running:
char *ptrs[32];
__malloc_heap_start = 0x8000;
__malloc_heap_end = 0xFFFF;
for (j = 0; j < 32; j++) {
ptrs[j] = (char )malloc(1024);
/ output j and ptrs[j] to serial port */
}
I would expect the last malloc() to return NULL, since there's not 1024 bytes
left in the heap. Instead, I get the following output:
The last malloc() returns a chunk of memory that is only 959 bytes before the
end of the heap!
This issue was migrated from https://savannah.nongnu.org/bugs/?2143
Tue 13 May 2003 03:44:20 PM CEST
Several assembler files in the avr-libc sources
have symbols that are meant to be local, but are being
exported into the symbol table anyway, for example:
.__do_copy_data_loop
This can confuse different debugging tools in different ways.
It's therefore best to only use truely local symbols in
assembler sources (either starting with ".L", or Unix-assembler
style numeric labels).
This issue was migrated from https://savannah.nongnu.org/bugs/?3573
Mon 23 Dec 2002 12:04:47 AM CET
avr/iom163.h incorrectly used the name UBRRH for this
register.
Fixed, thanks!
This issue was migrated from https://savannah.nongnu.org/bugs/?2042
Tue 27 Jan 2004 09:26:45 AM CET
ATmega64, maybe more cpu's, too
GCC-Compiler, version 3.3.1
This is the source
#include <avr/io.h>
#include <avr/ina90.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <avr/pgmspace.h>
#include <avr/boot.h>
#include <avr/eeprom.h>
char bits;
bits =....;
boot_lock_bits_set(bits);
results in some error code:
'BLB01' undeclared (first use in this function)
'BLB02' undeclared (first use in this function)
'BLB11' undeclared (first use in this function)
'BLB12' undeclared (first use in this function)
it looks like a missing define for BLBxy.
Greetings from Germany
Martin
This issue was migrated from https://savannah.nongnu.org/bugs/?7469
Mon 16 Dec 2002 05:43:44 PM CET
FAQ, #15, How to use external RAM, link for "main()".
This issue was migrated from https://savannah.nongnu.org/bugs/?1995
Thu 15 Jan 2004 10:28:57 PM CET
Hi , Ive found a problem with strncpy_P ,under some situations data is fetched from the incorrect sourse address because lpm is used instead of elpm when compiled for the mega128.
/snip
1e646: fb 01 movw r30, r22
1e648: dc 01 movw r26, r24
0001e64a <.strncpy_P_loop>:
1e64a: 41 50 subi r20, 0x01 ; 1
1e64c: 50 40 sbci r21, 0x00 ; 0
1e64e: 48 f0 brcs .+18 ; 0x1e662
1e650: 05 90 lpm r0, Z+ <<<< should be elpm r0, Z+ on mega 128 ?
1e652: 0d 92 st X+, r0 1e654: 00 20 and r0, r0 1e656: c9 f7
brne .-14 ; 0x1e64a 1e658: 01 c0 rjmp .+2 ; 0x1e65c
avr-libc 1.0.2
gcc v3.3.2
Cheers
Simon.
This issue was migrated from https://savannah.nongnu.org/bugs/?7276
Mon 02 Feb 2004 08:01:59 PM CET
printf and friends improperly handle non-null termnated strings when a %s argument has a precision.
"improperly handle" in this case is often a fatal error as the function is doing (effectively) strlen(). :-(
This issue was migrated from https://savannah.nongnu.org/bugs/?7556
Wed 07 May 2003 05:44:14 PM CEST
When using the at86rf401 and you include avr/interrupt.h, the inline function enable_external_int gives a false error: "No valid external interrupt control register defined.". The 86rf401 does not have an external interrupt control register.
This issue was migrated from https://savannah.nongnu.org/bugs/?3508
Mon 17 Mar 2003 07:32:34 PM CET
It is now documented.
BTW: What the heck does PRG_RDB mean? This is not a very intuitive name.
This issue was migrated from https://savannah.nongnu.org/bugs/?2839
Mon 17 Mar 2003 07:30:33 PM CET
This is really a non-issue since the declaration is #if'd out anyways.
This issue was migrated from https://savannah.nongnu.org/bugs/?2838
Fri 11 Apr 2003 09:38:45 PM CEST
ADATE is the correct naming for the ATmega16, according to
Atmel's datasheet. Naming this bit ADFR would even risk the
danger of blindly assuming that the ATmega16 had a free-running
mode for its ADC which it actually doesn't have.
The original submitter never responded to this when it was
brought up in the avr-libc-devel mailing list.
This issue was migrated from https://savannah.nongnu.org/bugs/?2958
Wed 25 Jun 2003 10:57:54 PM CEST
A prologue/epilogue of function, in which there is a call setjmp(), contains preservation/restoration of all call-saved registers. Exception make function main() and global register variables.
Nevertheless, setjmp/longjmp too keeps/restores registers r2-r17.
Restoration of local variables after operation longjmp(), certainly is
pleasant, but it is no necessary. But loss of changes in global registers,
in my opinion, is inadmissible.
avr-gcc (GCC) 3.3.1 20030519 (prerelease)
avr-libc-20030422cvs
file #2340: 20050108-setjmp.tar.gz
file #2344: setjmp-20050109.tar.gz
file #2346: setjmp-20050110.tar.gz
This issue was migrated from https://savannah.nongnu.org/bugs/?4101
Tue 29 Apr 2003 05:41:16 AM CEST
outb() [and inb()/outw()] are not deprecated. Only outp() and inp() have been deprecated.
There are some portability issues that are better handled by using outb() instead of the = ; idiom. Therefore, outb()/inb()/outw()/inw() will probably see a long life in avr-libc.
The avrfreaks posting was incorrect.
One caveat: Since the last stable release (20020203), the order of the arguments for outb()/outw() has changes.
This issue was migrated from https://savannah.nongnu.org/bugs/?3327
Thu 12 Feb 2004 09:04:55 PM CET
Email notifications have been down since the savannah comromise. I've made some changes and am hoping it will be fixed.
Once changes to this bug report start showing up on the mailing list again, the bug can be closed.
This issue was migrated from https://savannah.nongnu.org/bugs/?7700
Thu 19 Jun 2003 12:37:16 AM CEST
Fixed with patch from Reiner Patommel.
This issue was migrated from https://savannah.nongnu.org/bugs/?3575
Thu 19 Feb 2004 07:45:38 PM CET
Line 405 in vfscanf.c:
if (flags & (FLLONG & FLUNSIGNED))
Should it be something more like this?:
if ((flags & FLLONG) && (flags & FLUNSIGNED))
This issue was migrated from https://savannah.nongnu.org/bugs/?7802
Wed 15 Oct 2003 06:20:59 AM CEST
__lpm_inline is in the avr-libc FAQ (Why do all my "foo...bar" strings eat up the SRAM?), but is not in the "MODULES" section anywhere i've noticed.
itoa() and related docs don't say how long a string should be to prevent a memory over-run. I'd guess 7 (-32767\0).
This issue was migrated from https://savannah.nongnu.org/bugs/?5976
Tue 10 Feb 2004 07:50:58 PM CET
__subsf3 / __addsf3 leaves R1 undefined when returning via fp_split_nan
This issue was migrated from https://savannah.nongnu.org/bugs/?7667
Wed 03 Mar 2004 05:56:56 PM CET
The function dtostrf() probably destoys R16 and R17
(string pointer) registers. These registers are pushed to
stack at the beginning of dtostrf(), but they seem to be
restored to the wrong registers at the end of function.
This issue was migrated from https://savannah.nongnu.org/bugs/?7989
Mon 29 Dec 2003 05:25:03 PM CET
for ATmega169 SM* are all in EMCUCR.
This issue was migrated from https://savannah.nongnu.org/bugs/?6352
Sat 30 Nov 2002 11:00:43 AM CET
This issue was migrated from https://savannah.nongnu.org/bugs/?1837
Thu 03 Apr 2003 12:21:34 PM CEST
Bits and port defitions for the ATtiny26 are incomplete.
Reamaining definitions in attachment (diff for avr-libc-20030303cvs version).
This issue was migrated from https://savannah.nongnu.org/bugs/?3081
Thu 16 Jan 2003 02:17:43 PM CET
Parts of the inline assembler documentation
(the inline asm cookbook, and parts of the FAQ) refer to
the possibility to use CPP macros inside inline asm. While
this is basically possible, the way the IO port macros are
currently defined, they can no longer be used for that
purpose. Just watch the CPP output to see why... The
respective FAQ entry should outline this, and the inline
asm cookbook should be updated as well.
This issue was migrated from https://savannah.nongnu.org/bugs/?2233
Wed 30 Oct 2002 11:27:22 PM CET
Result for asin() is incorrect. See:
http://www.avr1.org/pipermail/avr-gcc-list/2002-October/005288.html
This issue was migrated from https://savannah.nongnu.org/bugs/?1562
Fri 15 Nov 2002 01:24:55 PM CET
memcmp (__const void __s1, __const void__s2, size_t __n)
seems to fail using the following parameters
*s1={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
*s2={0xFF,0x00,0x00,0x00,0x00,0x00};
n = 6;
expected result was >0
actual result was <0
the current inline code seems to expect signed characters
Version Juni 2002
This issue was migrated from https://savannah.nongnu.org/bugs/?1720
Wed 05 Nov 2003 04:09:59 PM CET
I wrote a small function that allows users to specify delay times in ms (very usefull when initializing a LCD). I copied it to delay.h. Maybe other users find it usefull too.
This issue was migrated from https://savannah.nongnu.org/bugs/?6376
Fri 08 Nov 2002 07:47:17 PM CET
PE0 redefined with different values in iom169.h. This only gave a compilation warning.
This issue was migrated from https://savannah.nongnu.org/bugs/?1648
Wed 06 Nov 2002 01:08:58 AM CET
In io8.h the General Interrupt Control Register is listed as GIMSK instead of GICR (address 0x3B).
This issue was migrated from https://savannah.nongnu.org/bugs/?1619
Mon 09 Dec 2002 12:00:52 AM CET
When doing a floating point comparision, -Inf is not
detected properly as a negative number.
I. e.,
if (a < 0.0) { ... }
will not execute the code in { ... } if a is equal -Inf.
file #3041: inf-cmp-test.c
file #1907: fplib-20060220.tar.bz2
file #1860: fplib-20060224.tar.bz2
file #1828: avr-libc-1.4.3-20060224.diff.bz2
file #1830: avr-libc-1.4.3-20060225.diff.bz2
file #1826: fplib-20060225.tar.bz2
file #1623: fplib-20060305.tar.bz2
file #1584: avr-libc-1.4.3-20060305.diff.bz2
file #9869: fplib-20060501.tar.bz2
file #9870: avr-libc-1.4.4-20060501.diff.bz2
file #11557: avr-libc-1.4.5-20061219.diff.bz2
This issue was migrated from https://savannah.nongnu.org/bugs/?1929
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.