*** tpb has joined #tomu | 00:00 | |
xobs | TechAspirer: The OpticSpy demo was used as part of the OpticSpy workshop at Teardown. Tomu acts as a transmitter and the OpticSpy acts as a receiver. If you type some text the LED will start flickering at 19200 baud. | 00:59 |
---|---|---|
*** tomu-ci has joined #tomu | 01:03 | |
tomu-ci | [im-tomu.github.io] xobs pushed 1 new commit to master: https://git.io/vhE0f | 01:03 |
tomu-ci | im-tomu.github.io/master 97db1b4 Sean Cross: samples: add arm-none-eabi-newlib to arch deps... | 01:03 |
*** tomu-ci has left #tomu | 01:03 | |
*** k-man has joined #tomu | 01:06 | |
TechAspirer | Got it. Thanks xobs | 02:53 |
TechAspirer | I have to debug this LED code but then I'll check it | 02:54 |
TechAspirer | Start off. 5 seconds turn both LEDS on. 5 seconds turn both off. I'm getting Both, Red, Green, off. | 02:55 |
TechAspirer | Missing bool invert. Works now :D | 02:56 |
TechAspirer | xobs: I have something for you | 02:56 |
xobs | TechAspirer: Is it a pull request? | 03:13 |
xobs | Actually, if anyone feels like poking at the captouch stuff, it's in the "quickstart" repo. I wrote it while on a plane, and it's mostly for debugging. | 03:13 |
xobs | It's also a good example of a serial interface over USB. | 03:14 |
TechAspirer | No | 03:17 |
TechAspirer | It's a git repo of my own | 03:17 |
TechAspirer | Finalizing it now | 03:18 |
TechAspirer | And I want a digital button thing :P But that's likely analog with > HALF | 03:18 |
TechAspirer | xobs: Who's the owner of the copyright for the Quickstart repo? | 03:20 |
TechAspirer | Because you just copied in the Apache license | 03:21 |
TechAspirer | Including the part that says how to use it | 03:21 |
TechAspirer | "APPENDIX: How to apply the Apache License to your work." "Copyright {yyyy} {name of copyright owner}" | 03:22 |
xobs | Licensing is hard. | 03:23 |
TechAspirer | So who owns the copyright and what year is it? | 03:25 |
TechAspirer | I need to know before I can upload my code | 03:25 |
TechAspirer | Is it xobs, your real name, The Tomu Foundation, tomu.im... | 03:26 |
xobs | libopencm3 is the owner of the libopencm3 repo, though some of their headers come from CMSIS. I'm the owner of some of the demos, others come from the samples repo. The bin/ directory contains files generated by the dfu-utils project. The README is mine, and the license is the Apache foundation. | 03:26 |
TechAspirer | God damn it | 03:27 |
TechAspirer | What about the makefile | 03:27 |
TechAspirer | That's the part I'm editing and redistributing | 03:27 |
TechAspirer | And I wasn't saying GDI to your response. It's very helpful. I was saying it about the situation. | 03:27 |
TechAspirer | Gecko SDK? | 03:28 |
xobs | I'd say the Makefile is mine, 2018, distribute however you like. I find it useful, and would like to get it out there. | 03:28 |
xobs | Assuming you mean the one from quickstart. Makefile.common | 03:29 |
TechAspirer | Yeah | 03:29 |
TechAspirer | What's your first and last name or should I use xobs? | 03:29 |
xobs | Sean Cross | 03:29 |
TechAspirer | 2017-2018? | 03:29 |
TechAspirer | Thank you | 03:30 |
TechAspirer | xobs: SO | 03:36 |
TechAspirer | This is way lower level than I expected | 03:37 |
TechAspirer | I'm both coping and excited | 03:37 |
xobs | How do you mean? | 03:37 |
TechAspirer | I mean I backed this months ago on Crowd Supply and was more expecting a command line build of GCC and a few headers that allowed Arduino like access | 03:38 |
TechAspirer | No IDE. Nothing fancy. No need to use libopenmc3 to turn a LED on | 03:38 |
TechAspirer | *backed months ago and walked away without doing further research | 03:38 |
TechAspirer | It is my fault :P Not blaming anyone. | 03:38 |
TechAspirer | Anyways, point was, I made some headers | 03:38 |
TechAspirer | https://github.com/kayabaNerve/LTE/blob/master/samples/blink/main.c | 03:39 |
tpb | Title: LTE/main.c at master · kayabaNerve/LTE · GitHub (at github.com) | 03:39 |
TechAspirer | It blinks every 5 seconds with both LEDs and turns off | 03:39 |
TechAspirer | I made a tomu.h to handle the watchdog/toboot, timer, and infinite loop, and LED header to handle the GPUO | 03:40 |
TechAspirer | So now all I have to do is declare main, start tomu(), start led(), declare my every milisecond function, and call the infinite loop | 03:40 |
TechAspirer | It makes the hardware more accessible. That's all I'm saying. | 03:41 |
TechAspirer | I'm not saying that's the goal of this. | 03:41 |
TechAspirer | *this = Tomu, not my headers. | 03:41 |
TechAspirer | Any thoughts? Hate it? Out of place for Tomu? Could help the community? Happy to see someone writing code based on Tomu? | 03:48 |
xobs | TechAspirer: I think I need to replace Weechat. I sent some replies but they got eaten... | 04:18 |
TechAspirer | Dunn dunn dunn | 04:19 |
xobs | TechAspirer: I think it's cool! It could help the community for sure because it makes it easier to figure out what's required to write something. | 04:19 |
TechAspirer | I'm on the webchat right now | 04:19 |
xobs | You probably want to make your header functions "static inline" to avoid linker errors when you include them twice. | 04:20 |
TechAspirer | Happy to hear it. I was worried you'd think it's destroying the purpose of having such low access to an ARM chip like this... | 04:20 |
TechAspirer | #ifndef #define #endif | 04:20 |
TechAspirer | Or is that not valid? | 04:21 |
TechAspirer | And I think this is wrong https://github.com/im-tomu/tomu-quickstart/blob/master/miniblink/miniblink.c#L66 I'm prett | 04:21 |
tpb | Title: tomu-quickstart/miniblink.c at master · im-tomu/tomu-quickstart · GitHub (at github.com) | 04:21 |
TechAspirer | *pretty sure that when you use 5k, it's running every 3.3 seconds | 04:21 |
xobs | I'm sad micropython/elua/espurino are too large. I've thought about porting one of the BASIC interpreters... | 04:22 |
TechAspirer | Am I missing the point of the modulus or is the tick frequency too fast? | 04:22 |
xobs | My guess is the systick frequency is too fast. | 04:23 |
xobs | Or rather, not accurate. | 04:23 |
xobs | Tomu has no crystal, so it relies on PLLs that aren't very accurate. They'll be off by a few percent. Though probably not off by the 30% you're seeing... | 04:24 |
TechAspirer | It's running 14000 times per second, according to that AHB clock | 04:24 |
TechAspirer | Which your comment says is the core | 04:24 |
TechAspirer | 5.5/1.4 = 3.9 | 04:25 |
TechAspirer | *5/1.4 | 04:25 |
TechAspirer | *3.57 | 04:25 |
TechAspirer | So I could just be off 0.2 seconds on my stop watch | 04:25 |
xobs | 0.2 seconds sounds like it's more in line with PLL drift. | 04:26 |
xobs | So it might make more sense to increment a counter, and when it hits 14 then increment the milliseconds counter. | 04:27 |
TechAspirer | 714 tick frequency | 04:27 |
TechAspirer | Not 1k | 04:27 |
TechAspirer | 3.3 -> 4.7 | 04:28 |
TechAspirer | I'd just round to 700 tbh. I know the drift is random and both ways but 700 is neat and in my single measurements is closer to 5 | 04:28 |
TechAspirer | xobs: https://github.com/kayabaNerve/LTE/blob/master/include/tomu.h#L13 | 04:32 |
tpb | Title: LTE/tomu.h at master · kayabaNerve/LTE · GitHub (at github.com) | 04:32 |
TechAspirer | I'll start editing the quickstart repo now and submit a pull request, if you want | 04:33 |
TechAspirer | Miniblink 1000 to 700 and USB-HID 100 to 70. | 04:33 |
xobs | TechAspirer: What if you switch to using the USB clock? | 04:34 |
TechAspirer | I have no clue how to do that | 04:34 |
xobs | These two (three?) lines: https://github.com/im-tomu/tomu-quickstart/blob/master/opticspy/opticspy.c#L424 | 04:34 |
tpb | Title: tomu-quickstart/opticspy.c at master · im-tomu/tomu-quickstart · GitHub (at github.com) | 04:34 |
TechAspirer | Looking at it now | 04:35 |
xobs | I *think* it'll run systick at 24 MHz. | 04:35 |
TechAspirer | Does that require 419 and 420 though? | 04:36 |
TechAspirer | Because that should help a lot but I'm curious what side effects starting the whole USB stack does | 04:37 |
TechAspirer | Even though I'll probably do that at some point somewhere | 04:37 |
xobs | It shouldn't be necessary, but let me find my Tomu and do some investigation first. It may be possible to just ungate those clocks. | 04:38 |
TechAspirer | My Tomu thingy is red | 04:53 |
TechAspirer | Not flickering | 04:53 |
TechAspirer | So either this interrupted my code before it could turn the Red LED off as it turns green off first | 04:53 |
TechAspirer | Or Toboot is asking me why I murdered it | 04:53 |
TechAspirer | *interrupted and halted | 04:53 |
TechAspirer | RIP my almost twice as fast and more accurate clock speed | 05:01 |
xobs | This should do it: https://github.com/im-tomu/tomu-quickstart/blob/master/miniblink/miniblink.c#L89 | 05:08 |
tpb | Title: tomu-quickstart/miniblink.c at master · im-tomu/tomu-quickstart · GitHub (at github.com) | 05:08 |
xobs | It's probably waiting for the clock to tick, but it's not enabled, so it's just sitting there. | 05:09 |
xobs | It turns on the USB oscillator, waits for it to come ready, enables trim support, and then switches to using it. | 05:10 |
TechAspirer | Cool! Thanks xobs | 05:18 |
TechAspirer | Also, I have a compiled version of this which I compiled before, but for some reason my compiler isn't recognizing asm() | 05:19 |
TechAspirer | I did revert to your makefile to see if I messed it up | 05:19 |
TechAspirer | Still throwing an error | 05:19 |
TechAspirer | 4.9X seconds. Works great. | 05:23 |
TechAspirer | Fixed the asm issue | 05:26 |
TechAspirer | Only now have I learned the LEDs used inverted logic | 05:35 |
TechAspirer | I set them up, set them, cleared them, and then toggled them. Init, off, on, off. | 05:36 |
TechAspirer | Fixed... | 05:36 |
TechAspirer | xobs: Your serial ASM. Can I just nop 24 times? | 05:44 |
TechAspirer | Your ASM loops 1000 times over an ASM loop that does 4 instructions 6 times | 05:45 |
xobs | TechAspirer: For the sleep? | 05:46 |
TechAspirer | Yeah | 05:46 |
TechAspirer | Can't I just do a for loop 6000 times? | 05:46 |
TechAspirer | *7000 | 05:46 |
TechAspirer | That's the 1000 it had plus an extra 6000 in C | 05:46 |
TechAspirer | for (int i = 0; i < 24000; i++) | 05:47 |
TechAspirer | *7000, not 24000 | 05:47 |
xobs | You can try. I was having a lot of trouble fighting compiler optimizations, which is why I switched to the inline asm implementation. | 05:47 |
TechAspirer | How exact does it have to be? | 05:47 |
xobs | The cycle counts are at http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0432c/CHDCICDF.html and most instructions are 1 cycle. | 05:51 |
tpb | Title: ARM Information Center (at infocenter.arm.com) | 05:51 |
xobs | The udelay_busy() function was good enough to send serial data out an LED, which has somewhat tight timing requirements. | 05:52 |
TechAspirer | Oh. I don't care about the LED. | 05:55 |
TechAspirer | Just the serial | 05:55 |
xobs | USB serial, or are you attaching wires to Tomu's Tx and Rx pins? | 05:56 |
TechAspirer | Serial | 05:57 |
TechAspirer | USB | 05:57 |
TechAspirer | And I do know of your usb.h. Just looking over both | 05:58 |
xobs | USB serial timing really isn't super important. Baud rate doesn't matter when you're going PC <-> Tomu. Any baudrate works fine. | 05:59 |
TechAspirer | Got it. Thanks | 06:00 |
TechAspirer | So I can just remove the loop for USB? | 06:01 |
xobs | Which loop? | 06:01 |
TechAspirer | The sleep loop | 06:02 |
TechAspirer | The one we've been discussing. udelay_busy | 06:02 |
TechAspirer | Also, there's so much bloat in the USB protocol. | 06:03 |
xobs | Yes, you can remove that loop. | 06:03 |
xobs | The reason it's part of usb_puts() is due to buffer drain. | 06:03 |
xobs | usbd_ep_write_packet() copies the data to a USB buffer and returns immediately. The host will, at some point, request the data. | 06:04 |
xobs | Without that delay in there, you could write to the buffer twice and the first write would be dropped. | 06:04 |
xobs | The udelay_busy() is there to ensure the buffer has drained, as the host should be polling at ~1ms intervals. | 06:04 |
TechAspirer | So then I can't remove it? | 06:05 |
TechAspirer | I mean, I can delete all of this code | 06:05 |
xobs | It's there to enable doing things like 'printf("Hello, "); printf("world!");'. If you don't want to do that, it's safe to remove. | 06:08 |
TechAspirer | Got it | 06:09 |
xobs | A better solution would be to wait for the buffer to be drained... but I haven't looked into doing that. Patches welcome! | 06:09 |
TechAspirer | I hate USB | 06:27 |
TechAspirer | I used to not care | 06:27 |
TechAspirer | Then I started working on it | 06:27 |
*** k-man has quit IRC | 06:40 | |
*** k-man has joined #tomu | 06:51 | |
MadHacker | Morning. | 07:46 |
MadHacker | Are the various crowdsupply tomu's making it out, then? I had ordered parts for making my own as well as a CS order, but I've had neither PCBs back nor boards from CS. | 07:47 |
xobs | MadHacker: They've shipped! Most of them, I think. | 07:48 |
MadHacker | Alas, I've just logged in to my CS order, says "Currently expected to ship on Jul 31, 2018 | 07:48 |
MadHacker | Guess I'm in the back of the queue. | 07:48 |
MadHacker | It's a race to see which boards arrive first. :D | 07:49 |
xobs | Most of the 10-packs, at least. And half the 5-packs. CS is just churning through the units I sent there. | 07:50 |
MadHacker | I'm on a five-pack. I figured I'd like some "real" ones, but I'm more likely to DIY some stuff based on the same chip myself if I want more than that. | 07:51 |
MadHacker | Also I want to play with the cap touch stuff on the official PCBs so that if I come up with anything cool it's usable by other people. | 07:52 |
MadHacker | I'm very curious to see if I can get some gestures out of it, not just touch. | 07:52 |
xobs | I'm curious, too. It's using your suggestion with vias encaging the pads. | 07:56 |
MadHacker | Cool. It'll be good to play. | 07:56 |
MadHacker | The parallel-to-your-finger-ness of the vias should increase the detectable capacitance change. | 07:57 |
MadHacker | There are some more subtle tricks you can do when you have two cap touch pads and some expectation of overlap of the finger between; you can set up a three-plate capacitor which can be a bit more sensitive. | 07:58 |
MadHacker | + give ratio of coverage, not just touch/no touch. | 07:59 |
xobs | I really look forward to what you come up with. | 08:00 |
MadHacker | Looking forward to playing. | 08:00 |
xobs | Here's my current progress: https://github.com/im-tomu/tomu-quickstart/blob/master/captouch/main.c | 08:00 |
tpb | Title: tomu-quickstart/main.c at master · im-tomu/tomu-quickstart · GitHub (at github.com) | 08:00 |
MadHacker | Yep, I saw that already. Work at all? | 08:01 |
xobs | It uses the hardware timers for the two pads that support it, and charge/discharge for the other two pads. | 08:01 |
xobs | It kinda works. Sort of. It can detect touches, at least. But weirdly the two hardware-capable pads were behaving differently. | 08:01 |
MadHacker | Big frequency difference noticable on them? | 08:02 |
xobs | One was 800-1200, the other was 1-2 | 08:02 |
MadHacker | Wow. | 08:02 |
MadHacker | Sounds like a passive pull-up/pull-down left enabled on one? | 08:02 |
MadHacker | Something making it discharge a lot faster. | 08:03 |
MadHacker | Could check the impedance to ground and to the power rails with the board powered down, too - see if there's some static loading. | 08:04 |
TechAspirer | MadHacker: I got my 5 pack 2 days ago (after midnight now) | 08:06 |
TechAspirer | Really more like 1.5 | 08:06 |
TechAspirer | xobs: What's this usb_isr function? It isn't called by anything. Is it dead code that got shipped in or expected by the libopenmc3 library? | 08:08 |
xobs | TechAspirer: It's an Interrupt Service Routine. It's called by the hardware every time a USB event comes in. | 08:08 |
xobs | It's kind of a hardware callback. | 08:08 |
TechAspirer | Got it | 08:08 |
TechAspirer | Thanks | 08:09 |
xobs | MadHacker: The GPIO block on the EFM32 is so weird. There just isn't any pinmux. If you use a block, GPIO is disabled. | 08:16 |
MadHacker | The PICs (well, at least the earlier) have that with the ADCs, but not otherwise. It's quite irritating because they default active, so to turn a pin into a GPIO you need to issue a whole bunch of shutdown pokes to the various functions. | 08:18 |
MadHacker | You'd think everyone would make everything start up as generic GPIO w/ everything tristated by default, but that's a surprisingly uncommon configuration in my experience. | 08:19 |
TechAspirer | xobs: Changing the names of these USB strings stops the Serial from even working... Weird | 08:56 |
TechAspirer | I tried, "Tomu", "Tomu 2", "Tomu 3". Crash | 08:56 |
TechAspirer | I tried just "Tomu", changing 3 to 1. Crash. | 08:57 |
xobs | TechAspirer: Which project are you lookingat? usb-cdcacm? | 09:01 |
TechAspirer | usb.h | 09:11 |
TechAspirer | Or usb-cdcacm | 09:11 |
TechAspirer | Pick either | 09:11 |
xobs | TechAspirer: Ah, I have a feeling I know what's going on. It's probably alignment, caused by compiling with -Os. I bet it tries to copy data using 32-bit ints, which gives a 4x speedup. | 09:15 |
xobs | Do you have arm-none-eabi-gdb installed? | 09:15 |
TechAspirer | No idea | 09:18 |
MadHacker | Could try using a name that's a multiple of four long. :) | 09:18 |
xobs | That's true. Does "TomuTomu" work? | 09:18 |
MadHacker | Tomu 001, even make it sound like it's *supposed* to have placeholder digits. :D | 09:19 |
TechAspirer | I was going to just remove -Os | 09:21 |
TechAspirer | Oh. BTW. Suggested edit to the core mainfile: -specs=nano.specs -specs=nosys.specs | 09:22 |
TechAspirer | Clears up _sbrk errors | 09:22 |
TechAspirer | Doesn't break anything so far. | 09:22 |
MadHacker | xobs: On the subject of the quickstart, on Windows I get "make: copy: Command not found", presumably because copy isn't a command that make can run, it's a cmd.exe builtin. | 09:22 |
MadHacker | Probably could subsitute xcopy which has an actual .exe | 09:22 |
TechAspirer | I'm not making a pull request because I don't know the full effects of it | 09:22 |
TechAspirer | Just suggesting it | 09:23 |
TechAspirer | xobs: I don't get that | 09:23 |
TechAspirer | *MadHacker | 09:23 |
TechAspirer | Did you get GNU Make from SourceForge? | 09:23 |
MadHacker | Literally grabbed the links given on the quickstart page. This is on Windows BTW. | 09:23 |
MadHacker | It's possible I have another copy of make here, of course. | 09:23 |
MadHacker | Anyway, just swapped in xcopy instead, and that works fine. | 09:23 |
xobs | MadHacker: I'll do that replacement. "copy" works for me, but xcopy should work too. | 09:24 |
TechAspirer | const char* usb_strings[] = { "Tomu", "TomuTomu", "TomuTomuTomu", }; | 09:27 |
TechAspirer | Multiples of 4 failed | 09:27 |
TechAspirer | RIP | 09:27 |
MadHacker | xobs: "cmd /c copy" works better than xcopy actually, avoids a prompt for file/dir when the file isn't already there. | 09:30 |
MadHacker | Sorry for spotting that a bit late. | 09:30 |
xobs | MadHacker: I was just debugging that. Placing a * at the end of the name works too. | 09:30 |
MadHacker | cmd /c copy is a bit crude, but less reliant on anything undocumented. | 09:31 |
TechAspirer | Just tried const char* usb_strings[] = { "aaaa", "zzzzzzzzzzzzzzzzzzzz", "bbbbbbbb", }; | 09:42 |
TechAspirer | Exact same length as the strings, in the same length order, with no strings starting the same | 09:43 |
TechAspirer | (I was thinking if you have one thing named "Tomu", having another named "TomuAppendix" may throw an error) | 09:43 |
TechAspirer | Also trued keeping the name Tomu | 09:44 |
xobs | Alright, sorry I need to rush out for the day. That's a strange issue, and I really wonder what could be causing it. | 09:53 |
TechAspirer | All good | 09:53 |
TechAspirer | Cya | 09:53 |
TechAspirer | Minus the naming issue, I finished my Serial library | 10:15 |
TechAspirer | https://github.com/kayabaNerve/LTE/blob/master/samples/fruitGuesser/main.c | 10:38 |
tpb | Title: LTE/main.c at master · kayabaNerve/LTE · GitHub (at github.com) | 10:38 |
TechAspirer | xobs: Is this the first game played on a Tobu? | 10:38 |
TechAspirer | Uses my Tomu header, Serial header (the whole point), and LED header for good measure | 10:38 |
TechAspirer | Only read the source if you want to know the answer to the Tomu's favorite fruit. Putty with 19200 baud is how you play ;) | 10:39 |
*** k-man has quit IRC | 10:58 | |
*** k-man has joined #tomu | 11:06 | |
*** k-man has quit IRC | 12:56 | |
*** k-man has joined #tomu | 13:06 | |
xobs | TechAspirer: As far as I know it is! | 13:28 |
MadHacker | Two tomus would be enough for a reasonable Simon game... | 13:43 |
MadHacker | No inter-tomu communications though. Hm. | 13:43 |
MadHacker | Ah well. Maybe w/ gestures. | 13:43 |
*** k-man has quit IRC | 14:02 | |
*** akent has joined #tomu | 14:03 | |
*** k-man has joined #tomu | 14:06 | |
*** akent has left #tomu | 14:40 | |
*** k-man has quit IRC | 14:54 | |
*** k-man has joined #tomu | 15:06 | |
*** k-man has quit IRC | 15:56 | |
*** k-man has joined #tomu | 16:06 | |
*** NoGodDamnIdea has joined #tomu | 18:05 | |
*** im-tomu has left #tomu | 19:04 | |
*** im-tomu has joined #tomu | 19:04 | |
*** im-tomu has left #tomu | 19:09 | |
*** im-tomu has joined #tomu | 19:09 | |
TechAspirer | MadHackers: Build a Serial proxy app on your laptop | 20:09 |
TechAspirer | Or connect the TX/RX lines | 20:23 |
*** NoGodDamnIdea has quit IRC | 22:43 | |
TechAspirer | xobs: do you know if the rand() seed is iterated over by time since Toboot exited or if it's calls to rand()? | 23:05 |
TechAspirer | I'm guessing it's the second. I ran the same program and twice and got 4, with an instable clock (no crystal) | 23:05 |
TechAspirer | So even if I iterate in a for loop 1k times, it doesn't matter. Right? | 23:06 |
TechAspirer | *1000 times just to call nop. | 23:06 |
TechAspirer | Though since the clock is instable, I could use srand based on the miliseconds... | 23:11 |
TechAspirer | Or no because that's based off cycles and the cycles to execute the program is constant | 23:12 |
TechAspirer | So I guess I'd hook one of these up to GPIO http://holdenc.altervista.org/avalanche/ | 23:15 |
tpb | Title: Random Sequence Generator based on Avalanche Noise (at holdenc.altervista.org) | 23:15 |
TechAspirer | Also, how do you expose the GPIO if it's in the USB port? Half port length USB cable? | 23:16 |
TechAspirer | I'd buy a Tomu USB cable that exposed a couple GPIO/TX/RX and had a switch so I'm not unplugging constantly | 23:16 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!