Re: Version/Signature in Flash

2022-01-19 Thread Klaus Rudolph
Hi, -Wl,--undefined=signature This will keep it in flash and not let the linker strip its value. Also when preparing your .hex file for flashing you may need to explicitly tell the sections you want. avr-objcopy -j .text -j .data -j .my_signature -O ihex prog.elf prog.hex works perfect!

Re: Version/Signature in Flash

2022-01-19 Thread Klaus Rudolph
AFEBABE; The linker then needs an additional argument to know where this section is: -Wl,--section-start=. my_signature =0x7FFC Where 0x7FFC is the byte-offset in flash not the word-offset. 0x7FFC would mean the end of flash on an ATmega328P. Hope this helps. Michael Am 2022-01-18 um 11:21 s

Version/Signature in Flash

2022-01-18 Thread Klaus Rudolph
Hi, is there already a defined wy to place a user defined signature in the flash memory? Use Case: Simply put some version info, maybe a a string with given format or a git hash id or whatever in a specified flash area. I see we have a section ".signature" but this is in use for a predefined 3

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread Klaus Rudolph
Am 12.04.21 um 16:25 schrieb Anton Staaf: Klaus, I'm not sure if my previous answer didn't make it through or was just missed, but I believe your problem is related to this GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435 Yes,

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread Klaus Rudolph
Am 12.04.21 um 15:46 schrieb David Brown: Certainly templates can be instantiated zero, once, or multiple times. And certainly some templates are intended only to be instantiated a single time. But it would surely be difficult to have a feature that only works when there is a single

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread Klaus Rudolph
Am 12.04.21 um 13:53 schrieb Matthijs Kooijman: - figure out, where the special handling of the __vector_10 seems to happen, and why it is not happening in the class template case. This might help diagnose if and where to fix it within the compiler. That is compiler internals... yes, if it is

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread Klaus Rudolph
Hi, Am 12.04.21 um 11:20 schrieb Peter Sommerlad (C++): - why is the special name __vector_10 used to get the function address into the interrupt table? Is there another way, or is the environment insisting on such a name? Can you change the linker (i.e. with a dedicated map file) to get the

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread Klaus Rudolph
Thank you all so much for wasting my thread! Please do NOT answer, you all produced enough spam! Would be nice if someone can help on *MY* topic! Thanks!

static class member as interrupt handler works, but not if class is templated

2021-04-10 Thread Klaus Rudolph
Hi all, if I write a class with static member function I can use it as an interrupt handler as follows: class Dummy { static void Handler() __asm__("__vector_10") __attribute__((__signal__, __used__, __externally_visible__)); }; void Dummy::Handler() { } I can see the vector is entered

Re: Partial libstdc++ Support

2021-02-02 Thread Klaus Rudolph
Hi, Naturally, much of the C++ standard library isn't remotely suitable for AVRs, and should not be supported. However, there are a fair amount of features that I believe would work very nicely, and would be worthwhile to support. For example, std::array, std::optional, , and the C++

cross compile gcc 10.1.0 on linux for avr fails

2020-07-16 Thread Klaus Rudolph
I try to compile gcc 10.1.0 for target avr. If fails with: make[2]: Entering directory '/home/krud/git_my_checkout/first/own_components/gcc_install/gcc/gcc-10.1.0/build/gcc' g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall

Re: [avr-gcc-list] Internal handling of interrupt vectors and jump table

2015-08-12 Thread Klaus Rudolph
Hi Georg, thanks for your info! Disassembly of section .text: __vector_7: The .vectors section is implemented in AVR-LibC's gcrt1.S. ISR and similar macros are provided by interrupt.h. Yes, I found the tricky part of the job. .macro vector name .if (. - __vectors

[avr-gcc-list] Internal handling of interrupt vectors and jump table

2015-08-11 Thread Klaus Rudolph
Hi, can someone explain how interrupt vectors are handled in gcc internally? OK, I saw that in /opt/avr_5.2.0/lib/gcc/avr/5.2.0/../../../../avr/lib/avr5/crtatmega32.o the empty vector table is included, like: Disassembly of section .vectors: __vectors: 0: 0c 94 00 00 jmp 0

