*** tpb has joined #tomu | 00:00 | |
*** sergei-gl has quit IRC | 04:16 | |
*** sergei-gl has joined #tomu | 04:19 | |
*** nrossi has joined #tomu | 06:48 | |
xobs | Well, I've got the basics of a USB DFU bootloader going. Though I'm missing something on how webusb works. | 12:19 |
---|---|---|
xobs | I'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 |
xobs | It 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 |
kyaputen | xobs: how do you determine that a boot "fails" ? | 12:47 |
kyaputen | (and congrats :) ) | 12:47 |
xobs | kyaputen: It sets the watchdog timer and increments a counter. Each time it checks the counter to see if it's >= 3. | 12:50 |
xobs | So 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 |
kyaputen | I see, so each program has to clear the watchdog | 12:55 |
xobs | Clear the watchdog and reset the boot counter. | 12:55 |
kyaputen | Maybe it can be done by a __startup or some other function. So the app developer doesn't have to do it manually | 12:56 |
xobs | That would be a good idea to put something like that in the samples directory. | 12:56 |
kyaputen | :-) | 12:57 |
kyaputen | as soon I have a sample, I'll try it | 12:57 |
xobs | The 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 |
xobs | But hey, Tomu programs now can be 8 kilobytes larger than before! | 12:58 |
kyaputen | nice | 13:27 |
kyaputen | 8Kb you can put quite a lot of stuff | 13:27 |
xobs | I should see if this can be loaded using the serial bootloader. | 13:29 |
kyaputen | oh I see you tried the gcc port, thx | 13:33 |
kyaputen | unfortunately I did it blind so I expected it wouldn't work on first try :) | 13:34 |
kyaputen | how are you able to debug it ? | 13:34 |
xobs | I'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 |
xobs | Then you run those to pin 22 and 23 of a raspberry pi with a build of openocd that was built with --enable-bcm2835 | 13:38 |
xobs | Then 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 |
xobs | Finally, on my desktop I run "gdb -ex 'target remote xobs-swd.local:3333 an0042.elf". | 13:39 |
xobs | I build locally, then reflash with "load". Reset it with "mon reset halt", continue with "c", break with Ctrl-C. | 13:40 |
xobs | Breakpoints work, single-stepping works, watchpoints work... | 13:40 |
kyaputen | I see... | 13:51 |
kyaputen | I wonder if that would also work with a Black Magic Probe | 13:52 |
xobs | I believe it will, since they give you a gdbserver. Assuming it supports the EFM32. | 13:53 |
kyaputen | Yeah I guess it should, since it's a Cortex M0 https://github.com/blacksphere/blackmagic/wiki/Frequently-Asked-Questions | 13:54 |
tpb | Title: Frequently Asked Questions · blacksphere/blackmagic Wiki · GitHub (at github.com) | 13:54 |
kyaputen | I 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 |
xobs | The thing that might not work is reflashing it, because it needs to know about the EFM32. | 13:57 |
xobs | Alright, I need to run for the evening. | 13:58 |
kyaputen | thx for the info! | 14:00 |
*** sergei-gl has quit IRC | 16:49 | |
*** sergei-gl has joined #tomu | 16:50 | |
*** nrossi has quit IRC | 19:07 | |
*** Deltadk has joined #tomu | 21:47 | |
*** NoGodDamnIdea has joined #tomu | 22:04 | |
*** TheShaun[m] has quit IRC | 22:08 | |
*** OnkelUlla has quit IRC | 22:08 | |
*** mithro has quit IRC | 22:08 | |
*** iinaj has quit IRC | 22:08 | |
*** jimmo has quit IRC | 22:08 | |
*** OnkelUlla has joined #tomu | 22:08 | |
*** mithro has joined #tomu | 22:09 | |
*** iinaj has joined #tomu | 22:09 | |
*** jimmo has joined #tomu | 22:09 | |
*** TheShaun[m] has joined #tomu | 22:11 | |
*** ccase has joined #tomu | 22:15 | |
*** NoGodDamnIdea has quit IRC | 22:17 | |
*** matthegap[m] has quit IRC | 23:03 | |
*** NoGodDamnIdea has joined #tomu | 23:05 | |
*** matthegap[m] has joined #tomu | 23:08 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!