FreeRTOS and newlib - comments requested

Started by Dave Nadler June 27, 2017
I'd appreciate any comments from those of you who have
used (or tried to use) this combo, especially if I've
gotten anything wrong or missed anything...
http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html

Thanks in advance,
Best Regards, Dave
Il giorno martedì 27 giugno 2017 16:22:43 UTC+2, Dave Nadler ha scritto:
> I'd appreciate any comments from those of you who have > used (or tried to use) this combo, especially if I've > gotten anything wrong or missed anything... > http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html > > Thanks in advance, > Best Regards, Dave
Thanks very interesting, good to know, I'm (I hope) starting a new project in a near future and was thinking on using a Kinetis and FreeRTOS. The only thing I can add is that KDS examples are in general not very useful (they don't explain much and often badly coded). And also the KSDK is not bug free (at least until version 2.x, don't know about v3), it seems they didn't test it properly. Bye Jack
 > The only thing I can add is that KDS examples are in general not very useful
(they don't explain much and often badly coded).
> And also the KSDK is not bug free (at least until version 2.x, don't know about
v3), it seems they didn't test it properly. I never use SDKs, just because of those things enumerated above. I usually have the SDKs at hand, to look into when the manuals are not very clear. Every manufacturer seems to want to have one, probably because this is the trend, but in fact it's more hurt than help. You really cannot rely on the SDK only, without reading the manuals. Because the documentation of the SDK is very poor, partly because it would double the effort for the manufacturer. So, what shall you study? the SDK or the manual? Usually you need both. And the coding is most of the time a nightmare. I remember when I tried using a SDK for a new microcontroller (to me). It was almost impossible to write a "some_long_identifier = some_other_long_identifier;" on a single line :) And if you have to write this kind of code: some_long_register_name = SOME_LONG_BIT_DEFINITION | SOME_OTHER_LONG_BIT_DEFINITION | SOME_YET_ANOTHER_LONG_BIT_DEFINITION; You must use a single identifier on a line :) Not to say about function calls with multiple arguments... You just can't type anymore. Editing code is only a series of copy/paste.
On Wednesday, June 28, 2017 at 2:41:10 AM UTC-4, Jack wrote:
> Il giorno martedì 27 giugno 2017 16:22:43 UTC+2, Dave Nadler ha scritto: > > I'd appreciate any comments from those of you who have > > used (or tried to use) this combo, especially if I've > > gotten anything wrong or missed anything... > > http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html > > > > Thanks in advance, > > Best Regards, Dave > > Thanks very interesting, good to know, I'm (I hope) starting a new > project in a near future and was thinking on using a Kinetis and FreeRTOS.
The K64 has been a good part, one shipping product and starting a 2nd, however...
> The only thing I can add is that KDS examples are in general not very > useful (they don't explain much and often badly coded). > And also the KSDK is not bug free (at least until version 2.x, > don't know about v3), it seems they didn't test it properly.
The SDK is extremely buggy, and SDK behavior and interface unstable across versions. For half the peripherals I had to write my own drivers. The examples are typically not set up properly (see the link above). And the Freescale 'support' is the worst I have ever encountered. Note this is for Kinetis series; iMX may be much better. Hopefully NXP will clean house as they integrate Freescale. I had great experiences with NXP on a few former LPCxxx projects. We'll see...
On 6/27/2017 11:41 PM, Jack wrote:
> Il giorno martedì 27 giugno 2017 16:22:43 UTC+2, Dave Nadler ha scritto: >> I'd appreciate any comments from those of you who have used (or tried to >> use) this combo, especially if I've gotten anything wrong or missed >> anything... http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html >> >> Thanks in advance, Best Regards, Dave > > Thanks very interesting, good to know, I'm (I hope) starting a new project > in a near future and was thinking on using a Kinetis and FreeRTOS. > > The only thing I can add is that KDS examples are in general not very useful > (they don't explain much and often badly coded). And also the KSDK is not > bug free (at least until version 2.x, don't know about v3), it seems they > didn't test it properly.
These types of "support activities" are often handled by "junior engineers". I think their thinking is that its a relatively "safe" way to use their skills without too much risk (I think they expect developers to rework the examples and not blindly incorporate them into product). I know that the quality of support folks with which I interact varies based on the dollar volume of the business I'm doing. The same is true of "application notes" -- both hardware and software. Taking ANY of that stuff literally is almost certainly a bad idea. I don't think anyone actually proofreads the code/schematics... It's worthwhile to develop your own standard libraries, drivers/handlers, crt0.s, etc. that you are more intimately familiar with so you can more readily port them to other projects without having to resort to kludges layered on "foreign code" (e.g., how would you implement fprintf(3c) in a variety of different execution environments? sprintf(3c) to a dynamically allocated buffer followed by a bytewise copy to the FILE* referenced and tearing down the buffer at cleanup) [Obviously, there are more effective/less risky approaches]
On 27/06/2017 15:22, Dave Nadler wrote:
> I'd appreciate any comments from those of you who have > used (or tried to use) this combo, especially if I've > gotten anything wrong or missed anything... > http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html
I get: Not Found The requested URL /embedded/draft1_newlibAndFreeRTOS.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. -- Mike Perkins Video Solutions Ltd www.videosolutions.ltd.uk
On Thursday, June 29, 2017 at 5:38:39 PM UTC-4, Mike Perkins wrote:
> I get: Not Found... > -- > Mike Perkins > Video Solutions Ltd > www.videosolutions.ltd.uk
Sorry, its offline while I correct a few errors found by reviewers. I'll post when draft2 (or final version) is up. Thanks!
On Tue, 27 Jun 2017 07:22:26 -0700, Dave Nadler wrote:

> I'd appreciate any comments from those of you who have used (or tried to > use) this combo, especially if I've gotten anything wrong or missed > anything... http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html > > Thanks in advance, > Best Regards, Dave
I'd like to see it when it comes up. Does newlib advertise itself as being thread-safe? I kinda vaguely remember the answer is "yes", but dunno. -- www.wescottdesign.com
On 6/30/17 11:02 PM, Tim Wescott wrote:
> On Tue, 27 Jun 2017 07:22:26 -0700, Dave Nadler wrote: > >> I'd appreciate any comments from those of you who have used (or tried to >> use) this combo, especially if I've gotten anything wrong or missed >> anything... http://www.nadler.com/embedded/draft1_newlibAndFreeRTOS.html >> >> Thanks in advance, >> Best Regards, Dave > > I'd like to see it when it comes up. > > Does newlib advertise itself as being thread-safe? I kinda vaguely > remember the answer is "yes", but dunno. >
Newlib does advertise that it CAN be thread safe if configured to be so. It has hooks that can provide the needed exclusion primitives from the OS and hooks to provide it with Thread Local Storage for the library. Dave is basically writing part of this layer for FreeRTOS. Part of it is already provided in FreeRTOS via a configuration parameter.
Here's the (I hope) final version:
http://www.nadler.com/embedded/newlibAndFreeRTOS.html
Please let me know if anything is unclear or I've got anything wrong!
Thanks,
Best Regards, Dave