Multiprocessor ravenscar implementation

Moderators: dhowells, RobertKleczek

Multiprocessor ravenscar implementation

Postby RobertKleczek » Sun Sep 21, 2014 10:23 pm

As I promissed earlier I uploaded my proposition of ravenscar multiprocessor framework for AdaCore. At now I eliminate ASM & C files from original RTS, in the future it should be possible to move all architecture dependent files to ARM library. ARM library structure should be used for device drivers imlementation too. Here goes some explanation how it set to be.

Implementation consists of two main parts:

1. CORE part - RTS's in main compiler tree, as ravenscar runtime, compiled to different architectures in schema: ravenscar-sfp-{architecture}-{cpu/tune}-{fpu}-{code set}. Each folder should contains in the future same sources files (as for cortex-m3/m4 for now), but differs in runtime.xml describing target subarchitectures - should be established and build before user project & arm library building (in the future maybe at compiler installation time)

2. ARM library part - consists of:

a. subarchitectures library build structure - same convention as for CORE
b. gprbuild files: link.gpr (link possibilities), files.gpr (path to tools & libs), processor.gpr (definitions of MCU subarchitectures variables), arm.gpr (main libraray project file collecting previous ones & to be included by user project)
c. src folder contains all source code for library

Here comes src structure:

src/ - root for arm project, and all common files for it
src/architecture/ - root project for common architecture sources
src/architecture/{arch}/ - subdirectory for specific architecture files (eg. startup, system registers definitions, special file for needed asm inserts)
src/mcu - subdirectory for vendor groups of MCU's
src/mcu/{vendor}/ - subdirectory for common files for all kind of vendor MCU or files common to groups of MCU's in convention *** etc. (eg. drivers files)
src/mcu/{vendor}/{mcu name}/ - directory for definitions MCU alias, definitions of processor features (concerning only with that MCU) and for redefining parent common files
src/mcu/{vendor}/{mcu name}/rom /ram - linker specific .ld files and to define kind of linking. Ld files are specific for this implementation (differs from original !!!)

Proper set of these directories is set by using scenario variables in GPS editor or defining them at command line - look at processor.gpr.

To try out this framework, copy arm files whenever you want, arm-eabi to place where original ravenscar directory exists, set proper paths in files.gpr, build runtimes, and open demo gpr file in gps, then choose proper scenario variables and build project. You may build another demo project changing only scenario variables (and of course cleaning obj demo files as they was compiled for another architecture - or change project file to build them in different obj subdirectories). Demo project for different boards than stm32f407vg will not work - project is discovery specific and for other boards makes no sense, but will excellent build.

I'm wating and interesting for your comments, reviews and propositions concerned with that framework.

Robert Kleczek
Posts: 10
Joined: Tue Sep 02, 2014 7:28 pm

Re: Multiprocessor ravenscar implementation

Postby dhowells » Sun Oct 19, 2014 10:42 pm

Can confirm it works!

I had originally started with GPS running under Windows 7 but was having difficulty setting up and configuring directories successfully. I ran Ubuntu 14.04 32 bit version as a virtual machine and followed your instructions. To make life initially simpler I mimicked your directory structure i.e. keeping /home/robert.

Proceeding through the process made it clear to me what was going on and what needed to be done. Hopefully this will help others.

Here's what I did:


1. Adacore GNAT has been installed to /usr/gnat/bin
2. The adaformicrocontrollers git repository has been cloned into /home/robert

Step 1.
Code: Select all
cd /home/robert/AdaForMicrocontrollers/RTS/RobertKleczek

Step 2. Copy the files below arm-eabi to the GNAT install
Code: Select all
cp -R arm-eabi/* /usr/gnat/lib/gnat/arm-eabi

Step 3. Go into each of the directories and build the RTS, example:

Code: Select all
cd /usr/gnat/lib/gnat/arm-eabi/ravenscar-sfp-armv7e-m-cortex-m4-fpv4-sp-d16-thumb
gprbuild runtime_build.gpr

Step 4. Go back to the arm directory.
Code: Select all
cd /home/robert/AdaForMicrocontrollers/RTS/RobertKleczek/arm

Step 5. Make sure the setting are correct.
Edit files.gpr so that
Code: Select all
ARM_LIB := "/home/robert/AdaForMicrocontrollers/RTS/RobertKleczek/arm/"

Step 6. Go to the examples directory
cd "/home/robert/AdaForMicrocontrollers/RTS/RobertKleczek/examples/AdaCore examples/demo_leds-stm32f4"

Step 7. Edit demo.gpr so that Robert's ARM package can be found (change the with "..." stuff to give the full path to arm.gpr"

Step 8. Start GPS

Step 9. Open the project file (Project -> Open) demo_leds.gpr

Step 10. Switch perspective to debug (Window -> perspective -> Debug)

Step 11. Build the executable! (Build -> Project -> Build All)

Step 12. Check the Messages pane to confirm successful compilation.
Site Admin
Posts: 11
Joined: Tue Sep 02, 2014 1:04 am

Re: Multiprocessor ravenscar implementation

Postby dhowells » Mon Oct 20, 2014 12:01 am

Build works on Windows 7!


1. GNAT Arm-elf 2014 installed in "C:\GNAT\2014
2. Git repository cloned C:\Git\AdaForMicrocontrollers

Step 1. Copy contents of C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\arm-eabi to C:\GNAT\2014\lib\gnat\arm-eabi

Step 2. Enter each of the directories in C:\GNAT\2014\lib\gnat\arm-eabi and build each of the copied RTS by selecting opening runtime_build.gpr with GPS and clicking on "Build All".


Step 3. Edit files.gpr found in C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\arm to read:

Code: Select all
abstract project FILES is

   ARM_LIB := "C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\arm\";
   RTS     := "C:\GNAT\2014\lib\gnat\arm-eabi\ravenscar-sfp-";

end FILES;

Step 4. edit C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\AdaCore examples\demo_leds-stm32f4\demo_leds.gpr so that arm.gpr can be found by changing the first line to read:
Code: Select all
with "C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\arm\arm.gpr";

Step 5. Start GPS.

Step 6. Open (Project -> Open) C:\Git\AdaForMicrocontrollers\RTS\RobertKleczek\AdaCore examples\demo_leds-stm32f4\demo_leds.gpr

Step 7. Change perspective to Debug (Window -> Perspectives -> Debug)

Step 8. Click "Build All"

Step 9. Check the Messages pane to ensure build was successful.
Site Admin
Posts: 11
Joined: Tue Sep 02, 2014 1:04 am

Re: Multiprocessor ravenscar implementation

Postby RobertKleczek » Fri Oct 31, 2014 11:01 pm

Hi to everyone, I've just uploaded next version of my RTS port to ARM processors to Now, initialization code is excluded from RTS core, updated registers definitions format for easier automate translation process with ability to give initial value to registers, removed central register collections, many new registers definitions, new generics for register manipulation using oveloaded operators, initial proposition for drivers definitions, universal clock early initialization routine & many more. Particular explanations will be given later here. From this moment every Cortex-M3 or -M4 MCU can be implemented using one universal core RTS by writing early initalization code within my arm library. Enjoy. Robert Kłeczek.
Posts: 10
Joined: Tue Sep 02, 2014 7:28 pm

Return to Architecture Specific

Who is online

Users browsing this forum: No registered users and 1 guest