tomu-quickstart icon indicating copy to clipboard operation
tomu-quickstart copied to clipboard

quickstart documentation should contain links on the programming API

Open marcmerlin opened this issue 3 years ago • 6 comments

Hi @mithro. Ok, so I flashed ledpulse, it works (after reflashing the bootloader and rescuing tomus that wouldn't flash).

I then spent hours looking at it, doing my own example with much trial and error as I can't find any documentation for the APIs used, and all I know how to debug with is whether the LED turned on or off, and I can't even seem to change it with set or clear, but only with gpio_toggle. Sure, there is a libopencm3/include/libopencm3/efm32/common/gpio_common.h which isn't much of an API.

I'm totally shooting in the dark, it's not fun. Could write documentation that gives more info on what to do next, written for someone who only knows arduino style programming? (a reasonable target I assume).

After some searching, and figuring out what chip I had, I found http://libopencm3.org/docs/latest/efm32g/html/modules.html but that doesn't quickly show me how to use gpio_set vs toggle
None of the examples in https://github.com/libopencm3/libopencm3-examples/tree/master/examples seem to be for this chip.

Similarly, outside of LED debugging, there is obviously no Serial.print debugging. Can you give more details on how to setup an emulator and do proper debugging given that using the target for that, is an exercise in frustration?
Thanks

marcmerlin avatar Dec 31 '20 14:12 marcmerlin

Does https://github.com/im-tomu/tomu-samples help?

mithro avatar Dec 31 '20 23:12 mithro

There is also some stuff at https://github.com/im-tomu/toboot

mithro avatar Dec 31 '20 23:12 mithro

It has been a long time since I've even thought about the Tomu (as opposed to the Fomu). I don't think we ever had anything like the Fomu workshop for the Tomu?

mithro avatar Dec 31 '20 23:12 mithro

Yeah, I know I'm late to the party, sorry @mithro , I'll do Fomu next. I did use the samples, but it took me forever to modify one (send a PR https://github.com/im-tomu/tomu-quickstart/pull/107 which took me hours to write with lack of debugging or having any clue to use some of the API functions).

I was hoping to find how to register a touch, to affect the LEDs, but didn't find anything in the examples. Of course, an API with all the IO ports, and functions to access them properly, would help. I'm fine with arduino, but I feel like a total noob here :)

marcmerlin avatar Jan 01 '21 00:01 marcmerlin

The Tomu was never really targetted as "easy to use", it was always more targetted at "doing things like this is possible" space. That did start to shift as more precanned examples existed but was always limited by the inability to run things like MicroPython.

This does make me realise how powerful things like the gdb over USB wishbone stuff that we have on the Fomu potentially are.

With something like the Tomu, the first step is to get USB serial working so you can do printf style debugging. Or you solder a DAPlink style probe to your hardware...

I'm wondering if you could do a preprovided "operating system" with syscall for the USB / printf style stuff.

mithro avatar Jan 02 '21 16:01 mithro

@mithro Fair enough, I see I mostly wasted my time trying to use tomu when effectively it's mostly dead now that fomu is out (which I understand). Mmmh, well, given that I spent the time already, in case there are still people out there who might try to use tomus, are you ok merging the doc updates I wrote for you? https://github.com/im-tomu/tomu-quickstart/pull/105

For programming, I didn't get very far (didn't find an easy way to query the touch sensors), but I wrote an improved LED example if you're ok merging it: https://github.com/im-tomu/tomu-quickstart/pull/107

marcmerlin avatar Jan 03 '21 11:01 marcmerlin