Re: [avr-gcc-list] Reusing code and variables from bootloader in main program

2010-06-26 Thread Lars Noschinski
* Andrey Demenev [10-06-27 00:04]: > I have atmega64 with SD card connected. The card is used for storing > WAV files, logs, etc. I want to add a bootloader that would upgrade > the main program if certain file is present on the card. Using > separate copies of filesystem library in main program a

Re: [avr-gcc-list] progmem and section attributes

2010-06-17 Thread Lars Noschinski
* Stu Bell [10-06-10 09:23]: > Lars Noschinski wrote: > > > > I've got an array which I want to be stored at a specific > > place in the flash memory. Currently, this variable is marked > > with the progmem attribute, but this is not compatible with > >

[avr-gcc-list] progmem and section attributes

2010-06-10 Thread Lars Noschinski
Hi! I've got an array which I want to be stored at a specific place in the flash memory. Currently, this variable is marked with the progmem attribute, but this is not compatible with using the section attribute. Does using the section attribute to place the variable outside of the .data section i

Re: [avr-gcc-list] Re: C aliasing rules

2010-05-19 Thread Lars Noschinski
Hi! * Bernard Fouché [10-05-19 17:06]: [reordered quote] > >>>// > >>>--- > >>>void xteaDecrypt(uint32_t v[2], uint32_t const k[4]) { > >>>uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*XTEA_ROUNDS; > >>>for

Re: [avr-gcc-list] Re: C aliasing rules

2010-05-19 Thread Lars Noschinski
Hello! * David Brown [10-05-18 21:01]: Thanks for your answer, David. > Lars Noschinski wrote: > >I'm trying to debug a strange problem, which depends on whether a > >function is inlined (then it's broken) or not (then it's ok). Can > >someone tell me if the

[avr-gcc-list] C aliasing rules

2010-05-18 Thread Lars Noschinski
Hello! I'm trying to debug a strange problem, which depends on whether a function is inlined (then it's broken) or not (then it's ok). Can someone tell me if the following code snippet violates the C aliasing rules for b1 (declared as uint8_t*, written as uint32_t* by xteaDecrypt)? If I read http

Re: [avr-gcc-list] Why are we using EICALL and EIJMP for AVR256?

2009-12-15 Thread Lars Noschinski
* andrewhutchin...@cox.net [09-12-15 19:09]: > void (*fptr)(); > > fptr = main; > > (*fptr)(); //Will use EICALL - should be CALL main Hm, this problem seems to exist not only for the "big device". Using gcc 4.3.4 (from debian testing) on following C file with $ avr-gcc -Wa,-adhlns=foo.lst f

Re: [avr-gcc-list] New GCC warning - how to silence?

2007-04-07 Thread Lars Noschinski
* Eric Weddington <[EMAIL PROTECTED]> [07-04-07 08:56]: The makefile template that has been shipping with WinAVR since 2002 has consistently had -funsigned-char and -fshort-enums in the compiler flags. Not everybody uses WinAVR or mfile. For example, the gcc-avr debian package doesn't ship mfil

Re: [avr-gcc-list] New GCC warning - how to silence?

2007-04-06 Thread Lars Noschinski
* larry barello <[EMAIL PROTECTED]> [07-04-06 09:01]: Ok, this is the most interesting answer and begs another question: Are you just saying use either signed or unsigned (I typically use uint8_t except when the signedness counts) or is "char" a distinct type that has defined behavior across port

Re: [avr-gcc-list] float type

2007-04-03 Thread Lars Noschinski
* andi <[EMAIL PROTECTED]> [07-04-03 08:51]: I want to use float type in my code, but after i compile it, the avr-gcc not the generate code for the variable: float x = 1.23; x = x*2; sei(); Do you use this variable later on? If not, gcc might just optimize it away. ___

Re: [avr-gcc-list] ATmega8515 Interrupt Timing

2006-07-29 Thread Lars Noschinski
* User Tomdean <[EMAIL PROTECTED]> [2006-07-29 08:51]: Sorry, this is long. I am trying to match interrupt timimg to ATmega8515 cycles. I am trying to understand the timing and sources of jitter. I have an ATmega8515L with an external 8.000Mhz clock. My test application has a loop of 4.751use

Re: [avr-gcc-list] newbie interrupts question

2006-05-07 Thread Lars Noschinski
* Eric Smith <[EMAIL PROTECTED]> [2006-05-08 07:58]: My question is this: how do I set up this interrupt vector table using C? Or, if I have to mix assembly with C to do it, that's fine -- but can you tell me (show me) explicitely how to do it? You just declare your interrupt handlers using fo

Re: [avr-gcc-list] Using PORTB with variables, PORTB = var

2006-04-21 Thread Lars Noschinski
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-04-22 08:09]: How can I use the PORTB constant with variables? eg: while (1) { var <<= 1; PORTB = var } This will work. But after seven iterations (if var is (u)int8_t), var will be 0. That is what I'm trying to acheive. I'd like to be able t

