<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-07-03 19:09 GMT+02:00 Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><div class="gmail-h5"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 3, 2017 11:49 AM, "Denis Obrezkov" <<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail-m_-9103825825228636284quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail-m_-9103825825228636284elided-text"><div class="gmail_quote">2017-07-03 7:43 GMT+02:00 Hesham Almatary <span dir="ltr"><<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_-9103825825228636284m_-1985034188784929915gmail-">On Mon, Jul 3, 2017 at 3:36 PM, Denis Obrezkov <<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>> wrote:<br>
> 2017-07-03 4:59 GMT+02:00 Hesham Almatary <<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>>:<br>
>><br>
>> You can have a look at riscv-pk [1] as a RISC-V reference how to<br>
>> handle interrupts. RTEMS-wise, you can look at or1k and ARM code and<br>
>> how the platform-dependent interrupt handling code is linked to<br>
>> platform-independent one.<br>
>><br>
>> mcause value can be used as an index to a software vector table that you<br>
>> set up.<br>
>><br>
>> Why do you need software interrupts? GSoC-wise, I thought the plan was<br>
>> to develop UART/Console driver (which doesn't need interrupts), and<br>
>> use simulated ticker, as a first step. Then it will be easier to<br>
>> debug/proceed from there with interrupt handling code.<br>
><br>
> I thought, I have to implement an interrupt console driver. Okay, then I am<br>
> going to<br>
> investigate a simulated ticker.<br>
</span>Yeah that can be done in later stages, for optimisation purposes. But<br>
I think it's easier to implement it in polling mode first, just to get<br>
things working, then you can easily move to interrupt-based<br>
implementation. For example, if you've a polling console driver, you<br>
can debug using printk, when developing the clock driver. Once you get<br>
the clock driver working, you will have a more mature code for<br>
interrupt handling, which enables you to very easily implement<br>
interrupt-based UART driver.<br>
<div class="gmail-m_-9103825825228636284m_-1985034188784929915gmail-HOEnZb"><div class="gmail-m_-9103825825228636284m_-1985034188784929915gmail-h5">> --<br>
> Regards, Denis Obrezkov<br>
<br>
<br>
<br>
--<br>
Hesham<br>
</div></div></blockquote></div><br></div>It seems that vectored interrupts aren't available in FE310 SoC. </div><div class="gmail_extra">Thus, I will work with mcause register.</div><div class="gmail_extra">As for now, I want to:</div><div class="gmail_extra">* add local interrupt handlers</div><div class="gmail_extra">* add init code for counters initializtion (since we want to set up a baudrate)</div><div class="gmail_extra">* implement a dummy clock driver</div></div></blockquote></div></div></div><div dir="auto"><br></div></div></div><div dir="auto">This is easy and just requires one line in the BSP Makefile.am and an include in the .tcfg file to skip tests known to fail. See either the shsim or v850sim BSPs based on gdb for examples.</div><div dir="auto"><br></div><div dir="auto">It also lets you have all the tests running so you can add your target to RTEMS tester. :)</div><span class="gmail-"><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_-9103825825228636284quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra">* implement a polling uart</div></div></blockquote></div></div></div><div dir="auto"><br></div></span><div dir="auto">Personally I would do this as soon as possible and get printk working. Very helpful and needed to run the tests with simulated clock tick with the polled driver.</div><div dir="auto"><br></div><div dir="auto">The counter is only needed for math on the baud rate I would guess.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_-9103825825228636284quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><div dir="ltr"><div class="gmail_extra">* figure out how interrupts are handled in RTEMS</div><div class="gmail_extra">* implement global interrupt handlers</div><div class="gmail_extra">* implement a clock driver</div><div class="gmail_extra">* implement an interrupt-mode uart driver.</div><font color="#888888"><div class="gmail_extra"><br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail-m_-9103825825228636284m_-1985034188784929915gmail_signature">Regards, Denis Obrezkov</div>
</div></font></div>
<br></span>______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/devel</a><br></blockquote></div><br></div></div></div>
</blockquote></div>Ok, I will try to make a uart driver as soon as possible.</div><div class="gmail_extra">I had some issues with dummy_clockdriver, I think there was a mistake, </div><div class="gmail_extra">that an address of clock initialization function was wrong, so, I will</div><div class="gmail_extra">investigate it tomorrow.</div><div class="gmail_extra">Also, I have a problem, as I mentioned earlier, that the minimum example</div><div class="gmail_extra">finished with the error ''<span style="color:rgb(0,0,0);font-family:Verdana,Arial,"Bitstream Vera Sans",Helvetica,sans-serif;font-size:13px">INTERNAL_ERROR_THREAD_EXITTED".</span><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Regards, Denis Obrezkov</div>
</div></div>