[avr-gcc-list] debug infos in assembler files

2013-11-18 Thread Klaus Rudolph
I want to have debug infos in my assembler output files. I tried with avr-gcc -Wa,-gstabs,-D -xassembler-with-cpp -mmcu=atmega32 -nostdlib $ -o eins But if I use: avr-gdb eins (gdb) list 1 /tmp/ccUMCsnQ.s: No such file or directory. And which args I have to use if I want a two step

[avr-gcc-list] problems with debugging, wrong output in assembler window from ddd

2013-06-25 Thread Klaus Rudolph
Hi all, I use ddd/avr-gdb to debug in connection with simulavr. Everythings seems to be ok, but I run into trouble if I try to debug in the assembler window: If I set $pc=0 the assembler window output is ok. 0x +0: rjmp.+24; 0x1a __trampolines_start 0x0002

[avr-gcc-list] build gcc-4.6-20101204 fails for avr

2010-12-08 Thread Klaus Rudolph
Hi, I actually try to compile the actual snapshot of gcc but run into errors: checking for sqrtl in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. I configured with: ../configure --target=avr --enable-languages=c,c++ --enable-lto --prefix=/opt/avr-4.6.snap

Re: RE: [avr-gcc-list] build gcc-4.6-20101204 fails for avr

2010-12-08 Thread Klaus Rudolph
Does it work if you *disable* LTO? AFAIK, LTO hasn't been tested out on the AVR. No, that doesn't matter. LTO works as expected in 4.5.1 as I could see. I did only a few very simple tests with LTO and actually not with production code. But I will do the tests until years end. I will check

Re: [avr-gcc-list] build gcc-4.6-20101204 fails for avr

2010-12-08 Thread Klaus Rudolph
Hi again, If the failure is well known, is there a specific open bug report for this already? Do you know which one? I am sorry, I couldn't. There are a lot of mails regarding this problem which could be found. But I could not remember which bug# I have red the last hours ;) Regards

Re: [avr-gcc-list] build gcc-4.6-20101204 fails for avr

2010-12-08 Thread Klaus Rudolph
Hi again, If the failure is well known, is there a specific open bug report for this already? Do you know which one? I am sorry, I couldn't. There are a lot of mails regarding this problem which could be found. But I could not remember which bug# I have red the last hours ;) Regards Klaus

[avr-gcc-list] RTTI on avr possible?

2008-06-11 Thread Klaus Rudolph
Hi all, is there a possibility to use RTTI on avr with avr-g++? Thanks Klaus ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] RTTI on avr possible?

2008-06-11 Thread Klaus Rudolph
Hi Eric, is there a possibility to use RTTI on avr with avr-g++? There are not many people using C++ on the AVR, and it is known that C++ support for the AVR may not be complete. There are also a number of known bugs regarding the C++ compiler for the AVR. So you might be better off just

[avr-gcc-list] gcc 4.3.0

2008-04-11 Thread Klaus Rudolph
I have installed gcc 4.3.0 and becomes a bit confused :-) main ends now with a ret and returns to undefined address from stack? Bug or feature? By the way: What I want to test with my code was the new feature of gdb to have multiple breakpoints from inlined functions which works well for

Re: Simulator for GCC Testing [was: RE: [Fwd: Re: [avr-gcc-list]GCC-AVR Register optimisations]]