Re: [avr-gcc-list] Interrupt Service Routines

2006-04-04 Thread Lars Noschinski
* Dave Lamont <[EMAIL PROTECTED]> [2006-04-05 07:26]: Can somebody advise me how to write the replacement of SIGNAL(SIG_OVERFLOW0) ISR(TIMER0_OVF_vect), if the interrupt name in the datasheet is TIMER0_OVF. ___ AVR-GCC-list mailing list AVR-GCC-l

Re: [avr-gcc-list] Got strange compilation problem

2006-02-16 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2006-02-16 13:59]: The IMHO equivalent single-line expression would be length = (uint8_t)(unsigned)((p->inIdx) - (p->outIdx)) / FIFO_SIZE; Why the seperate cast to unsigned? even though GCC still generates somewhat different code for that. Maybe because

[avr-gcc-list] Warning: 'ir_step' appears to be a misspelled signal handler

2006-02-16 Thread Lars Noschinski
Hello! I upgraded to avr-gcc 4.0.2 and now I get the following warning: warning: `ir_step' appears to be a misspelled signal handler And the compiler is right about "appears" because I gave ir_step the attribute signal, so I can call it from the real interrupt handler: NAKED SIGNAL (SIG_INTERR

Re: [avr-gcc-list] Got strange compilation problem

2006-02-16 Thread Lars Noschinski
* David Bourgeois <[EMAIL PROTECTED]> [2006-02-16 11:17]: Replacing the 2 lines length = (p->inIdx) - (p->outIdx); length %= FIFO_SIZE; by length = (((p->inIdx) - (p->outIdx)) % FIFO_SIZE); completely broke my code. I'm using avr-gcc 3.4.5 (latest winavr release) under avrstudio, -

Re: [avr-gcc-list] interrupt optimization

2006-02-03 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2006-02-03 08:58]: Lars Noschinski <[EMAIL PROTECTED]> wrote: If the function call is the last thing you need to do, you can also replace the call by a jmp instruction (of course, you may not push something to the stack). You'd need to

Re: [avr-gcc-list] interrupt optimization

2006-02-02 Thread Lars Noschinski
* Paulo Marques <[EMAIL PROTECTED]> [2006-02-02 23:55]: Then, to call the function, just do in assembly: in __tmp_reg__, SREG push __tmp_reg__ call _not_inline_function_ The __tmp_reg__ (SREG) push is made to match the IRET instruction from the now "interrupt" function.

Re: [avr-gcc-list] ld: crts8515.o: No such file; with avr-gcc under Linux

2005-11-29 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2005-11-28 12:59]: Günter Dannoritzer <[EMAIL PROTECTED]> wrote: Not sure whether it was the additional switch --program-prefix that was not shown in the installation instructions ... That option is normally not needed. It defaults to ${prefix}/bin, for wh

Re: [avr-gcc-list] how to infer lsl instruction...

2005-11-16 Thread Lars Noschinski
* varsha <[EMAIL PROTECTED]> [2005-11-16 09:54]: __asm__ __volatile__ ( "lsl r11""\n\t" "rol r12""\n\t" "rol r13""\n\t" "rol r15" ); but compiler doesn't generate lsl instruction... it generates something like this.. 1514: bb 0cadd r11,

Re: [avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?

2005-11-04 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2005-11-04 13:46]: Vincent Trouilliez <[EMAIL PROTECTED]> wrote: I put it there http://www.007.org.uk/~vtrouilliez/temp/ it's the one called "object.list". Something else must be wrong. The backannotated disassembly listing is also supposed to work with st

[avr-gcc-list] useless use of temporary register?

2005-10-08 Thread Lars Noschinski
Hello! I've an register variable declared as follows: register uint8_t status asm("r16"); /* status register */ so I would expect gcc using this register directly if possible. But this is often not the case. Is there some optimizaton option or code trick to get always the latter result?:

[avr-gcc-list] Interrupt overhead again

2005-10-04 Thread Lars Noschinski
Hello! Currently (avr-gcc 3.4.3), the interrupt prologue/epilogue accounts to a total of 65 cycles, if any function call is made in the ISR. Can I do anything do reduce this prologue besides removing all function calls or forcing them to be inline? _

Re: [avr-gcc-list] calling function pointers via pointers ?

2005-09-28 Thread Lars Noschinski
* Vincent Trouilliez <[EMAIL PROTECTED]> [2005-09-28 14:16]: Another pointer problem again, oops... I need pointers to functions in my project. Using the great on-line resource http://www.eskimo.com/~scs/C-faq/q4.12.html which someone on here mentioned recently, I got the basics working. But my a

Re: [avr-gcc-list] Global variables and ISRs ???

2005-09-14 Thread Lars Noschinski
* Lars Noschinski <[EMAIL PROTECTED]> [2005-09-06 21:59]: You must declare the global variable as volatile (or as register), if you want to modify in an ISR. Speaking of this, if I have an variable which is initialized during startup and only accessed /in/ an ISR, am I on the safe si

Re: [avr-gcc-list] Global variables and ISRs ???

2005-09-07 Thread Lars Noschinski
* Vincent Trouilliez <[EMAIL PROTECTED]> [2005-09-07 11:32]: Oh, that's interesting... because as soon as I compile my small programs, I rush to check to have a look at the assembler output, to get the hang of things, and am often very confused by the way the compile does things, it's often very

Re: [avr-gcc-list] Global variables and ISRs ???

2005-09-06 Thread Lars Noschinski
* Vincent Trouilliez <[EMAIL PROTECTED]> [2005-09-06 21:37]: Problem : on my ATmega32, after several experiments (only just started using it, learning...), I am suffering a big problem. It seems that when I declare a variable as global, then modify it within an interrupt routine, the 'main' funct

Re: [avr-gcc-list] Debugging under Linux

2005-09-06 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2005-09-05 23:05]: [...] Note that of course, AVR Studio and VMLAB aren't your only versions. You could as well use GDB (plus one of its frontends as you prefer), either against AVaRICE and a JTAG ICE (JTAG ICE mkII support being currently beta), or against sim

[avr-gcc-list] Debugging under Linux

2005-09-05 Thread Lars Noschinski
Hello! I've some trouble debugging my avr applications (which use the avr-gcc toolchain) under Linux. I tried to run AVRStudio4 using wine, but failed at the install. VMLAB seems to run fine, but I cannot generate coff files. As WinAVR seems to be able to generate coff files, can the vanilla avr

Re: [avr-gcc-list] SIGNAL or INTERRUPT ?!

2005-09-04 Thread Lars Noschinski
* User Tomdean <[EMAIL PROTECTED]> [2005-09-04 09:09]: The difference is in the compiler and the code it supplies for the handler. Section 6.20.6, SIGNAL(...). Section 6.20.4, INTERRUPT(...). Lookup the respective __attribute__ in the gcc documents. In avr/signal.h, /** \def SIGNAL(signame)

Re: [avr-gcc-list] simple program

2005-08-25 Thread Lars Noschinski
* Timothy Smith <[EMAIL PROTECTED]> [2005-08-25 09:45]: titan# avr-gcc led.c In file included from led.c:2: /usr/local/lib/gcc/avr/3.4.4/../../../../avr/include/avr/io.h:252:6: warning: #warning "device type not defined" avr-gcc does not know for which device it should compile. You need to pas

Re: [avr-gcc-list] PROGMEM variable placement

2005-08-23 Thread Lars Noschinski
* Joerg Wunsch <[EMAIL PROTECTED]> [2005-08-23 21:11]: Lars Noschinski <[EMAIL PROTECTED]> wrote: I'm looking at some assembler code avr-gcc spit and I'm a bit puzzled. Actually, you're looking at the disassembler output it seems. Possibly. I chose that, becau

[avr-gcc-list] PROGMEM variable placement

2005-08-23 Thread Lars Noschinski
;. Why does the second table end up there? Lars Noschinski ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] Put text string after interrupt vectors

2005-08-17 Thread Lars Noschinski
* Erik Christiansen <[EMAIL PROTECTED]> [2005-08-16 14:02]: On Mon, Aug 15, 2005 at 12:32:04PM +0200, Lars Noschinski wrote: I'm rewriting an assembler program to C, which had a signature string at 0x20 in the flash memory. [...] Have you considered what is in the first 0x20 cod

[avr-gcc-list] Put text string after interrupt vectors

2005-08-15 Thread Lars Noschinski
Hello! I'm rewriting an assembler program to C, which had a signature string at 0x20 in the flash memory. I tried to reproduce this with const char signature[] __attribute__ ((section (".signature"))) = "signature"; and the linker option --section-start=.signature=0x0020, but this doesn't work,