Saturday, 2018-01-20

*** tpb has joined #tomu00:00
*** sergei-gl has quit IRC04:16
*** sergei-gl has joined #tomu04:19
*** nrossi has joined #tomu06:48
xobsWell, I've got the basics of a USB DFU bootloader going.  Though I'm missing something on how webusb works.12:19
xobsI'll post this to the mailing list, but the gist is that now I've got a DFU bootloader working that is 4260 bytes, and with some love could probably be golfed down to below 4kB.  Anyone feel like working on that? :)12:21
xobsIt will enter the bootloader if (1) a boot fails 3x in a row, (2) the application loaded doesn't have a valid stack pointer or start address, (3) if a magic value is present in RAM, or (4) if a user shorts out the two outer pins during boot.12:23
kyaputenxobs: how do you determine that a boot "fails" ?12:47
kyaputen(and congrats :) )12:47
xobskyaputen: It sets the watchdog timer and increments a counter.  Each time it checks the counter to see if it's >= 3.12:50
xobsSo if the first thing your program does is clear the counter, but you don't disable the watchdog, you're going to have a bad time.12:51
kyaputenI see, so each program has to clear the watchdog12:55
xobsClear the watchdog and reset the boot counter.12:55
kyaputenMaybe it can be done by a __startup or some other function. So the app developer doesn't have to do it manually12:56
xobsThat would be a good idea to put something like that in the samples directory.12:56
kyaputenas soon I have a sample, I'll try it12:57
xobsThe load offset is now 0x2000 rather than 0x4000, and I'd like to get it down to 0x1000 eventually.  So the linker scripts will have to change.12:57
xobsBut hey, Tomu programs now can be 8 kilobytes larger than before!12:58
kyaputen8Kb you can put quite a lot of stuff13:27
xobsI should see if this can be loaded using the serial bootloader.13:29
kyaputenoh I see you tried the gcc port, thx13:33
kyaputenunfortunately I did it blind so I expected it wouldn't work on first try :)13:34
kyaputenhow are you able to debug  it ?13:34
xobsI'm cheating a bit because I have the factory test jig, which makes it easy to swap out parts.  But before I got this, I soldered SWD and SWC to some magnet wire and threaded out the little hole.13:37
xobsThen you run those to pin 22 and 23 of a raspberry pi with a build of openocd that was built with --enable-bcm283513:38
xobsThen run openocd with "/usr/local/bin/openocd -f interface/raspberrypi2-native.cfg -c transport select swd -c set CHIPNAME efm32hg309 -f target/efm32.cfg -c reset_config none -c init -c reset halt"13:39
xobsFinally, on my desktop I run "gdb -ex 'target remote xobs-swd.local:3333 an0042.elf".13:39
xobsI build locally, then reflash with "load".  Reset it with "mon reset halt", continue with "c", break with Ctrl-C.13:40
xobsBreakpoints work, single-stepping works, watchpoints work...13:40
kyaputenI see...13:51
kyaputenI wonder if that would also work with a Black Magic Probe13:52
xobsI believe it will, since they give you a gdbserver.  Assuming it supports the EFM32.13:53
kyaputenYeah I guess it should, since it's a Cortex M0
tpbTitle: Frequently Asked Questions · blacksphere/blackmagic Wiki · GitHub (at
kyaputenI happen to have a bluepill flashed as a BMP. Works quite well debugging another bluepill. So I'll also give it a try.13:54
xobsThe thing that might not work is reflashing it, because it needs to know about the EFM32.13:57
xobsAlright, I need to run for the evening.13:58
kyaputenthx for the info!14:00
*** sergei-gl has quit IRC16:49
*** sergei-gl has joined #tomu16:50
*** nrossi has quit IRC19:07
*** Deltadk has joined #tomu21:47
*** NoGodDamnIdea has joined #tomu22:04
*** TheShaun[m] has quit IRC22:08
*** OnkelUlla has quit IRC22:08
*** mithro has quit IRC22:08
*** iinaj has quit IRC22:08
*** jimmo has quit IRC22:08
*** OnkelUlla has joined #tomu22:08
*** mithro has joined #tomu22:09
*** iinaj has joined #tomu22:09
*** jimmo has joined #tomu22:09
*** TheShaun[m] has joined #tomu22:11
*** ccase has joined #tomu22:15
*** NoGodDamnIdea has quit IRC22:17
*** matthegap[m] has quit IRC23:03
*** NoGodDamnIdea has joined #tomu23:05
*** matthegap[m] has joined #tomu23:08

Generated by 2.13.1 by Marius Gedminas - find it at!