<div dir="ltr">Thanks a lot.<br>I already started trying to make the example-led work, I'm not quick, but that's a good learning exercise :)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 22, 2015 at 10:18 PM, NIIBE Yutaka <span dir="ltr"><<a href="mailto:gniibe@fsij.org" target="_blank">gniibe@fsij.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/22/2015 10:33 AM, NIIBE Yutaka wrote:<br>
> Yes, I think so.   Basically, we need three things.<br>
><br>
>  (1) Porting board specific things: clock, LED, etc.<br>
>      This part would be easy, when you have a specification.<br>
><br>
>  (2) Porting Chopstx (the thread library) to Cortex-M4.<br>
>      This part would not be that hard, as you describe.<br>
><br>
>  (3) Porting MCU specific things: USB controller and ADC converter<br>
>      drivers.<br>
>      This part takes time to understand the MCU.<br>
<br>
</span>Kaz Kojima kindly (re-)introduced the port for STM32 Primer2.  I think<br>
that this is a good opportunity to explain the porting effort.<br>
<br>
I think that the steps would be:<br>
<br>
(1) The first target is chopstx/example-led, which blinks LED<br>
    periodically.<br>
<br>
    (1-1) You need a board definition under chopstx/board/,<br>
          copying from similar one.<br>
<br>
          Basically, there are three variants, currently:<br>
          STM32F0, smaller STM32F103 (with flash ROM size 1024)<br>
          and medium STM32F103 (with flash ROM size 2048 and more GPIO)<br>
<br>
    (1-2) You might need to modify chopstx/clk_gpio_init.c.<br>
<br>
          This is an implementation of clock setting and GPIO<br>
          initialization.<br>
<br>
    (1-3) You might need to modify chopstx/entry.c.<br>
<br>
          If exception/interrupt model is different, you need to<br>
          modify this, too.<br>
<br>
    (1-4) Then, try chopstx/example-led/.<br>
<br>
          chopstx/example-led/sys.c include system service routines<br>
          for LED, flash ROM access, and USB initialization.<br>
<br>
          You can just ignore things for flash ROM access and USB<br>
          initialization and just implement the set_led function<br>
          with corresponding board definition.<br>
<br>
    (1-5) If it works, great.  If not, you need to port<br>
          chopstx/chopstx.c, the thread implementation.<br>
<br>
(2) Next is porting chopstx/example-cdc/usb_stm32f103.c, the<br>
    USB driver.<br>
<br>
(3) Then, try NeuG standalone device by porting<br>
    neug/src/adc_stm32f103.c (the ADC driver).<br>
<br>
(4) When (1)..(3) is going well, Gnuk is mostly ready for you.<br>
    I think that it's only modifying the help message in<br>
    gnuk/src/configure and possibly the Makefile.<br>
<div class="HOEnZb"><div class="h5">--<br>
<br>
_______________________________________________<br>
gnuk-users mailing list<br>
<a href="mailto:gnuk-users@lists.alioth.debian.org">gnuk-users@lists.alioth.debian.org</a><br>
<a href="https://lists.alioth.debian.org/mailman/listinfo/gnuk-users" rel="noreferrer" target="_blank">https://lists.alioth.debian.org/mailman/listinfo/gnuk-users</a><br>
</div></div></blockquote></div><br></div>