2008-01-15 Thread Klaus Rudolph
Hi all, I also however know that libbfd is a pain for us the way we use it becuase over time it changes in ways we often don't care about, but cuases trouble for our simulavrxx users who have to cause it to be built and installed...then simulavrxx has to find and use it x-p There has nothing

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread Klaus Rudolph
I think we are discussing not the solution :-) The compiler optimizes unused code away, that is OK! If we use a volatile, the WRITE ACCESS could not longer be optimized and also a new READ ACCESS before subtraction must! be done. That is what the compiler do, that is also OK! If there is a

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread Klaus Rudolph
Please use optimizer! Something like -O2 -O3 -Os ... as you need! Simplify your delay loop: void delay(volatile word cnt) { ... Have fun! Royce Pereira schrieb: Hi, On Fri, 28 Sep 2007 14:47:26 +0530, David Brown [EMAIL PROTECTED] wrote: This is probably in the FAQ somewhere - if not, it

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread Klaus Rudolph
The code has been optimized. Well done! If you need the variable access use 'volatile' Hi all, In the latest WinAVR (avr-gcc (GCC) 4.1.2 (WinAVR 20070525) I found this. Check this out: //== void delay(unsigned del_cnt) { while(del_cnt--); return; }

Re: [avr-gcc-list] Opinions of AVR simulators

2007-08-09 Thread Klaus Rudolph
Hi David, try out the simulavrxx. It is especially designed for timing analysis. Special statistics for irq handlers are implemented and a lot more. Correctness of code can be checked if you write your tescases around the simulation, this could be done in a lot of languages like c,c++ or tcl

Re: [avr-gcc-list] Opinions of AVR simulators

2007-08-09 Thread Klaus Rudolph
? Knut -Original Message- From: [EMAIL PROTECTED] g [mailto:[EMAIL PROTECTED] ongnu.org] On Behalf Of Klaus Rudolph Sent: Thursday, August 09, 2007 8:24 AM To: David Carr; avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Opinions of AVR simulators Hi David, try out the simulavrxx

Re: [avr-gcc-list] Inserting code before context save in an ISR (for nested interrupts)

2007-08-06 Thread Klaus Rudolph
The compiler only save registers which are needed by the isr. Why you should do this by your own? Hi all, I'm working on a hard realtime application where I need to keep the time where interrupts are disabled as small as possible. I've noticed that a typical ISR can take 40+ cycles to push

RE: [avr-gcc-list] Regression tests

2005-11-16 Thread Klaus Rudolph
Hi Mark, Can you simulate devices attached other than an AVR in this simulator? For instance, I would like to simulate being attached to a SPI RTC, some flash memory, and a number of devices attached via pins. If I could somehow write code to simulate those, I would be the happiest person!

Re: [avr-gcc-list] Regression tests

2005-11-15 Thread Klaus Rudolph
Nov 2005 12:58:05 +0100, Klaus Rudolph [EMAIL PROTECTED] wrote: Hi David, I have a lot of regression tests running for my embedded code. I use my simulator (simulavrxx) which also give the ability to manipulate external pin states and interconnections between multiple avr devices

[avr-gcc-list] problems with olimex jtag emulator

2005-06-27 Thread Klaus Rudolph
I have bought an olimex jtag emulator more than a year ago. It worked fine a lot of sessions. And today I tried again to use it but it fails. No response from avarice. I tested older avarice versions like 1.5, 2.2 and actual 2.3, but nothing is working anymore. I did a hardware test with original

Re: AW: [avr-gcc-list] problems with olimex jtag emulator

2005-06-27 Thread Klaus Rudolph
and atmel box. Thanks Klaus Yours, Björn -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Klaus Rudolph Gesendet: Montag, 27. Juni 2005 07:49 An: avr-gcc-list@nongnu.org Betreff: [avr-gcc-list] problems with olimex jtag emulator I

Re: AW: AW: [avr-gcc-list] problems with olimex jtag emulator

2005-06-27 Thread Klaus Rudolph
Haase Bjoern (PT-BEU/EMT) * schrieb: Klaus Rudolph wrote: The box is not repsonding at all, so also a firmware update seems not working but yes I will setup a windows this week because I have no windows and after that I will remove it as fast as possible :-) ... So maybe the olimex

Re: [avr-gcc-list] stack layout

2005-06-25 Thread Klaus Rudolph
Hi Torsten, to get a complete overview on memory layout whithout touching the software itself you simply run your application in a simulator and monitor the stack and maybe the heap usage if needed. You can also manipulate the irq load and other environment things there for worst case

Re: [avr-gcc-list] stack layout

2005-06-25 Thread Klaus Rudolph
no hardware so simulation is the only solution for the problem :-) Regards, Klaus -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Rudolph Sent: Friday, June 24, 2005 11:07 PM To: Torsten Mohr Cc: avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list