comp.lang.ada
 help / color / mirror / Atom feed
From: Roy Emmerich <roy.emmerich@gmail.com>
Subject: Re: STM32F4 Discovery, communication and libraries
Date: Sat, 30 Aug 2014 15:00:06 -0700 (PDT)
Date: 2014-08-30T15:00:06-07:00	[thread overview]
Message-ID: <6db74417-a977-4d10-a792-18a94a14c68f@googlegroups.com> (raw)
In-Reply-To: <c6c3avF53r8U1@mid.individual.net>

On Friday, 29 August 2014 21:41:18 UTC+2, Niklas Holsti  wrote:
> On 14-08-29 19:47 , Roy Emmerich wrote:
> > My requirements for dynamic behaviour don't extend so far as to be
> > plug and play ready. What I do want, being a modular hardware
> > platform, is to define, in a configuration file, which hardware
> > modules are plugged into which socket. At start up the supervisor
> > will read this file and instantiate the relevant software modules.
> 
> So the Ada program contains SW modules that can handle all known and
> possible hardware modules, but the SW modules are all "data/table
> driven" in the sense that the supervisor can tell each SW module where
> (in which socket, &c) its HW, if any, can be found?

Yes.

> As far as I can see, the only problem that the Ravenscar profile can
> cause for that design is the restriction No_Dynamic_Attachment, which
> means that the connection between an interrupt source and its handler
> must be established at elaboration time, by pragmas or aspects, and not
> dynamically using a call of Ada.Interrupts.Attach_Handler.
> 
> In principle, the configuration file could be read at elaboration time,
> and could provide the interrupt numbers to be used in the pragma/aspect
> Attach_Handler. However, doing lots of computation at elaboration time
> can make it tricky for the compiler to find a feasible elaboration order
> (especially if the program has tasks).
> 
> The other solution is to attach handlers to all interrupt sources
> statically, but to decide in each handler, at run time, based on the
> configuration data, which SW module is to handle the interrupt, and to
> call the suitable operation from that SW module. A kind of indirection step.

Okay. I think I got that.

> > This device will effectively aggregate the
> > data from all of these devices into one, unified format and send
> > control signals to the generator/inverters.
> 
> What is the highest control frequency, or shortest deadline or response
> time, required of the SW?

Okay, some new terminology for me here. For this particular application the response time doesn't have to be very fast (a few seconds). It will be monitoring battery state of charge and active power and turning the generator on or off. I do foresee the need to do reactive power control in larger off-grid systems. For this the phase shift between voltage and current is normally measured by a CE/UL certified power analyser (legal/safety issues) and transmitted, once again, via MODBUS RTU, to my device. As this kind of control is a lot more dynamic, a much faster response time would be required (20 ms thumb suck value, considering one 50 Hz period is 20 ms long). Sorry that it is still so vague. A bit of guidance wouldn't go amiss :)

> > ... making it
> > important for it to be a low power device (e.g. much less than say a
> > beaglebone black embedded Linux board), able to run on a battery for
> > at least 3 days, preferably much more
> 
> You may have to modify the Board Support Package and/or the kernel to
> let the processor sleep between clock interrupts. I don't know if the
> AdaCore ARM BSP has that ability off-the-shelf.

Is there an AdaCore ARM BSP yet? I thought this is what Mike Silva was referring to when he said:

"I know that AdaCore is working on comms libraries for the ARM Cortex M parts, but I don't know anything about the projected availability."

assuming this would include stuff such as I2C, SPI, UART, etc. which is normally also part of the BSP?

Speaking of which...in order to feel like I'm making progress and Ada is going to work for me, I really need to get connecting to my peripherals. The only way I can see it happening within the next week is to call the STM C drivers supplied with their BSP. Does this make sense?

> > It must keep accurate time (syncing once a day via GPS)
> > and (periodically/in emergency) make the data available remotely (via
> > GPRS).
> 
> Time in a Ravenscar system is provided by the predefined package
> Ada.Real_Time. It is good for relative timing in seconds and ticks, but
> does not provide calendar date and time. Probably you will have to write
> your own Calendar-like package which is synchronised with GPS. Not a
> very big job.

Maybe not if you know what you're doing ;)

