**** BEGIN LOGGING AT Wed Feb 06 02:59:57 2019 Feb 06 11:48:00 if someone wants another book about Linux Driver development, today available: https://www.packtpub.com//packt/offers/free-learning Feb 06 12:28:16 tbr: ++ Feb 06 12:46:19 zmatt: you wanna see the dumbest thing you'll see all month? Feb 06 12:46:28 zmatt: https://i.imgur.com/XnCqVYk.jpg Feb 06 12:47:00 what exactly are we seeing? Feb 06 12:47:41 a 64bit level shifter Feb 06 12:48:19 74HC165 Feb 06 12:48:24 you're seeing the world's foremost genius, kremlin, not putting P8 and P9 on the correct side Feb 06 12:48:24 classic Feb 06 12:48:26 so that the cape fits Feb 06 12:48:37 ooooh :) Feb 06 12:48:43 ouchie :) Feb 06 12:49:05 "trap for young players", as a certain Aussie youtuber would put it Feb 06 12:50:18 but why didn't you put more effort in and also mess up the orientation? Feb 06 12:50:35 rotation, specifically Feb 06 12:50:52 hush Feb 06 12:56:12 kremlin: just to console you, I made 3 versions of a Rpi hat until I got it right, and then I scrapped it and did it again from scratch for the BBBW Feb 06 12:56:41 but I learned a lot in the process Feb 06 12:56:53 i don't feel any better Feb 06 13:18:04 kremlin: where's the mistake ? Feb 06 13:18:13 see above Feb 06 13:22:35 if you turn upside down that board , P8 and P9 male pin headers fit the correct female on beaglebone....what am I missing ? Feb 06 13:28:01 perhaps you have soldered headers with longest side on wrong pcb side ? Feb 06 13:30:10 an A for creative thinking... Feb 06 13:49:18 I use "rfcomm connect 0 [address] 1" to connect an external BT device , how to keep rfcomm searching until BT devices becomes active ? Feb 06 13:49:48 kremlin: there's also no cutout for the ethernet connector Feb 06 13:50:35 zmatt: hence why i can't just stick it on top Feb 06 13:51:04 kremlin: and the connectors look like they're in the right place to me Feb 06 13:51:14 they're not Feb 06 13:51:16 since you need to flip the board to be able to insert it Feb 06 13:51:17 they're switched Feb 06 13:51:28 right but then it is too tall Feb 06 13:51:51 so you also soldered on the connectors on the wrong side? Feb 06 13:52:14 or does it stick out on the reverse side? Feb 06 13:52:33 so my misunderstanding wasn't wrong... Feb 06 13:53:22 i soldered the header on wrong yeah Feb 06 13:54:16 go for m/f headers extension Feb 06 13:55:00 i have something up my sleave for attempt #2 Feb 06 13:55:09 https://i.imgur.com/bSBqwPu.jpg Feb 06 13:55:12 long boys Feb 06 13:56:21 take a side picture of the board... Feb 06 13:57:07 have you built the board yourself ? Feb 06 13:57:16 not a comercial product ? Feb 06 13:57:25 yeah built myself Feb 06 13:57:32 can't take photo rn Feb 06 13:57:50 fine Feb 06 14:49:42 (m) Feb 06 15:54:20 I need a script to kill command1 if a string is returned while checking into a loop: Feb 06 15:54:25 https://ghostbin.com/paste/cy8kr Feb 06 15:54:48 but if string is found , pkill kills the entire script.... Feb 06 15:55:44 what you need, is to stop trying to use bash as a general-purpose programming language Feb 06 15:56:22 zmatt: well i think it qualifies as turing complete.... Feb 06 15:57:08 You've already said, but sadly it is the only one I (badly) know..... with a different one it would be even worse.... :-((( Feb 06 15:59:45 no, you keep asking things that are difficult in bash but easy in high-level languages like python or perl Feb 06 16:03:39 I blindly trust you , but I don't even know where to start with , using different language....it would be a mess (for me) doing something simpler from scratch usinf python rather than something tricky but (badly) working in bash... Feb 06 16:04:28 too old to start learning .... Feb 06 16:04:45 :-) Feb 06 16:12:49 fred__tv: heh, if you only "badly" know bash, how much worse can it be if you start again with e.g. python :) Feb 06 16:13:11 fred__tv: it's not like you'd loose a lot... Feb 06 16:15:43 you're seeing easiness from a different perspective.... Feb 06 16:18:14 it's like I just had my driving license, but you says "you need to drive airplane, it's not that difficult"..... :-)) Feb 06 16:21:30 I agree the zmatt view , in doing more complex things I have alredy done with bash (bluetooth , uart, calculations etc) I don't think bash is so bad to check a process.... Feb 06 16:26:12 fred__tv: yep, but most of the effort has to come from you anyway. Feb 06 16:26:40 fred__tv: https://pastebin.com/L1YJsw4G https://pastebin.com/ZWCtk9By Feb 06 16:27:23 thinkfat: surely... Feb 06 16:28:22 definitely like the python version more than perl Feb 06 16:29:14 sure, but perl is slightly more similar to bash Feb 06 16:31:54 fred__tv: this is assuming you need to read lines until a condition, which I assumed since you expressed a need to kill the child Feb 06 16:33:01 I don't know why you need to do this, I suspect this is an x-y problem (i.e. a problem caused by doing something else the wrong way), but I just stuck to the problem statement as-is Feb 06 16:33:17 x-y problem Feb 06 16:34:12 https://en.wikipedia.org/wiki/XY_problem Feb 06 16:37:42 rfcomm hangs in channel "closed" when the BT device is powered off , so no way to automatically search and reconnect to available device other than kill and restart rfcomm itself Feb 06 16:37:50 yes I know.... Feb 06 16:38:30 okay, so indeed a problem that wouldn't exist if you weren't trying to kludge this together using various programs and bash Feb 06 16:38:50 I will do some after-dinner homeworks..... Feb 06 16:40:08 surely it would be managed the right way with the right language Feb 06 16:41:48 it is just a personal tool I'm trying to build myself with my poor knowledge , i have to admit, my job is different, Feb 06 16:42:22 see you later, than you Feb 06 16:42:30 *thank Feb 06 20:25:53 https://groupgets.com/campaigns/510-baconbits Feb 07 01:00:44 dweet.io! Feb 07 01:00:57 I got my BBB running some ideas via dweet.io! Feb 07 01:02:08 if the CPU load is 0.5, should this make a difference? Feb 07 01:02:34 And then, it bounced up to 31.5. Odd. Feb 07 01:19:09 0.5 is fine Feb 07 01:19:14 31.5 isn't very much fine Feb 07 01:19:33 well, it can be fine Feb 07 01:19:42 Oh. I noticed that the bounce in load jumped when I signed in via terminal two. Feb 07 01:19:57 I had two terminals open and then it leveled out again. Feb 07 01:20:04 that dweet thing claims to be "M2M for IOT" but it's on top of HTTP Feb 07 01:20:10 exactly, something like ssh authentication will cause a burst of cpu activity Feb 07 01:20:20 Aw. Feb 07 01:20:35 That must have been what happened. Lots of processing going on, I guess. Feb 07 01:20:51 what are you using to check cpu load? Feb 07 01:21:00 Hold. Let me check. Feb 07 01:21:14 psutil Feb 07 01:21:44 'uptime' will show cpu load averages over past 1, 5, and 15 minutes Feb 07 01:22:20 I have this software. Let me show you in a paste if you are interested. Feb 07 01:22:22 htop does it too Feb 07 01:22:27 or I should say "system load", which isn't exactly the same as cpu load Feb 07 01:23:18 if one process is using 100% cpu load and other processes are idle then it'll show a system load of 1.00 Feb 07 01:24:04 but if you have two processes that both try to use 100% cpu load, the system load would be 2.00 even though the cpu obviously can't be busier than 100% cpu load Feb 07 01:26:20 https://pastebin.com/DiZ33L9M is the coolness of the software I found and altered a bit. Feb 07 01:26:41 Some book, "Learning BeagleBone Python Programming." Feb 07 01:26:49 circa 2013! Feb 07 01:28:26 ah ! Feb 07 01:28:32 so you're using a library, not much a program Feb 07 01:28:53 Not yet...I just started this dweet.io stuff. Feb 07 01:28:54 don't you have an uptime function in the psutil module ? Feb 07 01:29:04 instead of using the /proc API Feb 07 01:29:15 well that module will certainly use that itself, anywxay Feb 07 01:29:20 Hmm. Probably. I can check later. Feb 07 01:29:27 Notes, notes, notes. Feb 07 01:29:57 I was reading over psutil a while back. I did not get too far w/ it yet. Feb 07 01:31:50 https://psutil.readthedocs.io/en/latest/ is the docs. I was reviewing to find out more. Feb 07 01:32:22 yeah the module supports uptime Feb 07 01:32:57 ah Feb 07 01:33:00 but not load average Feb 07 01:33:07 because it's already in python Feb 07 01:33:10 see https://docs.python.org/3/library/os.html#os.getloadavg Feb 07 01:34:30 https://pastebin.com/ZHzE6rnx Feb 07 01:34:31 here ya go Feb 07 01:36:09 zmatt: And that snippet will get me load instead of "system load?" Feb 07 01:36:33 import os; print(os.getloadavg()) Feb 07 01:37:13 lol Feb 07 01:37:14 nice Feb 07 01:37:57 set_: apparently it's already available in the standard library Feb 07 01:38:22 Yea. os has a lot of ideas involving a bunch of stuff. Feb 07 01:38:25 set_: it gives you a tuple of three system load averages (over last minute, last 5 minutes, and last 10 minutes) Feb 07 01:38:57 Hmm. I guess I can try that. Please hold for dweeting. Feb 07 01:41:55 Yikes. I tried to convert a tuple object to string. Feb 07 01:42:10 I need to change that real quickly. Feb 07 01:42:31 I have to re-code qemu/kvm Feb 07 01:42:40 for yesterday Feb 07 01:42:45 lol Feb 07 01:42:51 the teacher kept the submission repo open, maybe he won't notice I'm late Feb 07 01:43:46 If that fellow/lady can read times, I am sure you are busted. Feb 07 01:43:53 lol Feb 07 01:43:53 Oops. Feb 07 01:44:01 maybe he'll substract a few marks from the grade Feb 07 01:44:06 set_: print( "system load averages: %.2f (1 min), %.2f (5 min), %.2f (15 min)" % os.getloadavg() ) Feb 07 01:44:14 Okay. Feb 07 01:44:18 I can try that. Feb 07 01:44:20 for example Feb 07 01:45:00 I got the dang terminal to print the load and the Dweet.io printing the load too. Feb 07 01:45:18 instead of print() you can of course do anything else with it Feb 07 01:45:23 Right. Feb 07 01:46:07 laserEngrave(cpu_load())? Feb 07 01:46:38 I meant: LaserEngrave(os.getloadavg()). Sorry. Feb 07 01:47:05 Too bad things did not work the way I say they do. Feb 07 01:47:40 or do loadavg = os.getloadavg(); dweet(thing_name, loadavg_1min=loadavg[0], loadavg_5min=loadavg[1], loadavg_15min=loadavg[2]) Feb 07 01:48:31 Sure. I can try it. Feb 07 01:48:47 in general you can access the elements of a tuple using indexing (as I do here) or by destructuring, e.g. (a,b,c) = os.getloadavg() Feb 07 01:49:34 (same works for lists of course, tuples are basically just readonly lists) Feb 07 01:50:06 I was reading this book on when to use all of those and it included dictionaries. Feb 07 01:50:16 lists, dicts, tuples. Feb 07 01:50:51 I just started this course on classes and inheritance. Feb 07 01:51:02 Should be boring but how else will I learn. Feb 07 01:51:14 learning is not boring Feb 07 01:51:23 if you understand what you're learning Feb 07 01:51:34 your brain should be pleased to understand new things Feb 07 01:51:55 I have to learn to do things. The "have to learn" part of that last sentence is a means to an end. I like doing more. Feb 07 01:52:06 Bots! Go! Feb 07 01:52:39 But yea. You are right. When I can understand, learning can be fun. Feb 07 01:54:14 learning is so 80's. Just kidding. Feb 07 01:54:50 I still have not set up my RelayCape. Feb 07 01:55:18 I keep trying to catch up to make this thing switch stuff on. I have been unable due to a xt60 (female) that needs to show up. Feb 07 01:55:39 This dog-gone BBBlue needs to fly before I die. Feb 07 01:55:57 it's a cape with relays ? as the name implies Feb 07 01:56:02 yes. Feb 07 01:56:15 I made one Feb 07 01:56:18 I should finish working on it Feb 07 01:56:22 They have four relays on it. Feb 07 01:56:24 Oh? Feb 07 01:56:29 well it's not a cape, just a prototype board Feb 07 01:56:45 Still. That is cool too. Feb 07 01:57:00 Making connections and diversity on electronics rules. Feb 07 01:57:00 with 6LoWPAN connectivity, current and phase sensor, solid-state relay Feb 07 01:57:05 and ARM board Feb 07 01:57:08 Oh. Feb 07 01:57:31 stm32 board Feb 07 01:57:47 mawk: Are you familiar w/ the Motor Bridge Cape? Feb 07 01:57:55 From seeed studio? Feb 07 01:58:06 They have a stm32 on it. Feb 07 01:58:15 not really Feb 07 01:58:25 I never had a cape or hat or extension board or whatever, for my boards Feb 07 01:58:54 Oh. Well anyway, they made a library for it. I want to change their library. So, I got this book on Atmel chips. Feb 07 01:59:27 atmel ? Feb 07 01:59:34 you're talking about the motor bridge cape ? Feb 07 01:59:38 Right. Feb 07 01:59:42 It is not atmel? Feb 07 02:00:00 it's stm32 Feb 07 02:00:10 Oh right. Sorry. Feb 07 02:00:16 which is a ARM chip made by ST Feb 07 02:00:25 a french-italian company Feb 07 02:00:38 atmel is the arduino platform Feb 07 02:00:43 Oh. Feb 07 02:01:04 is atmel AVR stuff? Feb 07 02:01:34 yeah Feb 07 02:01:45 Okay. Feb 07 02:01:54 I was mistaken. I got the wrong damn book. Feb 07 02:02:03 Sorry for the issue. Feb 07 02:02:06 brb Feb 07 02:02:46 AVR is still worth learning Feb 07 02:02:51 you can never have too many books Feb 07 02:02:56 unless you're short of room or moneyh Feb 07 02:06:23 Yep. Feb 07 02:06:43 the beef stew was done. So, back to this stm32 stuff. Feb 07 02:07:00 stm32 is quite nice Feb 07 02:07:10 Do you know of any nice books on stm stuff? Feb 07 02:07:12 and I see they're using mbed for their cape ? it's a bit like the arduino ide Feb 07 02:07:14 e.g. very easy Feb 07 02:07:33 Yea. They only have so many peripherals. Feb 07 02:07:48 But...this Cape has given the community trouble in the past. Feb 07 02:07:49 well there's a ton of peripherals, but you only use the ones you need Feb 07 02:08:00 I didn't need a book to learn stm32, so I don't know any Feb 07 02:08:04 but you can just learn by practice Feb 07 02:08:15 I wanted to try to give the Motor Bridge Cape a new lease on life. Feb 07 02:08:18 get a nucleo board, load it in the mbed IDE, start playing with examples Feb 07 02:08:22 yeah Feb 07 02:08:26 you can do it Feb 07 02:08:37 even if it's an exotic cape or whatever it's still relatively easy to program in theory Feb 07 02:09:05 Right. I just need the chip reference manual. Feb 07 02:09:11 But... Feb 07 02:09:30 you typically need the SWCLK and SWDIO ports for debugging and programming, and the TX/RX ports for printing out to console Feb 07 02:09:46 on the cape itself Feb 07 02:09:54 Oh. Feb 07 02:09:56 then you can do anything Feb 07 02:09:59 program it, debug it Feb 07 02:10:03 That is good news. Feb 07 02:10:12 with the help of a device that costs $1 on aliexpress Feb 07 02:10:17 or with the help of another nucleo board Feb 07 02:10:21 nucleo or disco Feb 07 02:10:31 nucleo and disco are the two "brands" of evaluation boards for STM32 Feb 07 02:10:33 The BBB's Motor Bridge Cape works as is. Feb 07 02:10:34 they're quite cheap Feb 07 02:10:38 yeah I know Feb 07 02:10:43 Oh. Feb 07 02:10:44 but I mean if you want to program it you need this Feb 07 02:10:48 you need a programmer Feb 07 02:10:50 Aw. Feb 07 02:10:51 which is called the st-link Feb 07 02:10:56 Like? Oh! Feb 07 02:10:59 st-link. Feb 07 02:11:03 you can buy a standalone stlink for $1, or use the embedded stlink on a nucleo/disco board Feb 07 02:11:11 (which is also the worst jtag debugger I've used in my life) Feb 07 02:11:18 Got it. Hhahaha. Feb 07 02:11:19 you can even make your own stlink, but it's kind of the chicken and egg problem Feb 07 02:11:24 you'll need a programmer to make your stlink Feb 07 02:11:30 yeah, it's a "high level debugger" Feb 07 02:11:38 isn't a true jtag debugger but takes its own commands Feb 07 02:11:49 Oh. Feb 07 02:11:56 so you need to be hackish if you want to use it for something else than stm32 Feb 07 02:11:57 it can be used as a jtag debugger, openocd supports it Feb 07 02:12:00 yeah Feb 07 02:12:08 jtag ? you're sure ? Feb 07 02:12:13 my issues with it are electrical in nature Feb 07 02:12:15 I used it as SW debugger with openocd Feb 07 02:12:20 but not jtag Feb 07 02:12:20 yes I'm sure, I've never used swd Feb 07 02:12:23 ah Feb 07 02:12:28 nice Feb 07 02:12:41 the stm board I was targeting had jtag Feb 07 02:12:58 https://www.adafruit.com/product/2548?gclid=CjwKCAiAqOriBRAfEiwAEb9oXWS8E0dC7xWuY3HSbm6MrgBRvoZxmWr0gpgpJxPrWXog-gsYUyznXxoCL-wQAvD_BwE Feb 07 02:13:02 This is what I found. Feb 07 02:13:12 yeah Feb 07 02:13:15 I found another on Digi-Key for $21.00. Feb 07 02:13:17 but this one is the original brand Feb 07 02:13:20 it's expensive Feb 07 02:13:21 Oh. Feb 07 02:13:22 Right. Feb 07 02:13:23 you can get a counterfeit for cheap Feb 07 02:13:55 Yep. So, I just need to use that damn thing instead of a software package? Feb 07 02:14:01 https://fr.aliexpress.com/item/1PCS-ST-LINK-Stlink-ST-Link-V2-Mini-STM8-STM32-Simulator-Download-Programmer-Programming-With-Cover/32792513237.html Feb 07 02:14:04 software ? Feb 07 02:14:11 this is just to flash your software onto the cape Feb 07 02:14:11 Yea. Feb 07 02:14:15 Oh! Feb 07 02:14:15 you need a software to flash Feb 07 02:14:19 Right. Feb 07 02:16:05 also if you feel adventurous you can even flash without anything, just chop off the end of a usb cable and wire it to the correct stm32 pins after soldering a header Feb 07 02:16:05 to the USB pins, if that stm32 has it Feb 07 02:16:05 the main thing that sucks about the st/link v2 is that it *must* be powered if you have it connected to a powered-on target (so you can't leave it connected to a powered target and unplug it from your usb port) and it seems to invariably glitch the reset line if you try to hotplug Feb 07 02:16:05 then you have the embedded ST bootloader that can accept programs to be flashed Feb 07 02:16:05 but you won't be able to debug, it's a lame solution Feb 07 02:16:08 yeah Feb 07 02:16:27 with SW it works better I guess Feb 07 02:16:48 So, I need to get the schematic of the Cape, use SWCLK and SWDIO, and then for debugging, I would use RX/TX. Feb 07 02:16:49 the nicest low-cost jtag debugger I've used so far is TI's XDS100v2 Feb 07 02:16:54 but it doesn't support SWD Feb 07 02:17:13 for debugging you use SWCLK/SWDIO too set_ , TX/RX is for the serial port Feb 07 02:17:18 if you want to print out messages and stuff Feb 07 02:17:25 I have a JTAG here. Feb 07 02:17:28 ehh, I don't see why either of the two problems I had would be any different with SWD Feb 07 02:17:33 by debugging I mean step inside gdb Feb 07 02:17:40 Oh. Feb 07 02:17:41 you don't have a reset line with SWD Feb 07 02:17:49 so electrical glitches can't reset the target I guess Feb 07 02:18:47 not connecting the reset line is a "solution" in all cases of course, but normally you want to be able to establish a debug connection while holding the target in reset Feb 07 02:19:46 I mean the reset command goes through the swdio/swclk pins Feb 07 02:19:56 but it's a command, not an asserted line Feb 07 02:20:04 which is not a substitute Feb 07 02:20:11 the official swd connector pinout includes reset Feb 07 02:20:11 ah Feb 07 02:20:14 I see Feb 07 02:20:18 yeah Feb 07 02:20:28 Heh, heh, heh> Feb 07 02:21:03 Forget it. Feb 07 02:21:54 So, the debugger for that chip works. Got this fact but the connections to the chip are most likely inaccessible on the Cape. Feb 07 02:22:07 http://wiki.seeedstudio.com/Motor_Bridge_Cape_v1.0/ Feb 07 02:22:13 I see copper pads on this picture Feb 07 02:22:22 you just have to solder a header on it Feb 07 02:22:39 and I bet SWD/JTAG is exposed on that patch of pre-soldered headers Feb 07 02:22:58 ah, no Feb 07 02:23:01 it's just a prototype board Feb 07 02:23:02 lame Feb 07 02:23:15 but there's a "swd interface" somewhere else Feb 07 02:23:19 https://raw.githubusercontent.com/SeeedDocument/Motor_Bridge_Cape_v1.0/master/img/Motor_Bridge_Hardware_overview.jpg Feb 07 02:23:21 at the bottom Feb 07 02:23:46 Hold on. Let me get this Cape off this board. Feb 07 02:24:09 you have ground, reset, swdio, I don't know, swclk Feb 07 02:24:53 mawk: see, they include nRST too :) Feb 07 02:25:05 yeah Feb 07 02:25:59 looks like the last two pins are uart, with txd (from the host's perspective I presume) shared with swclk? Feb 07 02:26:24 yeah, looks weird Feb 07 02:28:21 they have a do not connect pin above, but they choose to make a shared pad ? Feb 07 02:28:32 that's a strange design decision Feb 07 02:29:06 probably to be compatible with standard ftdi serial header Feb 07 02:29:08 the nc is 5v Feb 07 02:29:29 ah Feb 07 02:29:49 that's my guess anywya Feb 07 02:29:57 actually no, it doesn't Feb 07 02:30:10 So, if I have a ftdi serial header, I can use it for programming or do I definitely need a debugger/st-link? Feb 07 02:30:23 that depends on the programming they made Feb 07 02:30:27 Oh. Feb 07 02:30:36 how they setup their core to behave Feb 07 02:30:41 you can't have both jtag and swd Feb 07 02:30:44 iirc Feb 07 02:30:46 you can Feb 07 02:30:49 So, it may not be able to be overriden? Feb 07 02:31:00 yes but you have to choose, no ? Feb 07 02:31:00 I do not think I can found out unless I try it out. Feb 07 02:31:15 when I configure a stm32 board I have to choose between the two Feb 07 02:31:52 it must be in some documentation Feb 07 02:31:52 mawk: normally the debugger can switch by sending a special sequence Feb 07 02:32:02 ah, nice Feb 07 02:32:57 but this particular stm32 doesn't support jtag anyway Feb 07 02:33:20 i.e. it has an sw-dp, not an swj-dp Feb 07 02:34:32 if you plan to learn stm32 you can get a nucleo or disco board and you have an embedded stlink you can use for this matter, set_ Feb 07 02:34:37 else you can get just the stlink Feb 07 02:34:39 to program that cap Feb 07 02:34:40 e Feb 07 02:35:16 Okay. Feb 07 02:35:18 and if you can't wait you can check if the core you have has the builtin ST USB or UART bootloader you can use to flash stuff Feb 07 02:35:24 but you won't be able to debug in gdb Feb 07 02:35:42 I never used that method, it's not extremely convenient Feb 07 02:35:44 but it exists Feb 07 02:35:58 but also you'll lose the previous software that was on it, of course Feb 07 02:36:15 Oh. Feb 07 02:36:18 I don't think you can dump it using the ST bootloader Feb 07 02:36:24 with a stlink you can dump it Feb 07 02:36:45 So, that header is what I can use to set up the debugger? Feb 07 02:37:17 that header = the empty pin holes on the Cape? Feb 07 02:37:18 the "SWD interface" on the photo ? yes that's what you use to program the chip Feb 07 02:37:25 Aw! Feb 07 02:37:34 the 6 copper pads near the reset button Feb 07 02:37:40 Okay. Feb 07 02:38:07 check the schematic to verify precisely how they're wired, or if you need to assert a special signal before applying power to make the in-place program power up the debug interface Feb 07 02:39:01 (I'm not sure it's wise to give set_ this information, for the sake of his motor bridge cape's health :P ) Feb 07 02:39:07 lol Feb 07 02:39:11 mawk: Did you ever look up that chip info, i.e. the STM32F0? Feb 07 02:39:12 yeah Feb 07 02:39:17 No issue. I have two! Feb 07 02:39:20 no, they are a bit all alike Feb 07 02:39:31 either way if you mess things up I can assist you in restoring the previous program Feb 07 02:39:40 Really? Feb 07 02:39:42 if you have a stlink at hand Feb 07 02:39:46 Oh. Feb 07 02:39:47 or even if you don't, if that UART route is viable Feb 07 02:39:48 Okay. Feb 07 02:39:56 then you'd need a USB-UART adapter Feb 07 02:40:07 but it's approximatively the same price as a stlink v2 Feb 07 02:40:13 Okay. Things get complicated quickly. Sheesh. Yikes! Feb 07 02:40:26 but if you have a raspberry pi or a BBB you don't need a USB-UART adapter Feb 07 02:40:34 Right. I have a BBB. Feb 07 02:40:39 well stlink, USB-UART, all those things are just the cables and adapters you need to talk between peripherals Feb 07 02:40:51 they're just the dumb pipes Feb 07 02:40:56 more or less dumb Feb 07 02:40:58 Okay. Feb 07 02:41:15 Right, Read and write. Feb 07 02:41:46 So, is there anyway to program that chip right onboard of the BBB? Feb 07 02:41:59 just with a bbb you mean ? Feb 07 02:42:03 without any adapter ? Feb 07 02:42:04 mawk: jtag/swd switching is pretty simple btw. you send (on SWDIO/TMS, sampled on rising edge of SWCLK/TCK) 0111100111100111 for JTAG-to-SWD and 0011110011100111 for SWD-to-JTAG, in both cases preceded and followed by at least 50 cycles with SWDIO/TMS high Feb 07 02:42:07 Sure. Feb 07 02:42:21 I know openocd supports bitbanging using gpio, but I don't know if that's a viable route for SWD Feb 07 02:42:33 I wouldn't exactly trust that, but you can't do much harm Feb 07 02:42:48 the only way to "kill" the cape is to tell it you want to lock the flash Feb 07 02:42:56 but you need a very specific sequence to do that Feb 07 02:43:06 other than that you could always restore to a good state I think Feb 07 02:43:25 nice zmatt ! Feb 07 02:43:25 if you have the original firmware Feb 07 02:43:29 I didn't think that was possible Feb 07 02:43:32 yeah Feb 07 02:43:51 Yea. I think I will save this chat, purchase the cheaper st-link, and then try that idea w/ a couple of RMs. Feb 07 02:44:10 I mean...really? Why would I not know more? Feb 07 02:44:21 That would be a good tutorial. Feb 07 02:44:26 you can try to learn stm32 a bit before using a "field" board Feb 07 02:44:33 but that cape is more or less a learning board Feb 07 02:44:41 but not much pins are exposed Feb 07 02:44:45 just a couple GPIOs apparently Feb 07 02:44:59 if you want to play with uart, spi, whatever, you can get a nucleo board for around $10 Feb 07 02:45:03 if you want to play with an stm32, just get some cheap dev board for it Feb 07 02:45:04 exactly Feb 07 02:45:18 No! Feb 07 02:45:31 no point in abusing the motor bridge cape as a crappy stm32 dev board Feb 07 02:45:34 I mean. Okay. Feb 07 02:46:04 It was $9.00 online before the pricing went back up. Feb 07 02:46:19 either way you have a begginer friendly IDE named mbed, they advertise it on the cape page Feb 07 02:46:27 I bet they have 1000's of them just sitting. Feb 07 02:46:27 it's C++, and you have some ± nice docs Feb 07 02:46:28 Oh. Feb 07 02:46:29 Okay. Feb 07 02:46:53 but since it's a custom board I don't know if it's that beginner friendly, you'll have some customization to do maybe Feb 07 02:47:04 Oh. Feb 07 02:47:05 but since they advertise it maybe they have a ready package for mbed Feb 07 02:47:11 it should be it the cape docs Feb 07 02:47:43 They have ideas on flashing the STM32F0 while it is attached to the BBB. Feb 07 02:47:56 Please hold. Feb 07 02:48:25 mawk: on the JTAG side, sending 5 or more 1-bits will ensure it's in reset state and from there any sequence that matches /^0+111+$/ will just take the port to idle state and back to reset state Feb 07 02:48:25 yeah, with I2C Feb 07 02:48:31 looks like a custom flashing thing Feb 07 02:48:39 so you do it once, but then you need a stlink again Feb 07 02:48:45 (and the switching sequences are built from subsequences that match that) Feb 07 02:49:02 https://github.com/Seeed-Studio/MotorBridgeCapeFirmwareSourceCode is the link. I never really knew of their types of files. Feb 07 02:49:08 I thought it used serial for flashing? Feb 07 02:49:11 So, I could not move forward. Feb 07 02:49:31 set_: why do you want to reflash the motor bridge cape? Feb 07 02:49:37 they say I2C on the cape page Feb 07 02:49:46 Testing, tutorials, and for fun! Feb 07 02:49:51 it's the builtin ST bootloader that uses serial, but they're not using that apparently Feb 07 02:50:10 they did their own firmware updater thing Feb 07 02:51:01 but that thing isn't practical, you can just use the ST method with uart and special boot pin state Feb 07 02:51:01 Well, the library is all fine and dandy but why would I not want to try something different. Learning is costly and I already have this Cape to learn on. Feb 07 02:51:09 but even that thing itself isn't practical, I've never used it Feb 07 02:51:10 mawk: well they also connected uart, reset, and boot0 Feb 07 02:51:11 I just use the stlink Feb 07 02:51:27 Okay. Feb 07 02:51:29 mawk: so you can put it in serial bootloader mode, no matter what's flashed onto it Feb 07 02:51:38 yeah Feb 07 02:52:24 set_: testing what? what tutorial? Feb 07 02:52:28 zmatt: I always thought of how nice it would be to learn to flash things. I learned some on u-boot, CC, and another board but I have this tech. handy. Feb 07 02:52:51 set_: "how to flash things" is completely different depending on the thing Feb 07 02:52:57 Testing flashing the MBR and a new tutorial on this exercise. Feb 07 02:53:26 Right. But! This is part of the community things (Capes) and I wanted to give back somehow. Feb 07 02:53:49 ??? Feb 07 02:53:53 Yep! Feb 07 02:54:09 they connected RX, TX/SWCLK, SWDIO, NRST Feb 07 02:54:14 Yea boy! Feb 07 02:54:48 mawk: you're now referring to the header, I'm talking about what's connected to the beaglebone Feb 07 02:54:53 ah Feb 07 02:55:02 yeah Feb 07 02:55:23 So, that header and some basic knowhow should prevent me from learning other things for quite some time. Feb 07 02:55:26 they made sure the beaglebone can get the processor into serial bootloader mode Feb 07 02:55:46 I think this task should be done. Feb 07 02:55:46 set_: you don't need the header (nor st/link) to reflash the motor cape, it can be done from the beaglebone Feb 07 02:55:53 I know! Feb 07 02:55:57 But, I do not know how. Feb 07 02:56:09 I wanted to try the header and w/ the BBB. Feb 07 02:56:10 I still very much question why you would want to however, but whatever Feb 07 02:56:23 zmatt: Why would I not want to know more? Feb 07 02:56:36 doing it from the BBB and with the uart is challenging enough Feb 07 02:56:39 you can start from that Feb 07 02:56:47 Okay. Feb 07 02:57:08 Challenging enough...I thought it was more complicated w/ the BBB. Feb 07 02:57:14 you can read the STM32 docs to see what protocol is expected on the uart, and what to do with BOOT0/BOOT1 to put it in uart flash mode Feb 07 02:57:16 I guess not. Feb 07 02:57:16 you always seem to want random things of questionable utility, even though I'm pretty sure you also have projects that are more tangible Feb 07 02:57:47 well it's a bit more complicated that way yeah Feb 07 02:57:59 I can always perform motor skills and longer software examples but even that fun gets boring. Feb 07 02:58:01 but I'm sure tools are already readily available that can speak the st protocol for the uart Feb 07 02:58:17 Probably. Feb 07 02:59:24 zmatt: I like to work w/ motors for display but outside of display are some real skills to use and learn/grasp. Feb 07 02:59:40 dang it. brb **** ENDING LOGGING AT Thu Feb 07 02:59:57 2019