#avr Logs

Jul 02 2019

#avr Calendar

12:19 AM Kliment: rue_mohr: Do you know a way to debug avr 1-series without using atmel studio or mplabx? I'm super tired of shit toolchains
12:24 AM Kliment: rue_mohr: And I'd very much love to just use some gdb frontend but I've not found any way to get openocd to talk to updi devices
01:02 AM rue_mohr: yup, dont write the bugs in the first place
01:02 AM rue_mohr: I use an io pin for debugging, otherwise
01:34 AM vmt: Kliment: the solution is to use real mcus
01:40 AM vmt: also Kliment, talking about quality of tools, most (read: all) gdb frontends truly are *shit*
01:40 AM Kliment: They may be shit but they're very nice to build automation from
01:40 AM vmt: msvs' frontend blows every gdb frontend out of the water
01:41 AM Kliment: Yeah, VS has a lovely debugger, and also lovely profiler
01:41 AM Kliment: But it's sadly coupled to an awful compiler and poor operating system support
01:41 AM vmt: sure
01:42 AM vmt: are you using an ICE to debug?
01:44 AM vmt: oh wait yeah, i was slightly thrown off. this is some new fancy stuff
01:48 AM Kliment: Yeah the UPDI things
01:48 AM Kliment: I have three different debuggers that support them, in hardware, but on the software side only avrdude knows how to speak UPDI
01:49 AM vmt: well the protocol itself is super simple
01:49 AM vmt: physically (:D)
01:49 AM vmt: I don't think openocd will do what you want. it never supported dw and i don't think it will support this either
01:52 AM Kliment: well honestly dw is a pain
01:53 AM Kliment: vmt: Is the UPDI protocol documented anywhere?
01:53 AM Kliment: vmt: I've not found anything
01:53 AM vmt: yeah, i'm trying to look at that
01:54 AM vmt: if it is, it probably isn't that big of a pain to make an implementation yourself
01:54 AM Kliment: I'm using the 416/816 for a project because of form factor
01:55 AM vmt: but, seeing how only avrdude supports it, ... UPDI starts to look like a pain as well
01:55 AM Kliment: The PCB it lives on is <10mm wide
01:55 AM Kliment: I've not found anything else in that form factor sadly
01:56 AM vmt: "updi is an atmel proprietary interface..." from mcp.com
01:58 AM Kliment: To be clear, I'm not married to the UPDI - but I've not found another microcontroller in a 3x3mm QFN-20
02:06 AM vmt: stm has a cm-0 with a < 3 mm side ufbga-36
02:06 AM vmt: 2.6 mm x 2.7 mm ufbga36
02:08 AM vmt: the same mcu comes also in a 5x5 fqn32
02:10 AM Kliment: I don't have the layers to route a µFBGA36
02:11 AM Kliment: The tiny816 form factor is ideal for my application
02:11 AM Kliment: And I've not found anything else in that ff
02:11 AM vmt: well sure, just mentioned it for the size. you could fit 5x5 though?
02:13 AM Kliment: Nope
02:13 AM vmt: though, the fqn32 is silly expensive compared to the bga
02:13 AM Kliment: https://i.imgur.com/2AuoaFB.jpg
02:14 AM Kliment: this is the board
02:14 AM vmt: are you going to mf in quantity, or have you already, that is?
02:14 AM Kliment: I'll be making a couple hundred of these
02:14 AM vmt: so that switching mcus is not an option?
02:15 AM Kliment: Everything is an option, but honestly this part is ideal for the application
02:15 AM vmt: what about 4x4?
02:15 AM vmt: hard to see from the picture how much actual leeway there is
02:17 AM Kliment: https://i.imgur.com/0EpzUaI.png
02:17 AM Kliment: not much
02:19 AM Kliment: With 4x4 I won't be able to route traces along bottom edge
02:20 AM Kliment: I'm honestly surprised this package form factor is not more popular
02:21 AM Kliment: I've only seen it on a few sensors so far, a LED driver, and this MCU series
02:23 AM vmt: mmyeah, that's pretty tight. well, you could do compilation and linking yourself and just use as for debugging?
02:23 AM Kliment: Yeah that's what I do now (mplab instead of AS though)
02:24 AM Kliment: AS consistently fails to find hardware for me
02:24 AM Kliment: mplabx for some reason works
02:25 AM Kliment: and I like the way it displays register values
02:26 AM Kliment: I'm pretty proud of this layout actually
02:27 AM Kliment: That's a high-power FET, a DC/DC converter, a thermocouple amplifier, programming/debug, i2c, and optional control panel connection (one button, two LEDs)
02:27 AM vmt: yeah. chances are you won't be doing anything super complicated on that, so really just scoping should be enough, no?
02:27 AM Kliment: I had lots of issues with i2c setup
02:27 AM Kliment: where I needed the debugger to figure out wtf was happening
02:28 AM vmt: i2c isn't really something you need an ocd for, though
02:28 AM Kliment: Well it was getting stuck in a particular state and I needed to see what state that was
02:29 AM Kliment: So had to read register values somehow
02:29 AM vmt: i'd disagree. i've never had serial comms i haven't been able to figure out with an LA
02:31 AM vmt: the hw setups themselves are so straightforward and trivial for avrs, you shouldn't have any trouble with those following the datasheet
02:35 AM Kliment: Well i don't know maybe I'm dumb or something
02:35 AM Kliment: the i2c periph on the 1-series is weird, compared to other avrs
03:44 AM cehteh: is it really the hardware or just the microchop namein/api?
03:53 AM Kliment: cehteh: by weird I mean different
03:54 AM Kliment: cehteh: a lot of the 1-series periphs are very strange to someone who has used avrs a lot but not the xmegas
03:55 AM cehteh: i wonder if thats the api or te hardware, i seen the api but not used, and thought maybe they just addwd anither abstraction on the usual hw
03:57 AM Kliment: nah, it's different HW
03:58 AM Kliment: ADC is totally different for example
04:49 AM Maya-sama is now known as Miyu
09:05 AM rue_mohr: I use whatever editor I want to write C code for 8 bit avrs, I use a makefile to compile and upload to them, I use either the arduino bootloader, or a ASP or the ISP2 programmer to write to them, I use an io pin to debug
09:05 AM rue_mohr: debugging with an io pin might sound like hardcore wizardry, but its not
09:06 AM LeoNerd: Debug by LED is quite reasonable yes. It's the hardware equivalent of debug by print-to-stderr
09:06 AM LeoNerd: Surprisingly effective
09:07 AM rue_mohr: if you know how to progressively build your code as modules and properly test the modules when their isolated, very few things ever come up.
09:08 AM rue_mohr: When someone comes in and says that they need a full on, breakpoint, code stepping debugger, what it really means is that they dont know how the code their using works
09:08 AM rue_mohr: which means they either didn't write it, or dont know what they wrote
09:10 AM rue_mohr: and I just KNOW that there are still people out there writing lots and lots of code without testing a thing and then being all dumbfounded when it doesn't work
09:34 AM Kliment: rue_mohr: My specific pain point was now knowing the register state inside an interrupt
09:34 AM Kliment: rue_mohr: debugger helped there, it would have taken much longer without
09:35 AM LeoNerd: I'd have maybe twiddled a spare IO line ("LED") with the relevant register state inside the ISR
09:35 AM LeoNerd: Then you can see if the LED comes on
09:35 AM LeoNerd: Note: sometimes "debug by LED" means attaching an LA because it's way too fast for humans
09:38 AM day: i prefer the serial port for general debugging
09:38 AM LeoNerd: Serial port can be useful too, depends on speed
09:39 AM LeoNerd: When I was debugging my I²C slave implementation, for example, that wouldn't work. A single instruction to twiddle a spare IO line with an LED would fit though
09:47 AM salcedo: progressively building code in "modules" and testing each one isolated is great
09:48 AM salcedo: that's what i do
09:48 AM salcedo: but sometimes even that isn't perfect
09:48 AM salcedo: for example - this lora stuff i'm working on... each "module" or function that i work on in isolation works perfectly
09:48 AM salcedo: but when you start putting them together, problems emerge
10:53 AM vmt: salcedo: your approach is terrifyingly borderlining unit testing which is fucking bollocks
01:06 PM N3vYn: vmt: if you couple unit testing with integration testing and functional testing it becomes pretty useful, especially when it comes to further development.
01:33 PM vmt: and when you're done testing do some more testing, combine that with AGILE development using SOLID principles and hire a software consultant (or two-three-four) in order to expedite, streamline and modernize your development pipeline
01:33 PM vmt: add in a bunch more vague fad words which mean nothing and you're set to go for the 21st century
01:34 PM vmt: N3vYn: unit testing serves no actual purpose. just the amount of refactoring you need to do when you write stuff iteratively is a big enough reason on its own not to do it
01:52 PM salcedo: don't forget selfies, kale shake vending machines, and a parking lot full of teslas.
01:53 PM salcedo: who would have thought in 2019 there would be people doing this shit as a hobby while on the brink of homelessness?
02:11 PM vmt: doing what, exactly?
02:12 PM salcedo: creating electronic gizmos that change lives!
02:12 PM salcedo: unless cloudflare is down, ofc.
02:12 PM salcedo: The outage caused problems with the cryptocurrency website Coindesk, which tweeted: ‘ Due to a Cloudflare outage, we’re getting bad data from our providers, which is showing incorrect crypto prices.
02:12 PM salcedo: ‘Calm down everyone, Bitcoin is not $26.’
02:13 PM vmt: i would be inclined to believe people creating electronic gizmos while on the brink of homelessness are not very successful
02:13 PM salcedo: that depends on whether or not they reside on Elysium.
02:14 PM salcedo: the success, in which case, is relative.
02:15 PM vmt: you think there are a lot of borderline homeless people who consider themselves successful?
02:16 PM vmt: or, on the flipside, do you think there are a lot of people who consider said people as successful?
02:16 PM vmt: i'm not sure where the relativity begins, here
02:37 PM proteusguy is now known as proteusdude
02:38 PM salcedo: the elysium people vs earth people have different lines to determine success
02:39 PM salcedo: someone on elysium would not consider the successes of an earthling a success at all. the same the other way.
08:22 PM ephemer0l is now known as GeneralDiscourse
11:24 PM day__ is now known as day