#avr Logs

Apr 24 2017

#avr Calendar

12:07 AM daey_ is now known as daey
05:34 AM Emil: if I have: struct thing { arr[10]; int hue; }; struct other { struct thing some; int a }; struct other perkele; doesn't memcpy(perkele, 0, sizeof(other)); really not zero the array? :o
05:34 AM Emil: nvm I'm retarded
05:35 AM specing: THIS JUST IN: EMIL IS RETARDED!!!!!!!!!!!!!!!!11111111111111111111111111111111111111oneoneone
05:35 AM Emil: No actually I did use memset
05:35 AM specing: lol
05:35 AM Emil: And meant memset also
05:40 AM Emil: Wtf could be wrong with it
06:15 AM twnqx: you'd need &perkele
06:17 AM LiaoTao: Emil confirmed retarded!!!!!
06:28 AM mindw0rk: lol
06:40 AM specing: xD
07:19 AM Haohmaru: what's the situation with simulators? is there one which can simulate xmegas?
07:29 AM Emil: twnqx: was just lazy with how I wrote the example here
07:30 AM Emil: The issue was that even though I did zero initialise a struct, earlier when I saved its contents I did not and thus when I blasted the saved contents on top of the zero initialised, all the crap got copied, too
07:31 AM Emil: LiaoTao: everyone is a little bit retarded :)
07:31 AM Emil: Haohmaru: xmegas have jtag
07:32 AM Emil: Haohmaru: otherwise there aren't many and simulating accurately is without it taking ages is hard
07:32 AM Emil: IDA can decode avr asm, though
07:32 AM Emil: for example
07:32 AM Haohmaru: jtag.. that's that thing i disable from the fuses every time, right?
07:33 AM Emil: dunno but I do remember someone talking about it
07:33 AM Emil: Haohmaru: jtag allows you to debug in system
07:33 AM Emil: you can see all the variables, memory and instructions executed
07:33 AM Haohmaru: well that's not an option in my case
07:34 AM Emil: then it's a no, realy
07:34 AM Emil: you can look at simuavr
07:34 AM Haohmaru: simavr?
07:35 AM Emil: probably
07:35 AM Haohmaru: or simulavr?
07:35 AM Emil: just google avr simulator
07:35 AM Emil: A lot come up
07:36 AM Haohmaru: yeah, i saw
07:40 AM Haohmaru: so then.. is there an easy way to cycle-count a section of code or something?
07:40 AM Haohmaru: a timer?!
07:40 AM Haohmaru: or pin toggle, but that requires using a scope to watch it
07:42 AM STPatrik: Hi! Can anyone help me with lifting out a port definition from the driver code to just be passed as a pointer in the init routine. I'm trying to replace "[port] "I" (_SFR_IO_ADDR(PORTF)) in some inline asm code with [port] "m" (_SFR_MEM_ADDR(*_pin_port)). I've verified that my init works with a simple blink test using standard C code but i get trouble using the same port pointer in the mentioned
07:42 AM STPatrik: asm code.
07:44 AM STPatrik: second past asm line is wrong, sorry. The one im trying is [port] "I" (_SFR_IO_ADDR(*_pin_port))
07:48 AM STPatrik: "impossible constraint in 'asm'" is the error i get, and I've tried with other constraints from the inline_asm manual
08:17 AM twnqx: try to pass it through gcc -E to what that code generates
08:18 AM Emil: Haohmaru: look at the asm
08:18 AM Haohmaru: Emil i did.. but it's very confusing
08:19 AM Haohmaru: probably because i don't know sh*t about asm
08:19 AM Emil: What are you trying to optimise?
08:19 AM Haohmaru: 32bit calender conversion functions x_x
08:19 AM Haohmaru: * calendar
08:20 AM Emil: lol
08:20 AM Emil: I ain't touching that
08:20 AM Emil: And also gcc probably generates better asm than you can
08:21 AM Haohmaru: but i have the feeling that the "C++ code" which i see interleaved in the .lss is getting entagled somehow
08:21 AM Emil: There's your problem
08:21 AM Emil: don't use C++
08:21 AM Haohmaru: i mean, i recognize some function, then i try to follow it, and suddenly it stops or i don't know wtf's going on o_O
08:22 AM Haohmaru: could that be because i use something like -O2 and -g at the same time?
08:33 AM Haohmaru: and then there's the funny-named functions.. umulhisi mulisi uhmuhlisBLAAARG!
08:37 AM skz81: <Haohmaru> could that be because i use something like -O2 and -g at the same time? >> Yup with -02 there no warranty your code is executed "inline" so following the PC can lead to "crazy jumps" in your source
08:37 AM skz81: use -O0 to remove that
08:38 AM Haohmaru: i am getting the .lss file via avr-objdump, if that matters
08:38 AM Haohmaru: imma try -O0
08:41 AM skz81: Haohmaru, hey, I meant your *source code* make look interleaved *at runtime* when you ry to following it running using GCC for instance
08:41 AM Haohmaru: nonono
08:42 AM Haohmaru: i put "-g" and i see chunks of the C++ source code into the .lss together with the ASM
08:42 AM skz81: when you try to follow it running* sorry. But i don't talk about disassembling your hex
08:42 AM Haohmaru: but i have the feeling that it's scrambled or my eyes are broken..
08:43 AM * twnqx ROT13 scrambles Haohmaru's code
08:43 AM skz81: Haohmaru, try to post a copy, I can't figure out what you're telling about exactly...
09:11 AM Haohmaru: with -O0 i think things are more readible, but the firmware is almost twice bigger than with -O2
09:12 AM Haohmaru: now, what i think happens with -O2 is that in the middle of a big function, i use a small function which probably got inlined
09:13 AM skz81: that's likely, yup ! And yes sadly -O0 increase generated size...
09:14 AM Haohmaru: and instead of seeing it as a "call" i see its guts, suddenly in the middle of the bigger function, and the C++ code (for reference) begins with the definition, so it seems as if the big function suddenly ended
09:15 AM Haohmaru: i also don't see (or can't easily recognize) the "end" of the smal function, but i see at some point later the remaining code from the big function
09:32 AM skz81: Haohmaru, unsure what to answer... :/ probably inline function gets highly 'recombined'...
09:33 AM Haohmaru: yeah, i'm looking for a way to use the -S option to gcc instead of using avr-objdump
09:44 AM skz81: <Haohmaru> yeah, i'm looking for a way to use the -S option to gcc instead of using avr-objdump >> just put it along with -c
09:44 AM skz81: (and possibly change the output file name !)
09:45 AM skz81: I guess you mean you're looking for a place to insert it in your project build file, or smth
09:45 AM Haohmaru: gotta figure out how to do that sort of exotic thing from the IDE
09:45 AM skz81: haha ok :)
09:45 AM Haohmaru: normally the IDE builds each file into an object, and then links them together
09:45 AM Haohmaru: afaik
09:46 AM Haohmaru: so adding -S in there did not lead to anything nice
09:46 AM Haohmaru: the linker vomited in my face
09:49 AM Haohmaru: for each file, it does something like this:
09:49 AM skz81: yup because your *.o files are now ASM source, or they should at least !
09:50 AM skz81: Haohmaru, ^
09:50 AM skz81: try to open one, you'll qucikly see
09:50 AM Haohmaru: avr-g++ <many options here> -c <file.cpp> -o <file.o>
09:51 AM Haohmaru: are multiple -o params legal?
09:51 AM Haohmaru: avr-g++ <many options here> -S -o <file.asm> -c <file.cpp> -o <file.o>
09:51 AM Haohmaru: would something like that work?
09:51 AM skz81: probably, but will output in file.o
09:52 AM skz81: because the last one wins by default
09:52 AM Haohmaru: crap..
09:52 AM skz81: note : -o ONLY overrides the output filename
09:52 AM skz81: NO MATTER what it contains
09:52 AM skz81: you're windows-biased, under UNIX extension are only *helpers*
09:53 AM skz81: I mean, it will output the ASM source into the .o
09:53 AM aczid: object code is not exactly asm source... but they map 1 to 1 :)
09:54 AM skz81: said differently, that's the -S that determine the output, not the output file extension
09:54 AM aczid: it's assembled assembly code :)
09:54 AM skz81: aczid, ok, but that dies help here
09:54 AM skz81: doesn't
09:54 AM aczid: no, you got it man
09:54 AM aczid: just trying to take away confusion
09:54 AM skz81: aczid, go back to sleep, please, and open man gcc
09:55 AM aczid: excuse me
09:55 AM skz81: aczid, no problem, but you were about to ruin all what i explained
09:57 AM aczid: I meant to say: "excuse me?" because that was kinda rude :P
09:58 AM aczid: but I'll just stfu
09:59 AM JanC_ is now known as JanC
10:02 AM skz81: aczid, I admit, sorry. I Just saw you talking about not-really-so-related stuff... And became rude, right
10:02 AM skz81: But, you're right about the 1 to 1 mapping fact. Not exactly, actually, because you may loose any symbol that is not externally referenced
10:03 AM skz81: Just like the comment..., You loose only "information", but sometime it is valuable.
10:04 AM aczid: for these explanations I can recommend http://www.bottomupcs.com/
10:04 AM aczid: chapter 7
10:12 AM Haohmaru: i see some example where "-c" is not actually passed, just the file.cpp and -S/-E/-save-temps
10:16 AM skz81: Haohmaru, -c and -S are two faces of the same option... So just like with -o filename... The last one specified one the command line "wins"
10:16 AM skz81: you often inject -S in an existing project build, so it's common to have both in a tweaked command
10:17 AM skz81: but only -S is just like -c -S
10:21 AM Haohmaru: okay, so -S and -c can be together, but there is only one output file that gcc generates per call, and that output files has only one format
10:21 AM Haohmaru: i'll bbl
10:27 AM skz81: if -S -c => you'll get an object
10:27 AM skz81: if -c -S => ASM
10:27 AM skz81: The last one specified one the command line "wins"
11:10 AM polprog: https://hastebin.com/ruwuraqeco.http
11:10 AM polprog: the thing that executes before main is interesting
11:12 AM polprog: 30: ldi r29, 0x01 ; then 32 out 0x3e, r29; The datasheet for the tiny4313 shows register 3e as reserved.
11:22 AM polprog: hmm, another dissasembler says it's high stack pointer bits. odd
11:41 AM Jartza: damde dam
11:41 AM Jartza: finally got some time to start digging into attiny817 more deep
11:41 AM Jartza: seems like amazing chip
11:42 AM polprog: what's so amazing about it?
11:44 AM LeoNerd: That new one?
11:44 AM LeoNerd: The one with the Microchip peripherals on it?
11:46 AM polprog: oh man. so many goodies!
11:53 AM Jartza: yes, that one
06:55 PM Emil: I mean
06:55 PM Emil: Damn
06:56 PM Emil: I can now stream websockets to my server in C
06:56 PM Emil: and soon from my server to a browser
06:56 PM Emil: also in C
06:56 PM Emil: and completely written by myself
06:57 PM Emil: Why is this awesome? Prototyping will become so much fucking easier if I can blast all my data to a browser :D
06:57 PM Emil: And visualising
06:57 PM Emil: hot damn
06:59 PM xentrac: yeah! congratulations!
06:59 PM xentrac: d3 is super great for visualizations
06:59 PM Emil: And I'll make it a god damn easy to use proxy that you can just shout at and it does what you ask it to :3
06:59 PM xentrac: what, like nginx?
06:59 PM xentrac: ;)
07:00 PM Emil: you work in web development or something, right?
07:00 PM Emil: so you know what ws has the fucking framing on top of it
07:00 PM Emil: s/what/that
07:01 PM Emil: Imho it is literally cancer
07:01 PM Emil: It also cannot recover from errors :D it has no fec
07:01 PM Emil: the spec says that on every fucking single error
07:02 PM Emil: endpon MUST FAIL THE WEBSOCKET CONNECTION
07:02 PM Emil: I mean seriously
07:02 PM Emil: who the fucking retard designed this protocol
07:03 PM Emil: Not only does it not have fec, it has no actual framing so any byteoffset or byte changes will break your shit
07:04 PM Emil: "B-b-but TCP provides reliable transport"
07:05 PM Emil: Have you actually fucking see the error rates possible with TCP
07:05 PM Emil: no real protocol should rely on it purely
07:05 PM Emil: Anycase :D
07:05 PM Emil: Good night : )
08:15 PM jadew` is now known as jadew
09:13 PM xentrac: Emil: usually when people use WebSockets they reconnect if the connection fails