Limpkin's blog - The Beast: Who Needs an OS Anyways? - Comments<div>An electronics geek blog, dedicated to sharing and open source. Check out my stores: <a href="https://lectronz.com/stores/stephanelec" hreflang="en" title="Lectronz store">EU</a> / <a href="https://www.tindie.com/stores/stephanelec" hreflang="en" title="tindie store">EU & US</a>.</div>2024-03-29T00:41:47+00:00Mathieuurn:md5:51de6a3d917257edeff5a252fe925b02DotclearThe Beast: Who Needs an OS Anyways? - Windsor Schmidturn:md5:1abeef51d97aacece4b138576f18e39f2014-09-30T19:20:08+02:002014-10-03T22:40:54+02:00Windsor Schmidt<p>Really excellent project!</p>The Beast: Who Needs an OS Anyways? - unsigned32urn:md5:534332a37f360742c153b172d3a18ae62014-05-14T21:32:45+02:002014-05-15T09:48:00+02:00unsigned32<p>Holy smokes you accomplished a lot, congratulations.<br />
I agree with you with the bare-metal approach, it really let's you do real-time, deterministic stuff.<br />
That whole ASF is probably the most bizarre code I've laid eyes on. It'd be better if they made separate, categorized drivers. i.e SDcard_spi and SDcard_mmc etc, instead of all the #ifdef madness.<br />
And how about those ATPASTE2(driver, _init) and Assert() contraptions, they have to be kidding.<br />
I'm writing my own simplified drivers.</p>The Beast: Who Needs an OS Anyways? - limpkinurn:md5:94448a4780b8ba08fbbc0ae36ed393512013-12-28T12:06:16+01:002013-12-28T12:10:16+01:00limpkin<p>@<a href="https://www.limpkin.fr/index.php?post/2013/11/07/The-Beast%3A-who-needs-an-OS-anyways#c1748" rel="ugc nofollow">Rémy</a> : I think I considered it, but as my schedule was tight I preferred the platform having the most libraries. Good luck in your adventure ;-)</p>The Beast: Who Needs an OS Anyways? - Rémyurn:md5:ce6bb478d7614917c79d07eaf35c47ae2013-12-28T11:16:24+01:002013-12-28T12:10:16+01:00Rémy<p>I was hoping for a lot of callbacks like cable connected, cable disconnected, packet receive, packet sent, checksum error etc... But definitely it's good to not have to write such driver from scratch !<br />
For simpler things, yes, I'll continue to write my own code. Better to optimize, easier to maintain etc.<br />
I have one more question Limpkin : did you ever consider using this CPU (STM32F405/407xx from ST) instead of the SAM4E ?</p>
<p>Thank you for your comments, and continue to work on such cool projects !</p>The Beast: Who Needs an OS Anyways? - limpkinurn:md5:81244ba3e2148e45c589be3a9234da0b2013-12-28T02:04:41+01:002013-12-28T02:11:13+01:00limpkin<p>@<a href="https://www.limpkin.fr/index.php?post/2013/11/07/The-Beast%3A-who-needs-an-OS-anyways#c1746" rel="ugc nofollow">Rémy</a> : Yep... someone should definitely rewrite the Ethernet library. On the example they provide, it waits for an eternity if no Ethernet cable is connected. No callbacks, nothing :/. Well, ASF is an unavoidable tool when it comes to complex things like USB/ETH as it'd take you many hours writing your own library. For simpler things, better write your own code :).</p>
<p>Good luck!</p>The Beast: Who Needs an OS Anyways? - Rémyurn:md5:e0871cc03b752b688f011bb08c6c4a862013-12-28T00:18:43+01:002013-12-28T02:11:14+01:00Rémy<p>For sure it's not easy to read !<br />
Maybe I criticized ASF too much. Yes they use interruption, but not always. For example in the Ethernet driver, they use a "gmac_wait_phy" function that poll up to 1 million time a bit to know if an operation completed... In the usart driver, they don't use DMA etc.<br />
I thought ASF was performance-optimized but to me it seems a good library to learn and write your own. Maybe I was expecting too much...<br />
Thank you for your advise. I'll definitely use the PDC</p>The Beast: Who Needs an OS Anyways? - limpkinurn:md5:0703d8ea168e9968620f422cf8b727e42013-12-27T23:40:21+01:002013-12-27T23:49:47+01:00limpkin<p>@<a href="https://www.limpkin.fr/index.php?post/2013/11/07/The-Beast%3A-who-needs-an-OS-anyways#c1744" rel="ugc nofollow">Rémy</a> : Hey Rémy,</p>
<p>Thanks! I just mentioned it was not particularly easy to read ;). I only took a deep look at the USB stack, and at the time I gathered it was making a good use of interrupts. I haven't looked at nand/eth, but I'd indeed advise you to use the PDC for the USART/ADC... it's not that complicated! Have a look at the code I put on my website.</p>
<p>Let me know if you have any other question </p>The Beast: Who Needs an OS Anyways? - Rémyurn:md5:6f30a9940d4eb6178e553c60b30389122013-12-27T23:21:24+01:002013-12-27T23:49:47+01:00Rémy<p>Nice project !<br />
You said that you don't particularly like ASF.<br />
Storken said that it makes reusabillity of code much simpler. I agree.<br />
But I was looking for some drivers for the SAM4E (nand flash, Ethernet, usart, adc, etc) and I saw that they are intensively using polling ! I chose this CPU for my new project that need to be also low power (so I don't want to be running in full power only to poll for some events). I was planning to modify all ASF drivers to use interruption and DMA but this seems a lot of work. Did you already did this kind of changes ? If so, what do you think ?</p>
<p>PS: I will use FreeRTOS for the task management.</p>The Beast: Who Needs an OS Anyways? - limpkinurn:md5:c6c13a8d10a780d3192761eae924d3c32013-11-07T11:52:21+01:002013-11-07T11:58:56+01:00limpkin<p>@<a href="https://www.limpkin.fr/index.php?post/2013/11/07/The-Beast%3A-who-needs-an-OS-anyways#c1653" rel="ugc nofollow">Storken</a> : Thanks a lot! I needed good decoupling with all these power consuming motors/leds/fans... To be honest I don't think the fundraiser will be successful... I just wanted to offer the possibility in case people were interested. Code reusability is indeed very nice! I ported the code I made for this platform to the sam3x microcontroller for the easy-phi project in less than 5 minutes :-)</p>The Beast: Who Needs an OS Anyways? - Storkenurn:md5:f0d84ad7590e6e6143b18b3c0c90b58a2013-11-07T11:42:26+01:002013-11-07T11:58:57+01:00Storken<p>Well thougth out design and nice layout. You did go crazy with the tantalum tho.</p>
<p>Good luck with your fundraiser. I think ASF is too new for most people, but I enjoy using it. It definitely makes reusabillity of code much simpler.</p>