This is where it gets a bit vague for me. The STM32F4 has an on-board RTC with full calendar functionality. My thinking is at start up and then once a day to enter a "clock_sync" state, fire up the GPS receiver, somehow sync the processor's RTC and then continue with normal operation. If I need the absolute date/time I can just get it from the RTC, so I don't know why I would want to use the Ada.Calendar functionality in the first place. Could you shed some light on this?


  reply	other threads:[~2014-08-30 22:00 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 22:38 STM32F4 Discovery, communication and libraries roy.emmerich
2014-08-27  2:40 ` Luke A. Guest
2014-08-27 12:35   ` Roy Emmerich
2014-08-27  7:41 ` Dmitry A. Kazakov
2014-08-27 13:35   ` Roy Emmerich
2014-08-27 16:00     ` Dmitry A. Kazakov
2014-08-27 13:08 ` Dennis Lee Bieber
2014-08-27 15:44   ` Roy Emmerich
2014-08-28  1:37     ` Dennis Lee Bieber
2014-08-27 16:03   ` Roy Emmerich
2014-08-28  1:48     ` Dennis Lee Bieber
2014-08-28 10:12       ` Roy Emmerich
2014-08-28 13:00         ` Dmitry A. Kazakov
2014-08-28 16:28           ` Mike Silva
2014-08-28 17:03             ` Roy Emmerich
2014-08-28 20:09             ` Dmitry A. Kazakov
2014-08-28 20:34               ` embeddedrelatedmike
2014-08-29  7:34                 ` Dmitry A. Kazakov
2014-08-29 15:59                   ` Niklas Holsti
2014-08-29 16:59                     ` [OT] Ravenscar (the place, not profile), was: " Simon Clubley
2014-08-29 17:18                       ` Niklas Holsti
2014-08-29 17:31                         ` Simon Clubley
2014-08-30 14:55                           ` Dennis Lee Bieber
2014-08-29 17:59                       ` Jeffrey Carter
2014-08-29 23:30                       ` Randy Brukardt
2014-08-30 11:25                         ` Simon Clubley
2014-08-31 11:09                           ` Phil Thornley
2014-08-30 12:36                         ` Peter Chapin
2014-08-31 18:37                         ` Dirk Craeynest
2014-08-31 19:38                           ` Simon Clubley
2014-08-29 17:24                   ` Mike Silva
2014-08-29 23:35                     ` Randy Brukardt
2014-08-29 13:06                 ` Dennis Lee Bieber
2014-08-29 16:52                   ` Niklas Holsti
2014-08-31  0:49                     ` Shark8
2014-08-28 21:17               ` Niklas Holsti
2014-08-29  0:07                 ` Roy Emmerich
2014-08-29 17:58                   ` Niklas Holsti
2014-08-29  7:41                 ` Dmitry A. Kazakov
2014-08-29 16:31                   ` Niklas Holsti
2014-08-29 16:47                     ` Roy Emmerich
2014-08-29 19:41                       ` Niklas Holsti
2014-08-30 22:00                         ` Roy Emmerich [this message]
2014-08-31 10:08                           ` Simon Wright
2014-09-01 20:15                           ` Niklas Holsti
2014-09-01 21:11                             ` Jeffrey Carter
2014-08-31  4:54                       ` gvdschoot
2014-09-09 19:17                         ` Roy Emmerich
2014-09-09 20:20                           ` Mike Silva
     [not found]                             ` <a54dcc42-d4e2-4d53-b381-2bb7a0eef1ee@googlegroups.com>
2014-09-10  1:41                               ` Dennis Lee Bieber
2014-09-10  8:52                                 ` Roy Emmerich
2014-09-10 13:05                                   ` Dennis Lee Bieber
2014-09-10 17:16                                     ` Simon Wright
     [not found]                               ` <a2e59fce-751c-46a0-90f3-80430c627732@googlegroups.com>
2014-09-10  7:22                                 ` Dmitry A. Kazakov
2014-09-10  9:35                                 ` Roy Emmerich
2014-09-10 14:11                               ` Stephen Leake
2014-09-10 17:46                                 ` Jeffrey Carter
2014-09-10 18:37                                   ` Dmitry A. Kazakov
2014-09-11  9:53                                   ` Stephen Leake
2014-09-11 17:19                                     ` Jeffrey Carter
2014-09-10 20:58                               ` Brian Drummond
2014-09-10 23:40                                 ` Dennis Lee Bieber
2014-08-29 16:58                     ` Niklas Holsti
2014-08-31  7:02                     ` Dmitry A. Kazakov
2014-08-31 15:44                       ` Brad Moore
2014-08-31 16:15                         ` Dmitry A. Kazakov
2014-09-01 16:15                           ` Brad Moore
2014-09-01 16:42                             ` Dmitry A. Kazakov
2014-08-31 18:41                       ` Niklas Holsti
2014-09-01 16:42                         ` Dmitry A. Kazakov
2014-09-01 17:21                           ` G.B.
2014-09-02  8:21                             ` Dmitry A. Kazakov
2014-09-02 13:04                               ` G.B.
2014-09-02 14:18                                 ` Dmitry A. Kazakov
2014-09-02 16:44                               ` Jeffrey Carter
2014-09-02 19:02                                 ` Niklas Holsti
2014-09-02 23:19                               ` Randy Brukardt
2014-09-03  1:40                                 ` gdotone
2014-09-04  9:26                                   ` Roy Emmerich
2014-09-04 17:58                                     ` Niklas Holsti
2014-09-05 11:47                                       ` Simon Clubley
2014-09-09 19:04                                         ` Roy Emmerich
2014-09-01 18:39                           ` Niklas Holsti
2014-09-02  8:19                             ` Dmitry A. Kazakov
2014-08-28 13:10         ` Dennis Lee Bieber
2014-08-29  2:52           ` Dennis Lee Bieber
2014-09-20 20:50   ` David Thompson
2014-08-27 16:17 ` Mike Silva
2014-08-27 16:36   ` Roy Emmerich
2014-08-27 16:58     ` Simon Clubley
2014-08-29 19:36 ` johnscpg
2014-08-30 15:06   ` Stephen Leake
2014-09-02 21:40 ` rrr.eee.27
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox