From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: STM32F4 Discovery, communication and libraries Date: Thu, 28 Aug 2014 15:00:12 +0200 Organization: cbb software GmbH Message-ID: References: <60a42dc6-d8d0-4432-ae5a-86de18b82840@googlegroups.com> <5kkrv9hejn2qhdckkeo8lidkbh3bkme1gn@4ax.com> <5b91313c-acf9-4a6e-b157-6ba7c8021567@googlegroups.com> <0513ad07-6fbe-463a-be6f-097cd5113f52@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: yj8+JIQUMOEawvIM7K49kA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21946 Date: 2014-08-28T15:00:12+02:00 List-Id: On Thu, 28 Aug 2014 03:12:16 -0700 (PDT), Roy Emmerich wrote: > I want to use a finite state machine (FSM) approach. There will be a > supervisor module which will instantiate sub-modules which communicate > with peripherals. Each sub-module will be a separate sub-FSM, reporting > its state to the supervisor. Each sub-module will make use of a protocol > library (e.g. MODBUS RTU) and a hardware driver library (e.g. UART over > RS485/232) to communicate with devices. > > That is it. No OS, no middleware. It is difficult to imagine working. Do you know how ModBus function? It is basically a client-server protocol. You send a request, e.g. F15 and then read the response. Whether the request is a read or write request does not matter. Most of ModBus end devices are half-duplex. Which means one request at a time. Many have internal cycles and interlocking which make things much slower than the physical I/O already did. Some would crash if you queried too frequently. Anyway, without an OS you will have to wait for the response to come, which in turn, will block the whole application. It will be extremely slow. One of the responsibilities of the OS and the middleware is to perform I/O on things like ModBus in background without blocking the application and other I/O. Even a very lame board is usually much faster than any ModBus terminal. In short, an OS-less design is not suitable for handling many peripheral devices simultaneously, especially when the devices are attached over slow asynchronous communication channels. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de