#avr | Logs for 2017-02-05

Back
[05:02:24] <enhering> gut mornin''
[06:44:41] <Jartza> ยง
[06:44:43] <Jartza> whoops
[09:43:52] <enhering> Hi.
[09:43:59] <enhering> Soo silent here.
[09:48:11] <Tom_L> nothing better on a Sunday morning
[09:48:32] <enhering> North or south US?
[09:48:44] <Tom_L> neither
[09:48:53] <enhering> Cold there?
[09:49:01] <Tom_L> chilly and foggy
[09:49:19] <Tom_L> central US
[09:49:30] <enhering> Here, around 28C, sunny. All year sunny. NE Brazil.
[09:49:48] <enhering> All year 28+-3
[09:50:13] <enhering> I miss cold and snow.
[09:51:57] <enhering> I wonder how life in Canada is like.
[10:02:27] <malinus> enhering: do you also miss pain and hunger?
[10:02:50] <enhering> Why would I?
[10:03:29] <malinus> idk. you miss cold and snow, so I'm wondering which other unpleasnt things you might miss.
[10:03:49] <enhering> It is nice to have four seasons. Here it is only summer.
[10:07:00] <Tom_L> who'd a thought you'd get tired of nice weather
[10:07:18] <Tom_L> maybe the maker knew what he was doing
[10:07:43] <enhering> Maybe
[10:07:56] <malinus> do you guys also get tired of good food?
[10:08:16] <malinus> what about peace?
[10:08:18] <Tom_L> if i didn't have a variety of it i would
[10:08:29] <Thrashbarg> malinus: are you referring to the craving of McDonalds when you're hung over?
[10:08:40] <Tom_L> that's not food
[10:08:51] <Thrashbarg> lol
[10:08:58] <enhering> there seems to be a relation between civilization level and weather temperature
[10:09:23] <enhering> equatorial contries are messy
[10:09:28] <enhering> countries
[10:09:39] <Thrashbarg> hmm
[10:09:51] <enhering> cold countries require organization
[10:10:08] <enhering> You gain on one side, loose on the other
[10:10:28] <enhering> It is easy to survive doing nothing in good weather
[10:10:42] <enhering> On cold countries you work or die
[10:10:55] <enhering> Think about that
[10:11:08] <Thrashbarg> in the other countries you work and die...
[10:11:33] <Thrashbarg> no safety
[10:11:58] <enhering> Think about your chance of being assalted, or robbed, in the streets being very high
[10:12:03] <enhering> no security
[10:12:17] <enhering> high criminality also.
[10:12:23] <enhering> I prefer cold.
[10:12:29] <Thrashbarg> what about Australia :P
[10:13:13] <Tom_L> Australia will kill you
[10:13:44] <Thrashbarg> though at the rate we're going we'll be classified as a developing country in 30 years or so. We'll have primary industries, agriculture, tourism, etc... no manufacturing, R&D, etc
[10:14:05] <enhering> Australia, Thrashbarg?
[10:14:12] <Thrashbarg> yeah
[10:14:14] <Tom_L> you have aluminum
[10:14:19] <Thrashbarg> and uranium
[10:14:20] <Tom_L> and desert homes
[10:14:26] <Tom_L> and nice beaches
[10:14:32] <Tom_L> and funny accents
[10:14:38] <Thrashbarg> so that covers primary industry and tourism
[10:14:45] <Thrashbarg> by definition that's a developing country
[10:15:12] <Tom_L> maybe one day england will take all you misfits back :D
[10:15:31] <Thrashbarg> the problem is the right want to sell everything off for a profit and the left just make things impossible to do with red tape
[10:19:16] <specing> not everything is right and left
[10:20:00] <specing> australia has great potential for solar (desert)
[10:21:02] <Thrashbarg> yup but with our government it'll be god damn impossible ._.
[10:21:43] <Thrashbarg> it was hard enough to have windfarms set up here
[10:38:16] <enhering> Lucy in the Skype with Diamonds...
[10:39:55] <Thrashbarg> The Tragical History Tour
[10:51:47] <specing> Thrashbarg: just wait till the oil runs out, simple
[11:16:16] <enhering> Or: www.blacklightpower.com
[13:51:05] <Emil> Yo
[13:51:10] <Emil> I was wondering
[13:51:30] <Emil> How does the timer overflow flag work?
[13:51:50] <specing> [REDACTED]
[13:51:57] <Emil> I'd like to detect timer overflow but not enter an ISR for it
[13:52:22] <Emil> instead I'd like to periodically check if it has overflowed or not
[13:52:53] <cehteh> iirc thats when you disable the timer overflow ISR's
[13:52:54] <Emil> So, if I don't have an ISR and have the timer running
[13:53:10] <cehteh> basically the overflow flag is just an additional bit on the counter
[13:53:20] <Emil> After the first overflow the overflow flag will just sta active until I write to it
[13:53:32] <cehteh> (which gets cleared on isr automatically)
[13:53:46] <cehteh> yes
[13:55:33] <Emil> Ah, it was specified in the datasheet
[14:02:30] <Tom_L> if you don't use the isr you may not catch it just when it happens
[14:04:24] <cehteh> i guess thats ok
[14:04:51] <cehteh> nice observation is that any counter in avr's is actually 1 bit more wide than advertized
[14:05:49] <cehteh> timer isr's dont have the highest priority, so you may never catch it at the exact moment it happens, you always need to account for that in your code anyway
[14:05:50] <specing> why
[14:06:59] <cehteh> and even id the isrs where not blocked and happened instantly there is a few cycles overhead
[14:07:07] <specing> its probably an s/r register with s on last carry and r on the write channel to that bit
[15:26:06] <enhering> Has anybody here used atmel ice and a command line tool for debugging?
[15:26:52] <Tom_L> not i
[15:27:10] <Tom_L> there may be one though
[15:27:42] <Tom_L> not sure how useful that would be without being able to watch the registers etc
[15:27:59] <enhering> http://www.avrfreaks.net/forum/atmel-ice-avarice-eclipse-and-debugging-ubuntu
[15:28:17] <Tom_L> i hate eclipse fwiw
[15:28:33] <enhering> me too. But the side info seems useful
[15:39:24] <tpw_rules> is it possible to source level debug an atmega328p?
[15:39:39] <enhering> seems so
[15:40:09] <tpw_rules> how
[15:40:21] <specing> $$
[15:40:25] <tpw_rules> to whom
[15:40:28] <enhering> it seems that atmel ice does that
[15:40:32] <specing> ^
[15:40:53] <enhering> with avarice and with atmel studio
[15:41:03] <tpw_rules> atmel ice sounds expensive already
[15:41:09] <enhering> The link I sent above tells how
[15:41:09] <specing> you can either pay $50 to atmel for that ICE or get a cheap $7 stm32 devkit that already includes OpenOCD supported in-circuit debug
[15:41:20] <specing> and just ditch AVR
[15:41:30] <specing> which you should do anyway
[15:41:39] <tpw_rules> yeah i've been scheming
[15:41:41] <tpw_rules> i refuse to use a PIC
[15:41:52] <tpw_rules> and the stm32s look nice. i already have a CMSIS-DAP probe from another experiment
[15:41:56] <specing> as stm32 cover a much much wider range of performance levels and features
[15:41:59] <tpw_rules> is there a nice irc for them
[15:42:09] <specing> and you can even program chips from other vendors with that JTAG
[15:42:23] <tpw_rules> my choice is low low power
[15:42:36] <specing> so get a low low low power cortex-L0?
[15:42:47] <tpw_rules> yeah probably
[15:42:57] <specing> generally the arm transistors are like 100 times smaller so that should help as well
[15:42:58] <tpw_rules> is there an stm32 channel that's as comprehensive as this one
[15:43:10] <specing> sure, guess what its caled
[15:43:15] <tpw_rules> stm32
[15:43:17] <tpw_rules> #
[15:43:17] <tpw_rules> #
[15:43:43] <tpw_rules> two octothrope
[15:43:48] <tpw_rules> octothorpes
[15:44:35] <enhering> octowhat?
[15:45:03] <specing> has
[15:45:05] <specing> hash
[15:45:28] <tpw_rules> :P
[15:45:46] <tpw_rules> speaking of isn't this supposed to be a two octothorp channel
[15:45:51] <specing> and make microchip pay for it
[16:04:44] <enhering> I'd like to share another curiosity here. If you have time, can you look at this short piece of code and tell me how would it produce nBegin = 255? http://pastebin.com/1cAN035R
[16:05:05] <specing> > pastebin.com
[16:05:45] <enhering> have a better pastebin suggestion, specing? I would gladly follow
[16:05:56] <specing> github gist
[16:06:03] <enhering> ok.
[16:06:05] <specing> paste.debian.net
[16:06:11] <specing> pastie
[16:06:17] <specing> there are literaly thousands
[16:06:21] <enhering> any preference?
[16:06:44] <specing> TLS and no ads is pretty much all that is needed
[16:07:44] <enhering> what is tls? Sorry for the ignorance
[16:07:49] <specing> for any site not to have TLS is inexcusable when you can get letsencrypt cert with A rating on ssllabs in under 20 minutes
[16:08:03] <enhering> ah
[16:08:06] <specing> ENHering: the successor of SSL, the protocol behind https
[16:08:11] <enhering> Ah, sorry.
[16:08:29] <enhering> I thought it was another past website
[16:08:31] <enhering> paste
[16:10:17] <enhering> https://gist.github.com/enhering/2f8577b77c063577c500e3eb72c07028
[16:10:28] <enhering> Thanks, specing
[16:11:03] <specing> nbegin=255 was probably initialization
[16:13:19] <enhering> Nope. Initialized as zero. All code is here. Line 168
[16:13:22] <enhering> https://gist.github.com/enhering/9f46b9f12506ea2227ee592446d92c25
[16:14:07] <enhering> Makes no sense
[16:16:31] <enhering> Any idea?
[16:16:43] <specing> use Ada maybe? :D
[16:16:59] <enhering> Any other idea?
[16:17:03] <enhering> :)
[16:18:20] <specing> nope
[16:18:43] <enhering> Thanks for taking the time to look
[16:20:49] <specing> tbh 255 sounds like some overflow somehow
[16:21:05] <specing> if you had Ada you could get an exception on it
[16:21:14] <specing> if your program with error even compiled
[16:22:11] <enhering> I'm googling for ADA. Trying to find a free tutorial
[16:25:04] <enhering> Ok. I can learn it. But why is it recommended for microcontrollers? Isn't it just another language?
[16:27:41] <specing> Ada, unlike C and C++, was actually designed
[16:27:56] <specing> and it was designed specifically for high reliability embedded
[16:28:10] <enhering> Like space applications?
[16:28:51] <specing> yes
[16:28:52] <enhering> It has a quite different syntax
[16:29:00] <specing> it is a Pascal derivative
[16:29:09] <enhering> Looks like Pascal, indeed
[16:29:43] <enhering> Interesting. Thanks for that. I'll learn more.
[16:32:56] <specing> you can also join #ada and nag them when you have problems (which will be ... soon)
[16:33:59] <enhering> Danke
[21:54:08] <enhering> I just installed MacSIM, a simulator for AVR on Mac. It seems to work well.
[21:56:04] <CORDIC> enhering: Can it simulate other cores?
[21:56:47] <enhering> ATMega328, ATtiny2313, ATtiny 84
[21:57:18] <CORDIC> I mean MIPS, ARM...
[22:46:39] <enhering> CORDIC: MacSIM simulates the AVR running my code, but al in assembler
[22:46:54] <enhering> Is there a way to map the symbols to the assembler code?
[22:47:19] <Tom_L> unassembler?
[22:47:43] <Tom_L> iirc the list file does that doesn't it?
[22:47:53] <enhering> unassembler reads symbols generated from gcc?
[22:48:11] <Tom_L> i dunno, i don't use it
[22:48:40] <inflex> hi Tom_L
[22:48:45] <Tom_L> hi
[22:49:11] <inflex> Been a while, still alive and kicking I see
[22:49:23] <Tom_L> yeah, just checking in before sleep
[22:49:58] <inflex> np, sleep well
[23:17:24] <Casper> enhering: C -> binary -> decompiler -> assembler -> no real C conversion
[23:17:40] <Casper> because GCC optimise and "destroy" the original function
[23:18:10] <enhering> I found this: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
[23:18:34] <enhering> It is kind of working with simulavr and avr-gdb
[23:19:10] <enhering> On one window: simulavr --gdbserver --port 4242 -- device atmega328
[23:19:36] <enhering> On the other window: avr-gdb, then target remote localhost:4242
[23:20:29] <enhering> I'm running this on a mac
[23:25:17] <Casper> simulator suck anyway
[23:25:35] <enhering> better than nothing
[23:26:33] <Casper> nothing is usually still better
[23:27:57] <sabor> having nothing is really bad, you should at least have a brain, that helps finding bugs pretty well :)
[23:31:02] <enhering> what do you usually do to find a buffer overflow, or kinda problem?
[23:31:15] <enhering> in an avr...
[23:32:00] <Casper> you get carefull, do the math, use some random tricks to test for that
[23:32:11] <Casper> even your simulator, you will have issues
[23:32:14] <enhering> I'll do that now, Casper.
[23:32:22] <enhering> Thanks.
[23:32:41] <Casper> the simulator can work if your code is simple
[23:32:58] <Casper> but will fail hard as soon as you have some external devices that is supposed to interface with your code
[23:33:13] <Casper> which is almost every single application
[23:41:22] <enhering> Thanks, Casper
[23:43:12] <Casper> btw, there is jtag and debugwire that also exists