Giter Site home page Giter Site logo

avrdudes / avr-libc Goto Github PK

View Code? Open in Web Editor NEW
220.0 220.0 50.0 19.46 MB

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

Makefile 0.04% Shell 0.09% C 33.12% Pawn 0.01% C++ 0.03% M4 0.01% Assembly 66.63% Python 0.05% XSLT 0.01% Perl 0.01%

avr-libc's People

Contributors

3-14152898 avatar amylaar avatar arcanum avatar aurel32 avatar dl8dtl avatar gpollo avatar jhol avatar kajahama avatar landfillbaby avatar maribu avatar matthijskooijman avatar onitake avatar sprintersb avatar sq8kfh avatar troth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avr-libc's Issues

[bug #3184] XCALL resolved incorrectly in avr5/libc.a

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

[bug #5799] error(?) in iom162.h

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

[bug #8391] Fuse mask in boot.h wrong?

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

[bug #6141] printf(), printf_P() dont check if STDOUT == NULL

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

[bug #2111] Enhancement of code in sfr_defs.h

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

[bug #2419] Disabling the Watchdog

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:

wdt_reset();
wdt_disable();

This issue was migrated from https://savannah.nongnu.org/bugs/?2419

[bug #2143] malloc() routines chunk smaller than requested

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:

  • = 000080021 = 00008404
    2 = 00008806
    -cut-
    29 = 0000f43c
    30 = 0000f83e
    31 = 0000fc40

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

[bug #3573] Make local symbols in .S files truely local

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

[bug #7469] "Problem" by using the library function "boot_lock_bits_set"

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

[bug #7276] avr-libc 1.0.2, strncpy_P using lpm on mega128

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

[bug #2958] Error in iom16.h

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

[bug #4101] setjmp/longjmp destroy changes in global registers

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

[bug #3327] I read from phorum that outb() is deprecated? But still can found a note from library "Use outb() in new programs".

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

[bug #2233] Documentation issues with inline asm

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

[bug #1720] memcmp bug ?

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

[bug #1929] -Inf not detected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.