#avr | Logs for 2014-07-20

Back
[10:02:33] <Bushman> hmm...
[10:02:45] <Thrashbarg> hmm
[10:03:15] <Bushman> i've added -u,vfprintf -lprintf_flt -lm -Wl to my linker flags but i still can't printf floats
[10:05:02] <Bushman> the linker does not spit any errors so i don't know for sure if everything is ok or not
[10:06:05] <Thrashbarg> what happens when it prints floats?
[10:06:38] <Bushman> i get '?' sign
[10:07:00] <Thrashbarg> what are you using as the terminal or display?
[10:07:23] <Bushman> minicom
[10:07:36] <Bushman> i mean uart uplink to pc
[10:07:38] <Thrashbarg> it could also be the toolchain wasn't compiled to support floating point in printf
[10:08:10] <Bushman> but it should spit out an error if it does not know how to handle it?
[10:08:33] <Lambda_Aurigae> don't you have to include something different? I remember doing that some years back.
[10:08:49] <Thrashbarg> I thought printf did a few things at runtime
[10:09:14] <Bushman> i'm not sure if i have to specify the libs that are in /usr/lib/avr/lib/ too or not
[10:09:35] <Bushman> http://stackoverflow.com/questions/22526319/floating-point-value-not-being-displayed-using-printf-function
[10:09:55] <Bushman> this topic has those libs mentioned but i don't know how to put them in my makefile if at all
[10:10:52] <Thrashbarg> PRINTF_LIB_FLOAT would be an environment variable, so gcc would consider it?
[10:12:20] <Bushman> i've checked the avrstudio's makefile and there's no mention of those libs
[10:12:28] <Bushman> just the flags
[10:12:36] <Bushman> but i've added those already
[10:12:43] <Thrashbarg> try adding "PRINTF_LIB = -Wl,-u,vfprintf -lprintf_flt" to the makefile?
[10:12:45] <Bushman> Thrashbarg: what do you mean by that?
[10:13:08] <Bushman> add enviroment variable in the terminal before invoking make?
[10:13:41] <Bushman> oh
[10:13:46] <Bushman> hmm...
[10:14:50] <Bushman> it's in the LDFLAGS in wondows too
[10:14:54] <Bushman> *windows
[10:15:14] <Thrashbarg> Bushman: I expect PRINTF_LIB is interpreted at some stage during the compilation so try it and see
[10:15:33] <Bushman> hmm..
[10:16:03] <Bushman> should i also remove those flags from LDFLAGS?
[10:16:18] <Thrashbarg> probably
[10:16:33] * Thrashbarg is better at AVR assembly than C, just FYI
[10:16:51] <Bushman> i see
[10:18:00] <Bushman> nope, same behaviour as when in LDFLAGS
[10:18:07] <Bushman> no error, still doesn't work
[10:19:00] <Thrashbarg> hmm what OS and compiler?
[10:19:49] <Bushman> linux and avr-gcc
[10:20:52] <Thrashbarg> yeah strange, I'm looking at some other things and it would 'appear' you're doing things right
[10:21:01] <Thrashbarg> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=93251&highlight=floating+point+printf
[10:21:02] <Thrashbarg> e.g.
[10:24:54] <Bushman> good to hear that i'm doing things right, to bad it does not solve my issue :(
[10:25:39] <Bushman> Thrashbarg: this post was a reference for me too:
[10:25:40] <Bushman> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=700155#700155
[10:26:10] <Bushman> the thing is i don't know if my toolchain is aware of those files (but i do have them)
[10:31:45] <Thrashbarg> yeah I'm out of ideas
[10:52:49] <Tom_itx> are the libs in your path?
[10:52:54] <Tom_itx> include them in your c header file
[11:41:18] <bss36504> N1njaneer: Hey! Long time no see
[11:42:42] <bss36504> Has anybody here played around with the SAM D20/D21 at all? How do you like them?
[12:31:53] <ambro718> Is there any way to declare a program memory array in C++ though a template class which does not explicitly specify the program memory? http://ideone.com/oe5hvb
[12:40:41] <bss36504> I’m not super familiar with C++, so the exact syntax I cant comment on. However, the whole concept of PROGMEM directives is that you *know* at compile time how much memory to allocate, and the whole concept of OOP in general is that you are dynamically allocating objects and their associated storage space.
[12:40:46] <bss36504> just my guess though
[12:41:15] <bss36504> So I would say that no, it cannot be done/
[12:41:19] <ambro718> I'm not doing any dynamic allocation, and dynamic allocation has zero relation to OOP
[12:41:43] <ambro718> I've found __flash but it only works in C mode :( https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html
[12:41:59] <ambro718> seems like if it worked it would allow putting things into flash more transparently
[12:42:36] <ambro718> but never mind I'll just deal with progmem explicitly then, might even come out nicer ;)
[12:58:05] <ambro718> it works :) My generic progmem array: https://github.com/ambrop72/aprinter/blob/configuration/aprinter/meta/StaticArray.h example usage https://github.com/ambrop72/aprinter/blob/configuration/tests/static_array_test.cpp
[15:45:16] <wondiws> does anyone here have an "USB ISP" programmer by any chance?
[16:03:27] <RikusW> there are many different usb isp programmers...
[16:15:26] <wondiws> oh so, it's not a "trademark" name or something
[16:16:17] <wondiws> I got a few AVR programmers, one of them a fake USB ISP thing... I never figured out how it worked so I gave it another go today
[16:19:11] <wondiws> http://embed.vn/13-mach-nap-avr-usb-isp.html
[16:19:14] <wondiws> this one, but in blue
[16:20:08] <wondiws> but no luck with the fischl driver
[16:20:08] <Tom_itx> i've got one
[16:21:03] <wondiws> the information on this page is in Vietnamese, the site with my one is in Chinese; I can't read either
[16:21:27] <Tom_itx> mine is in english
[16:21:33] <wondiws> ah, I'll give another try this time in windows
[16:22:06] <wondiws> which avrdude programmer do you have to select, Tom_itx ?
[16:22:28] <Tom_itx> i use avrisp2 on mine
[16:22:35] <wondiws> i'll try
[16:22:43] <Tom_itx> i doubt it will work on it
[16:22:51] <Tom_itx> it's not an avrisp mkii clone
[16:23:11] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[16:23:26] <wondiws> it is based on an avr chip probably?
[16:23:46] <Tom_itx> mine is a atmega32u2
[16:24:05] <wondiws> I tried connecting another programmer to it
[16:24:14] <wondiws> but not success so far
[16:24:35] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/usbtiny_programmer/testing_index.php
[16:24:40] <Tom_itx> you could try those commands
[16:25:14] <wondiws> I noticed that if I connect my "mySmartUSB" to only my Arduino it'll light up, both the 3.3 and 5V leds
[16:25:24] <Tom_itx> avrdude -c usbtiny -p m128
[16:25:36] <Tom_itx> change the -p to your chip
[16:25:46] <wondiws> when I connect it to my "USB ISP" thing only the 5V led shines
[16:26:05] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/how_to/atmega168/using_avrdude_index.php
[16:26:34] <Tom_itx> you need libusb loaded
[16:26:52] <wondiws> no problem; I use my debian system
[16:27:04] <wondiws> but I do know how to use avrdude by the way; I use it all the time
[16:27:05] <Tom_itx> root access?
[16:27:19] <Tom_itx> for the usb device...
[16:27:20] <wondiws> never needed it, but sure I can use root
[16:33:45] <wondiws> oh, my programmer is actually of the USB HID class type :S
[16:37:02] <wondiws> ok the case of my programmer can be slid off...
[16:38:57] <wondiws> 8L 8MU1041 or something
[16:48:28] <wondiws> ah nevermind, i'll look into it another time
[17:19:19] <Lambda_Aurigae> wondiws, probably one of the vUSB based knockoffs.
[17:20:39] <wondiws> now I'm busy with my Arduino Mega board, I can blink the led on the board, but not an external led :S
[17:20:46] <wondiws> then the led onboard just fades :S
[17:21:29] <wondiws> hmm... even if I don't even connect ground to the external led :S
[17:22:28] <wondiws> but that's not possible!
[18:59:46] <balrog-k1n> so, i have an inline asm snipped (using avr-gcc) and i have three inputs of type "e" and one of type "w", for some reason it can't find free registers to allocate for the "w" input
[19:00:01] <balrog-k1n> i'd expect it to use r24 & r25, any reason it may be avoiding them?
[19:00:38] <balrog-k1n> or any way to force it to select that pair?
[19:00:48] <Lambda_Aurigae> is avr-gcc using them for something?
[19:05:19] <Lambda_Aurigae> aaand, I think I see why.
[19:05:30] <Lambda_Aurigae> If the return value of a function is returned in registers, the same registers are used as if the value was the first parameter of a non-varargs function. For example, an 8-bit value is returned in R24 and an 32-bit value is returned R22...R25.
[19:05:43] <Lambda_Aurigae> they are reserved for returning values from functions.
[19:06:42] <Lambda_Aurigae> https://gcc.gnu.org/wiki/avr-gcc
[19:07:02] <Lambda_Aurigae> about half way down the page talks about calling and returning functions and what registers are used.
[19:07:36] * balrog-k1n clicks the link
[19:08:05] <Lambda_Aurigae> under the section Calling Convention
[19:09:03] <Lambda_Aurigae> interestingly, found with a google search for avr-gcc r24
[19:09:23] <balrog-k1n> Lambda_Aurigae: thanks, though I don't think it should be a problem, I mean it may try to avoid them if possible but should still use them if necessary IMHO
[19:09:39] <Lambda_Aurigae> I don't think so.
[19:09:47] <balrog-k1n> for example i can add "r24" and "r25" to the clobber list and it compiles
[19:09:56] <Lambda_Aurigae> those are used by C and not available.
[19:09:58] <balrog-k1n> and i'm also using r22 and r23 alreadt
[19:10:03] <Lambda_Aurigae> you might break something doing that.
[19:10:31] <Lambda_Aurigae> http://web.stanford.edu/class/ee281/projects/aut2002/yingzong-mouse/media/GCCAVRInlAsmCB.pdf
[19:10:43] <Lambda_Aurigae> nice little pdf for inline assembly on avr C
[19:11:15] <balrog-k1n> Lambda_Aurigae: i mean, i don't see why this should prevent the it from using r24 & r25 inside the functions,
[19:11:31] <balrog-k1n> they're only needed for a potential return value (which my funciton doesn't have),
[19:12:04] <balrog-k1n> it's like on x86 where eax is mainly used for all sorts of arithmetics even though it's also the return value and first parameter in the ABI
[19:12:13] <Lambda_Aurigae> they are also used for passing values into the function.
[19:13:32] <Lambda_Aurigae> dunno for certain, just what I'm reading here.
[19:13:52] <balrog-k1n> Lambda_Aurigae: ah that PDF is very useful, i relying a lot on this page http://www.nongnu.org/avr-libc/user-manual/inline_asm.html which seems to be the same document just in html
[19:14:21] <Lambda_Aurigae> yup..appears to be.
[19:18:04] <Lambda_Aurigae> mindless arnold schwartch-a-whatzits movies.....
[19:18:05] <bss36504> Darn, too bad the AP7000 is obsolte and/or not produced with no AVR32 alternative. Looks like a hell of a chip. Kind of like the FPSLIC
[19:18:16] <Lambda_Aurigae> yup.
[19:18:25] <Lambda_Aurigae> I have a couple of the FPSLIC chips here
[19:18:37] <bss36504> They seem very cool.
[19:18:46] <Lambda_Aurigae> never learned much of the FPGA side but did play with some premade stuff for them.
[19:19:00] <Lambda_Aurigae> they were but the software to program them was limited and pricy for full version.
[19:19:22] <bss36504> If I was still working at my previous job, they would have been a perfect fit for a project I was working on. At the time we opted to use an Xmega and a stand-alone FPGA
[19:19:36] <bss36504> But unforutnately, like many startups, that one too crashed and burned.
[19:19:47] <Lambda_Aurigae> yup..one I worked for did too.
[19:20:02] <bss36504> yeah, it was a good lesson to learn early in my career.
[19:20:18] <bss36504> They laid me off last day of classes
[19:20:22] <Lambda_Aurigae> it was a good hit for me...good experience and all.
[19:20:29] <Lambda_Aurigae> I was first employee and last.
[19:20:32] <bss36504> absolutely, cant take that away from me.
[19:20:36] <bss36504> wow, thats fun
[19:20:40] <Lambda_Aurigae> lasted for 5 years with one sale.
[19:21:22] <bss36504> we had 4 years under our belt and about an inch from a releaseable product, but essentially some petty fighting by the board members/shareholders fucked us all.
[19:21:36] <Lambda_Aurigae> we had a released product.
[19:21:58] <Lambda_Aurigae> but it scared our limited potential buyer base.
[19:22:23] <bss36504> may I ask what market? We were in memory.
[19:22:39] <Lambda_Aurigae> core telecom management software.
[19:22:53] <bss36504> ah.
[19:23:08] <Lambda_Aurigae> bleeding edge state of the art pseudo-AI kinda stuff.
[19:24:03] <Lambda_Aurigae> but it was written in JAVA.
[19:24:14] <Lambda_Aurigae> our one sale reverse engineered it.
[19:24:21] <bss36504> well now Im hoping for a job at a totally different size company-UTC aerospace. We will see how it goes. Had a promising interview last week so Im hoping to hear something. That sounds pretty cool. I appreciate cutting edge software a lot. I am merely a software technician when it comes to writing code. It takes a certain type of artistry to write software.
[19:24:27] <bss36504> Well thats really shitty.
[19:24:30] <bss36504> why would they do that?
[19:24:45] <bss36504> We were working on cutting edge phase change memory.
[19:24:51] <Lambda_Aurigae> so they didn't have to pay us two mil a year to support it.
[19:25:09] <bss36504> We were finally getting chips to pass with zero fails in a variety of circumstances, so very close to a product.
[19:25:24] <bss36504> Oh, well yeah thats pretty steep. I can see what motivated them
[19:26:04] <bss36504> Can anyone comment on the FreeRTOS port for Avr32?
[19:26:08] <Lambda_Aurigae> we were 1/4 the price of our competitors,,,,who dropped the ball 2 weeks before launch and told them they couldn't do it.
[19:26:25] <bss36504> I was annoyed at how dated the port for megas was. It used all old style compiler directives and whatnot.
[19:26:43] <Lambda_Aurigae> I don't use rtos...too complex for what I do with AVR.
[19:26:57] <bss36504> and yet somehow it didnt work out. Sometimes the world doesnt smile upon hard work.
[19:27:03] <bss36504> yeah, it was more a curiosity.
[19:27:24] <Lambda_Aurigae> I wrote my own time slice OS once for the AVR for the fun of it.
[19:27:25] <bss36504> Im thinking, well going to choose, an AVR32 chip for a project I want to do.
[19:27:41] <Lambda_Aurigae> honestly, I find arm much better than avr32 these days.
[19:27:50] <Lambda_Aurigae> 8 years ago, avr32 rocked.
[19:27:55] <Lambda_Aurigae> today, arm blows it away.
[19:28:02] <bss36504> I was attracted to freeRTOS because of all of the crap that is built in. But more just for curiosity’s sake.
[19:28:10] <bss36504> ARM is pretty neat. I’ve played a bit.
[19:28:42] <bss36504> however, atmel’s portfolio of ARM stuff, excludiing the SAMD stuff is such a damn pain to put on a pcb. no internal flash, wtf.
[19:28:55] <Lambda_Aurigae> I have an avr32 board here,,,and half a dozen arm boards.
[19:29:13] <Lambda_Aurigae> atmel isn't the only arm maker out there.
[19:29:35] <bss36504> I was attracted to the “single-chip solution” of the UC3A4256, especially since it has a bunch of stuff in it that I want.
[19:29:51] <Lambda_Aurigae> if it does what you need, go for it.
[19:29:51] <bss36504> I would like to stick with atmel if I can, since i have the tools and it’s what Im familiar with.
[19:30:08] <bss36504> Id rather not need to re-learn all new conventions for another brand.
[19:30:08] <Lambda_Aurigae> not a lot of support out there for it,,not like 8bit avr and arm.
[19:30:17] <bss36504> yeah, I’d noticed that too :P
[19:30:27] <Lambda_Aurigae> and avr32 is NOT the same as avr
[19:30:34] <Lambda_Aurigae> it's a whole other world.
[19:30:36] <bss36504> idk, im not fully committed to anything. My ideas evolve at a rapid rate.
[19:30:41] <bss36504> And I did know that
[19:30:58] <bss36504> page 1 of the datasheet “AVR32 is not binary compatable with previous parts"
[19:31:15] <Lambda_Aurigae> the chip was made to be programmed in C and to run linux, (on the bigger ones)
[19:31:23] <Lambda_Aurigae> so, that's a plus.
[19:31:29] <bss36504> but I assume (since I have not looked) that the peripheral calls will be somewhat similar/familiar.
[19:31:40] <balrog-k1n> so i told avr-gcc to use just any register pair ("r") instead of "w", and then copy the value into r24 & r25 and this stuff compiles and works (which is wonderful by the way)
[19:31:43] <Lambda_Aurigae> not only not binary compatible, but not compatible pretty much at all.
[19:31:47] <bss36504> Im not planning on running linux, but I did want a screaming fast micro.
[19:32:11] <balrog-k1n> I looked at the assembly and it's indeed using r24 & 25 for the parameter of that function but it doesn't need it at that point,
[19:32:28] <Lambda_Aurigae> I like the pic32 chips for fast...I have a 50MHz 80MIPS 28pin dip pic32 here.
[19:32:55] <Lambda_Aurigae> pic32 is even farther removed from pic than avr32 is from avr.
[19:33:05] <bss36504> I just really hate microchip processors. They make me cringe. Everything feels so…old
[19:33:15] <bss36504> but then again, I played only with a 16F1825
[19:33:18] <bss36504> and I hated it.
[19:33:21] <Lambda_Aurigae> pic32 rocks for what it does...it's a MIPS core.
[19:33:42] <bss36504> but it IS old, so that makes sense I guess haha
[19:33:54] <bss36504> I’ll take a look at the PIC32s
[19:34:07] <bss36504> I just thought MPLAB was crap last time I used it haha
[19:34:28] <Lambda_Aurigae> oh, it is.
[19:35:01] <bss36504> Played a bit with Freescale and codewarrior, but I dont know enough about the portfolio to make an informed choice. Same goes for TI. Otherwise I’ve been mostly pleased with them.
[19:35:04] <Lambda_Aurigae> but, so is atmel's IDE.
[19:35:13] <Lambda_Aurigae> at least mplabx is multiplatform.
[19:35:41] <Lambda_Aurigae> I still prefer 8 bit AVR over all other microcontrollers I've used.
[19:35:51] <Lambda_Aurigae> but sometimes one must go to the darkside for certain things.
[19:35:55] <bss36504> I appreciate how atmel has lumped their parts essentially into 3 major groups, and the numbering makes sense (to me), but again, I’ve had a lot more exposure to atmel. I personally enjoy using Atmel Studio, but I think I’ve had pretty good luck.
[19:38:41] <Lambda_Aurigae> atmel studio won't run on linux so no go for me here.
[19:39:18] <bss36504> ah yeah, that can be an issue. I run a mac with an XP VM for atmel studio. Works ok for me.
[19:39:32] <Lambda_Aurigae> no winblows here for me.
[19:40:40] <Lambda_Aurigae> microsoft pissed me off enough years ago that I refuse to use their products other than as mandated by my job.
[19:41:13] <bss36504> yeah, I can understand that. For me it’s just a minor inconvenience to boot up the VM. But otherwise I dont mind.
[19:42:03] <Lambda_Aurigae> I was told by microsoft that they wouldn't hire me because I didn't have a degree...even though I passed all their tests and psych profile and crap...
[19:42:24] <bss36504> what a bunch of dicks
[19:42:42] <Lambda_Aurigae> the manager wanted to hire me on the spot...HR dweeb said I couldn't do the job because I didn't have the requisite degree.
[19:43:08] <bss36504> well then that’s just shitty corporate structure. I see why you would be pissed.
[19:43:29] <Lambda_Aurigae> from then on I refused to buy their products.
[19:43:31] <myself> Just tell the manager "If you ever leave for a startup, you know how to reach me." and the HR droid "When my startup needs HR people, I'll know where not to look."
[19:44:36] <Lambda_Aurigae> I became a rabid linux supporter after that.
[19:44:47] <bss36504> holy crap, the USB endpoints are so big in this UC3.
[19:45:05] <bss36504> its 64 bytes in the megas, 512 here.
[19:52:30] <bss36504> Alright, Im off for a bit. Been a pleasure, gents