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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Understanding GNAT Bare Board Run-time for Cortex-M Date: Mon, 08 Apr 2019 08:36:59 +0100 Organization: A noiseless patient Spider Message-ID: References: <2d99a259-3288-4981-9bda-97145077a5bd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="5e3f9d518b2db3a161834d1a898ac877"; logging-data="13326"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MOY1pBWLKkyuSAuJ3GNU5yZTPfsqJ2u4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:cPd2K8HGkbH1PGHJ+iCSj88hoeg= sha1:KG5ZGxL4vH2Ch4li+2/wUpNLU9s= Xref: reader01.eternal-september.org comp.lang.ada:56098 Date: 2019-04-08T08:36:59+01:00 List-Id: Daniel Way writes: > I'm trying to port the bare-board GNAT run-time to a Coretex-M0+ (NXP > KV11Z7) processor. I'm new to concurrency and have been reading > through the run-times for the STM32 targets to understand how the > tasks and protected objects are implemented, however, there seems to > be a web of dependencies between the different packages and wrappers > of wrappers of wrappers for types and subprograms. Yes. > * Is there any tool available to scan through the source code and > generate a graphical call graph to help visualize the different > dependencies? Pass. > * Has anyone on the forum successfully ported a bare-board run-time? > What was your experience and do you have any tips? AdaCore have published a guide for porting their runtime[0]. GNAT CE 2018 includes a ravenscar-sfp-microbit runtime. My Cortex GNAT RTS[1] is based on FreeRTOS[2] and includes an RTS for the nRF51 as found in the BBC micro:bit. That's a cortex-m0, but as far as I can see[3] the differences from the m0+ are minimal. The main issue I had was with the clock; the nRF51 doesn't have a system tick, instead I had to use RTC1 (I think AdaCore used RTC0). > * Is porting the run-time just a matter of updating the linker, a few > packages, and a GPR script, or is there some fundamental > implementation changes to consider? That would be it (also the runtime.xml file) but the problem is identifying _which_ packages to change! I wouldn't expect many from the microbit RTS, it's likely to be clock setup and interrupt naming. It would help if you had an SVD to generate the board peripheral dependencies. [0] https://github.com/AdaCore/bb-runtimes/tree/community-2018/doc/porting_runtime_for_cortex_m [1] https://github.com/simonjwright/cortex-gnat-rts [2] https://www.freertos.org [3] https://community.cypress.com/docs/DOC-10652