#avr Logs

Oct 25 2017

#avr Calendar

12:06 AM polprog: Ameisen: interesting
12:09 AM day__ is now known as daey
01:21 AM JanC_ is now known as JanC
01:26 AM rue_bed: unsigned long cheating = 'HELP';
01:31 AM _ami_: constexpr is a pretty nice thing in new cpp.
03:02 AM Ameisen: rue_bed - you can implement Microsoft's FOURCC fully using constexpr
03:02 AM Ameisen: uint32_t fcc = fourcc("blah"); works (if you write fourcc)
03:02 AM Ameisen: _ami_ - constexpr is new in C++11, fixed in C++14, and then drastically expanded in C++17
03:03 AM Ameisen: you can do a LOT with it now
03:04 AM _ami_: Ameisen, cool. did not know the history behind it. thanks
03:06 AM Ameisen: the big changes lately were that constexpr functions are now more lax, and if constexpr exists
03:06 AM Ameisen: which only parses the contents of the if constexpr scope if the constant branch passes
04:54 AM Ameisen: for uint32_t + 1, GCC is outputing adiw r24, 1; adc r26, __zero_reg__; adc r27, __zero_reg__;
04:54 AM Ameisen: wouldn't adiw r24, 1; adiw r26, 0; be superior?
04:54 AM Ameisen: No use of the __zero_reg__ register, and 2 bytes smaller
04:56 AM aczid: does adiw use the carry flag though?
04:57 AM Ameisen: yes
04:57 AM Ameisen: wait
04:57 AM Ameisen: no
04:57 AM Ameisen: thought it did.
04:59 AM Ameisen: now I feel dumb
09:04 AM merethan_: On xmega, is the jmp instruction in bytes or words?
09:12 AM thardin: in asm or in binary?
09:13 AM thardin: I *think* the coded offsets are only in words. but things may be different at the asm level
09:13 AM thardin: since half-word jumps don't make much sense
09:16 AM enh: hi
09:21 AM noHitW_work: hi
09:23 AM merethan_: thardin, I want to jump to my bootloader from the appcode. x32e5 has 32k, putting the bootloader at 32768 or 0x8000 (bytes).
09:23 AM merethan_: Would that be asm("jmp 8000"); ?
09:23 AM thardin: 8000 is probably decimal
09:23 AM merethan_: How confusing
09:23 AM thardin: I just cause a WDT reset in my app
09:24 AM thardin: to avoid the stack possibly overflowing after enough jumps between bootloader and app
09:24 AM merethan_: I do RST.CTRL = RST_SWRST_bm; but I want the jump as a backup
09:24 AM thardin: or, definitely overflowing. because _start calls main
09:25 AM thardin: just try it and see what happens? :)
09:25 AM thardin: probably want to do jmp 0x8000
09:25 AM merethan_: mm
09:25 AM merethan_: ya let´s just try
09:25 AM thardin: but uh, I'd guess it's actually at 7F00 or so? depending on size
09:26 AM thardin: you could always pick the bigger of the two and see if the assembler complains
09:26 AM thardin: jmp 0x10000 should fail I think
09:27 AM merethan_: jmp 0x18000 no build errors
09:27 AM thardin: you may need -std=gnu99 too
09:27 AM thardin: throw another zero on it :)
09:27 AM merethan_: No complaints or errors
09:28 AM merethan_: 0x80000000 or so
09:28 AM thardin: interesting
09:28 AM thardin: you could always check the listing
09:28 AM merethan_: listing?
09:28 AM thardin: app.lst or whatever
09:28 AM thardin: what the actual assembly is
09:28 AM thardin: + ROM bytes
09:29 AM merethan_: First try it, then I´ll dive into that
09:31 AM thardin: sounds good
09:31 AM merethan_: Why would the bootloader start at 7F00?
09:32 AM merethan_: (My linker puts .text at 0x8000 (bytes) when it comes to my bootloader)
09:33 AM merethan_: (Also, in iox32e5.h: #define BOOT_SECTION_START (0x8000))
09:34 AM thardin: just guessing
09:35 AM thardin: 0x8000 sounds like it would imply using half of the ROM, which is kinda big
09:37 AM Emil: https://emil.fi/jako/tekstit/stackthread.txt
09:37 AM Emil: How
09:40 AM thardin: bootload in my a128 project is at 1F800
09:52 AM absynth is now known as dan2wik
10:06 AM merethan_: Still working on it ;)
10:07 AM merethan_: Device has some peripherals that need shut down before restart or reboot.
10:22 AM thardin: wonder of some stuff like that might be good to have in the bootloader. depending of course
10:23 AM merethan_: Mm I just use the wdt now
10:23 AM merethan_: Done it that way before
10:24 AM merethan_: Also, wdt inits al io´s to default on reset, turning off the peripherals because their enable lines go low.
10:24 AM merethan_: Does exactly what I want
01:01 PM aarcane: I was working on an ISR that kept causing crashes because I was using the wrong ISR Vector... Is the default ISR Vector to trigger a manual reset, or did it reset because of some pointer exception, etc. ?
01:02 PM _ami_: i think it would be just a segFault
01:02 PM _ami_: and a segfault shutdowns the program you are running.
01:02 PM aarcane: _ami_, that would count as a "pointer exception, etc."
01:03 PM aarcane: _ami_, thank you
01:03 PM _ami_: what is ptr exception? are you in cpp world?
01:04 PM aarcane: _ami_, I'm in a weird hybrid world where most of my code is C, but I have a few bits wrapped in "extern C" for to because C++.
01:04 PM aarcane: Wow I can't english today.
01:25 PM Gerritjan: join #ue4linux
01:42 PM NoHitWonder: unreal engine 4?
01:51 PM JanC_ is now known as JanC
01:58 PM Ameisen: Improved the AVR codegen of Clang last night a bit
01:58 PM Ameisen: there's a few edge cases I'm looking at
01:59 PM Ameisen: like adding/subbing an immediate with a masked out byte - say, 0xFF00
01:59 PM Ameisen: gcc properly handles that - it ignores the byte that's masked out when generating instructions. Clang happily will do something like adc
01:59 PM Ameisen: adc 0, rhat is
08:09 PM enh: hi
08:10 PM enh: Lambda_Aurigae?
08:16 PM enh: I must get back to this subject, so I 'll ask this question again. If I have two blocking interrupt vectors and they collide, what does the AVR do?
08:29 PM Tom_L: takes the highest priority one first
08:29 PM Tom_L: or at least it should
10:52 PM rue_shop3: ok I wired the keyboard
10:57 PM Tom_L: but does it work
11:11 PM Chillum is now known as HighInBC