#avr Logs

May 07 2018

#avr Calendar

03:22 AM antto: abcminiuser \o/
03:25 AM abcminiuser: Ahoy
03:28 AM abcminiuser: Not so much these days, I don't seem to do much coding at home over the last few years (job takes up all my time)
03:29 AM abcminiuser: I've been tinkering on and off with various small projects, but hopefully when I move into my new house later this month I can set up a proper lab and get cracking again
03:29 AM abcminiuser: Being in a rental has cramped my style somewhat
03:29 AM antto: heh, i'm the same with this job :~(
03:30 AM abcminiuser: When you're knee-deep in code 8 hours a day, kinda takes the shine off doing it at home a bit...
03:31 AM abcminiuser: At Atmel I was alone in Norway so I did it at home since it was fun
03:31 AM abcminiuser: Then I moved back into a soul crushing start-up that took all my time, energy and enthusiasm for life
03:31 AM abcminiuser: Now I'm in a decent, if still energy-sapping good job
03:32 AM Emil: abcminiuser: ooh
03:32 AM Emil: are we in the presence of an AVR demigod?
03:32 AM antto: he is mr Dean :twisted: himself
03:32 AM abcminiuser: Most gods are dead, according to mythology...
03:33 AM antto: so, any clues why the avrisp2clone doesn't work with newer avrdude?
03:34 AM antto: more like.. any clues if it'll be fixed (i found there's a bug report on avrdude with a proposed fix)
03:35 AM abcminiuser: Ah yeah, run it in AVRDude compat mode (or reflash the firmware, I removed the old Jungo endpoint layout)
03:35 AM antto: i'm stuck with using avrdude 5.x
03:35 AM antto: compat mode?!
03:35 AM abcminiuser: The slightly longer version is that I cloned the original AVRISP-MKII as close as I could, with the data IN and OUT endpoints (data channels) on address 0x81 and 0x01
03:35 AM antto: (specifically i'm interested in PDI, coz xmega)
03:36 AM abcminiuser: Unfortunately, the USB AVR devices don't support having multiple endpoints on the same address (0x81 is the same as 0x01, but in the IN direction)
03:36 AM abcminiuser: So I had to do some tricks at runtime to keep reconfiguring the same endpoint into the direction of data I was expecting, like a half-duplex USART
03:37 AM abcminiuser: That works and makes the old Jungo driver Atmel Studio uses happy, since it had a well-defined communication sequence
03:37 AM antto: does it matter what chip the programmer is made with? cuz the one i have is from olimex and uses some at90
03:37 AM abcminiuser: However the libUSB driver that AVRDUDE uses would send some reset commands to the endpoint direction that wasn't configured, and then would bail out when the device said the endpoint didn't exist
03:38 AM abcminiuser: To fix that I added an alternative endpoint config that was more standard that made avrdude/libUSB happy, but broke the Jungo driver and Atmel Studio
03:38 AM antto: #define care_for_atmel_studio 0
03:38 AM abcminiuser: However in the last year or so Atmel Studio added support for libUSB with their own signed driver that works for both and removes the endpoint workaround
03:38 AM antto: hm
03:38 AM abcminiuser: Doesn't matter, you just need to compile it with the right settings (device, speed and pinout)
03:39 AM antto: i think the firmware comes from olimex wiki or some such place
03:39 AM antto: but if there's a way to make it work with avrdude 6 with just some command-line argument - that'd be great
03:41 AM abcminiuser: Get me a schematic and I'll tell you the compilation settings
03:41 AM * abcminiuser dinner, back in 30
03:41 AM polprog: bon apetit
03:41 AM polprog: my scanner is dead
03:41 AM polprog: damnit
03:41 AM polprog: the light source barely lits
03:42 AM polprog: and all scans are coming out dark
03:42 AM polprog: its my last free day today, school tomorrow
03:42 AM polprog: do i want to tear it apart and see what shat the bed?
03:42 AM Emil: scanner?
03:43 AM polprog: yeah. in a printer
03:46 AM antto: abcminiuser hopefully it's this one: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/AVR-ISP-MK2_sch.pdf
03:48 AM antto: polprog r u the new Lambda? ;P~
03:49 AM polprog: antto: i didnt choose printer slayer life, it chose me
03:49 AM polprog: i wish he was here,
03:49 AM polprog: im sure he would know whats wrong right away :(
03:49 AM antto: yeah
03:50 AM antto: you know what? open it, leave a message inside, close it, then throw it away
03:51 AM antto: sooner or later it's gonna end up in Lambda's hands, and when he opens it - boom: "hai, it iz me, polprog! come back to #avr plz"
03:51 AM antto: huehue
03:51 AM Emil: :D
04:04 AM polprog: lol
04:05 AM polprog: time to clean the windows and do some vacuuming
04:05 AM Emil: polprog: highlite me
04:06 AM polprog: sure thing Emil
04:07 AM Emil: mint
04:07 AM polprog: regex magic ;)
04:12 AM antto: polprog format C:\
04:12 AM antto: windows cleaned!
04:12 AM polprog: lol
05:08 AM polprog: cleaning windows is easier with hiren's
05:15 AM polprog: windows cleaned
06:04 AM nohitzwork: https://www.beningo.com/7-reasons-to-avoid-open-source-software/
06:04 AM * nohitzwork gets popcorn
06:06 AM polprog: http://i0.kym-cdn.com/photos/images/newsfeed/000/874/857/c1f.jpeg
06:07 AM polprog: this reminds me
06:07 AM polprog: to find some quotes with torvalds abusing contributiors
07:15 AM nohitzwork: https://betterembsw.blogspot.fi/2015/12/multi-rate-main-loop-tasking.html
07:20 AM antto: that's more or less what i'm doing on the xmega at teh job
07:20 AM antto: didn't know it has a name ;P~
07:22 AM Thrashbarg_ is now known as Thrashbarg
07:47 AM polprog: yay. got SFTP working under totalcommander via putty
08:00 AM antto: i just use SFTP from the lxde file manager
08:01 AM antto: PCManFM
08:06 AM polprog: thats a name i dont hear often
08:15 AM ruel is now known as lvlinux
08:15 AM _nexxus__ is now known as _nexxus_
08:54 AM rue_mohr: polprog, flourescent or led light ?
08:54 AM rue_mohr: I blame a cap in a power supply
08:54 AM polprog: rue_mohr: id like to know
08:54 AM polprog: looks.. led i think? or rgb fluorescent
08:55 AM rue_mohr: if it changes colour, its led
08:55 AM polprog: i bet its led
08:55 AM polprog: yeah, i remember i could see tiny dots
08:55 AM polprog: ill check the power supply
08:56 AM polprog: ill read till page 20 of this book and start taking that sucker apart
08:57 AM rue_mohr: http://www.frankshospitalworkshop.com/electronics/training_course/images_capacitors/capacitors22.jpg
08:57 AM rue_mohr: ((( )))
08:58 AM thardin: thicc
09:00 AM rue_mohr: https://product.tdk.com/en/capacitor/mlcc/technote/solution/mlcc02/img/mlcc02_002.gif
09:00 AM rue_mohr: hmmm
09:02 AM thardin: soft termination
09:02 AM polprog: we will see
09:02 AM rue_mohr: https://product.tdk.com/en/capacitor/mlcc/technote/solution/lead-mlcc/img/lead-mlcc01_05.jpg
09:02 AM rue_mohr: whaaaaaaat?!?!?!
09:04 AM polprog: 20dbSPL?
09:04 AM polprog: yyyyy
09:04 AM polprog: thats, like,
09:04 AM polprog: audible :D
09:06 AM Emil: nohitzwork: >using modulo
09:06 AM Emil: it's like they want to kill perf
09:06 AM Emil: :D
09:06 AM Emil: also
09:06 AM Emil: nice bugs
09:07 AM Emil: since your timer interrupt can increase the value at any point
09:07 AM Emil: so much for actually executing your tasks
09:08 AM polprog: jesus modulo
09:08 AM Emil: well actually naw it's in isr
09:08 AM Emil: so fine
09:08 AM polprog: nope.jpg
09:08 AM polprog: just use bitwise ops
09:08 AM Emil: hmm what's the overhead in having an ISR fire every ms
09:09 AM Emil: pretty neglible
09:09 AM polprog: just 4 modulos, nothing to see here
09:09 AM polprog: okay. every millisec, thats, not often
09:09 AM polprog: still. UGLY
09:10 AM Emil: :D
09:10 AM nohitzwork: the article is describing a concept. but you would know it if you'd read it.
09:10 AM polprog: also, the comment under it is pretty valid
09:10 AM nohitzwork: Division is slow, and in many low-end microcontrollers should be avoided in an ISR. So it is common to see a set of counters (one per flag), where each counter is set to the period of a particular task and counts down toward zero once per msec. When a counter reaches zero the associated flag is set to 1 and the counter is reset to the tasks' period. This takes a little more RAM, but avoids division. How it's implemented depends upon your
09:10 AM polprog: after all, you cant do all tasks at once
09:12 AM Emil: phase shifting is important as fuck
09:12 AM Emil: it's low effort complexity spreading
09:12 AM Emil: and provides excellent results
09:12 AM polprog: another thing. if your task function takes too long you get it all messed up, skipping other tasks
09:13 AM Emil: Yeah
09:14 AM polprog: a bit more complicated one could be implementing a function that saves/restores the stack or something and jumps around locations in code
09:14 AM polprog: but thats writing your own OS
09:14 AM Emil: but
09:14 AM Emil: that code just sets the flags
09:14 AM Emil: so they are guaranteed to be executed
09:14 AM Emil: unless the cpu is starved
09:14 AM polprog: ;_;
09:14 AM polprog: starved
09:14 AM Emil: the flags are cleared when executing
09:14 AM polprog: yeah i know
09:14 AM polprog: think about what happens if a task takes more than 1 ms, for some reason
09:15 AM polprog: thats a problem in itself i know
09:15 AM polprog: youve got elses there
09:15 AM Emil: eh?
09:15 AM Emil: no issue
09:16 AM polprog: hmm
09:16 AM polprog: brainfart
09:16 AM polprog: true
09:16 AM Emil: Imho it shouldn't only execute a single entry though
09:16 AM Emil: it should execute all relevant
09:16 AM polprog: yeah he mentions that
09:16 AM polprog: its not a trivial topic frankly
09:39 AM Emil: polprog: https://emil.fi/d/ioccc/2018.tar.bz2
09:39 AM Emil: http://www.ioccc.org/years.html#2018
09:39 AM Emil: you can also get it here but it's under heavy load right now
10:50 AM Ameisen: still trying to figure out how the hell to get GCC to build the LTO plugin as a shared object when building GCC with -static
10:50 AM Ameisen: a static library for the LTO plugin is rather unuseful
10:53 AM MrFahrenheit_: nuxil, did you print a benchy?
10:54 AM Ameisen: most of the 3d printing places have refused ot diagnose benchy problems
10:54 AM Ameisen: since they're not a very good indicator
10:55 AM MrFahrenheit_: I was gonna ask if he also printed the "make benchy float" accessories
10:56 AM MrFahrenheit_: super cute
10:58 AM antto: Ameisen can you build GCC without the lto plugin?
10:58 AM antto: -DNO_LTO_PLUGIN_PLS_KTHANKS_BYE
11:00 AM Ameisen: I want the LTO plugn.
11:00 AM Ameisen: I can't do anything with a static version though
11:00 AM antto: can you build it sepparately?
11:01 AM antto: ..from gcc
11:01 AM Ameisen: I don't see a make target for it
11:02 AM antto: so you have reached the unfamiliar grounds
11:02 AM antto: the land no man has walked yet
11:02 AM Ameisen: well, I am curious why the scripts think this is a godo idea.
11:02 AM Ameisen: iif gcc-ar et al statically linked the plugin, sure
11:02 AM Ameisen: but they don't
11:02 AM Ameisen: they look for an so/dll
11:04 AM polprog: Emil: obfuscated C contest?
11:04 AM polprog: i just put together a working computer from the remenant of a laptop with a broken chassis
11:04 AM polprog: i5 if i remember correctly
11:04 AM polprog: i just need to find a way to mount the display panel
11:04 AM polprog: the mobo is mounted on what used to house the keyboard, top cover.
11:05 AM polprog: bottom part of the shell is totally trashed
11:05 AM antto: do it like we do it at the job
11:05 AM antto: hotsnot gun
11:05 AM polprog: nah
11:05 AM antto: HOT SNOT IT!
11:05 AM polprog: what i wanna do now is to mount the panel over the mobo, in a tablet like fashion. this could become a thin client or a toy computer
11:05 AM polprog: :D
11:06 AM polprog: downloading void linsux
11:10 AM nuxil: MrFahrenheit_, no i have not printed that boat.
11:11 AM Ameisen: Otherwise, I'm still trying to figure out my LD crash
11:11 AM Ameisen: might be fixed by this, might not
11:11 AM Ameisen: I will probably modify the buildscripts to also build a bootstrap compiler
11:11 AM Ameisen: so it isn't dependent on the system GCC
11:39 AM polprog: https://puu.sh/AhOv5/fb6755985a.jpg
11:52 AM gruetzko- is now known as gruetzkopf
12:08 PM MrFahrenheit_: what have you done
12:36 PM antto: ugh, glossy screen
01:35 PM nuxil: i have 2 chips i dont want to run on the internal Rc. so if i hook up a crystal to one of them and enable the clkout fuse and let it drive the other chip, will this affect the clock on the "driver" chip in anyway? as in induce more jitter/drift etc etc ?
01:36 PM antto: isn't clockout on a sepparate pin?
01:36 PM nuxil: yea.
01:36 PM antto: you're worried that one of the slaves might mess with the crystal on the master?
01:36 PM nuxil: i guess im asking if enabling it will affect the f_cpu in anyway
01:37 PM antto: the F_CPU in the code?
01:38 PM nuxil: no i mean. as in cause it to change its performance. indroducing more drift/jitter etc.
01:39 PM antto: if CLKOUT is a dedicated, digital output pin, then what could possibly happen?
01:39 PM antto: it
01:39 PM nuxil: noise
01:39 PM antto: it'd be more or less like setting up SPI master, and driving a bunch of SPI slaves
01:40 PM antto: well, noise.. you could isolate it, i guess
01:41 PM nuxil: i guess.
03:32 PM Ameisen: I really want ld.gold to support AVR.
03:33 PM antto: wut's that?
03:33 PM Ameisen: another linker.
03:33 PM Ameisen: binutils has two linkers - bfd and gold
03:33 PM Ameisen: gold is newer and faster, but more limited
03:34 PM antto: faster?
03:34 PM Ameisen: IE - gold can only put out elfs (though AVR ld.bfd puts out ELF and we then collapse/expand it into a flat binary)
03:34 PM Ameisen: gold is a fully multithreaded linker
03:34 PM antto: avr programs can't be uber big, compile time is not an issue for me so far
03:34 PM Ameisen: it links way faster than bfd
03:34 PM Ameisen: well
03:34 PM Ameisen: compiling and linking aren't the same thing.
03:34 PM antto: right..
03:34 PM Ameisen: I prefer gold overall as I find that gold tends to put out better binaries anyways
03:35 PM Ameisen: there's just no AVR arch file in gold
03:35 PM Ameisen: and it wouldn't be a small task
03:35 PM Ameisen: lld also doesn't support AVR
03:35 PM Ameisen: there's a fork for it, but I think it's dead
03:35 PM Ameisen: the problem with bfd is it's... not well written
03:35 PM Ameisen: it's been maintained for a very long time for compatibility reasons
03:36 PM Ameisen: but nobody will say it's good
03:36 PM Ameisen: it's very stable, but slow, doesn't always do a good job, and requires plugins
03:36 PM Ameisen: gold is good though more limited, lld is good, not limited, but the linker script support isn't great
03:36 PM Ameisen: I ran into issues with a cortex-m4 linker script. Had to rewrite it a bit so the linker would be sane
03:37 PM Ameisen: seemed to be getting confused about some section offsets
03:48 PM andre_ is now known as Guest13443
03:57 PM Santh_ is now known as Santh
04:00 PM Guest13443 is now known as AndrevS
04:18 PM polprog: lol
04:18 PM polprog: can you imagine that laptop actually works
04:19 PM polprog: https://www.youtube.com/watch?v=jV2mH5UZnBc
04:21 PM thardin: what type of laptop is that?
04:22 PM polprog: MSI
04:22 PM polprog: but the bottom cover and the hinges were broken so i had to improvise
04:22 PM polprog: :D
04:22 PM thardin: nice
05:03 PM MrFahrenheit_ is now known as MrFahrenheit
11:23 PM day__ is now known as day