Skip to content

Commit

Permalink
Merge branch 'topic/arm-freertos' into 'master'
Browse files Browse the repository at this point in the history
Add FreeRTOS light runtime

See merge request eng/toolchain/bb-runtimes!106
  • Loading branch information
jklmnn committed Jul 4, 2024
2 parents 5e984a8 + 7764fa4 commit 0022e13
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build_rts.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@

from qnx import Aarch64QNX, ARMQNX

from freertos import ArmV7AFP_FreeRTOS

import argparse
import os
import subprocess
Expand All @@ -121,6 +123,9 @@ def build_configs(target):
t = ArmPikeOS5()
elif target == "ppc-pikeos5":
t = PPCPikeOS5()
# FreeRTOS
elif target == "arm-freertos-v7a-fp":
t = ArmV7AFP_FreeRTOS()
# AArch64 elf
elif target == "morello":
t = Morello(uart_io=True)
Expand Down
50 changes: 50 additions & 0 deletions freertos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from support.bsp_sources.target import Target
from support.bsp_sources.archsupport import ArchSupport


class ArmFreeRTOS(Target):
def __init__(self):
super().__init__()
self.add_gnat_sources("src/s-macres__native.adb")
self.add_linker_switch("-Wl,-r", loader=None)
self.add_linker_switch("-nostdlib", loader=None)

@property
def target(self):
return "arm-eabi"

def has_libc(self, profile):
return True

@property
def system_ads(self):
return {
"light": "system-xi-arm.ads",
}


class ArmV7AFP_FreeRTOS(ArmFreeRTOS):
@property
def has_timer_64(self):
return True

@property
def has_single_precision_fpu(self):
return True

@property
def has_double_precision_fpu(self):
return True

@property
def name(self):
return "v7a-fp"

@property
def compiler_switches(self):
return (
"-march=armv7-a+fp",
"-mfloat-abi=hard",
"-marm",
"-mno-unaligned-access",
)
2 changes: 1 addition & 1 deletion gen_rts_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def main():
)
parser.add_argument(
"--source-profile",
choices=["bb", "deos", "pikeos", "vx7r2cert", "qnx"],
choices=["bb", "deos", "freertos", "pikeos", "vx7r2cert", "qnx"],
default="bb",
help="platform specific source selections",
)
Expand Down
37 changes: 37 additions & 0 deletions support/rts_sources/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@
"hie/a-textio__deos.adb",
"hie/s-macres.ads",
],
"freertos_srcs": [
"hie/s-textio__freertos.ads",
"hie/s-textio__freertos.adb",
"hie/s-macres.ads",
"hie/a-textio__c.ads",
"hie/a-textio__c.adb",
"hie/g-io__zfp.ads",
"hie/g-io__zfp.adb",
"hie/g-io-put.adb",
],
"pikeos_srcs": [
"hie/a-textio.ads",
"exit.c",
Expand Down Expand Up @@ -341,6 +351,7 @@
"hie/s-memory__light.ads",
],
"bb_srcs": ["hie/a-elchha__zfp.adb"],
"freertos_srcs": ["hie/a-elchha__zfp.adb"],
"pikeos_srcs": ["hie/a-elchha__zfp.adb"],
"qnx_srcs": [
"hie/a-elchha__traceback.adb",
Expand Down Expand Up @@ -369,6 +380,7 @@
"conditions": ["RTS_Profile:light,cert"],
"bb_srcs": ["hie/s-sssita.ads", "hie/s-sssita.adb"],
"deos_srcs": ["hie/s-thread__cert.ads", "hie/s-thread__cert.adb"],
"freertos_srcs": ["hie/s-sssita.ads", "hie/s-sssita.adb"],
"pikeos_srcs": [
"hie/a-textio__pikeos-light.adb",
"hie/s-sssita.ads",
Expand Down Expand Up @@ -1292,6 +1304,23 @@
"hie/a-nallfl__light.ads",
"libgnat/a-naliop__nolibm.ads",
],
"freertos_srcs": [
"hie/a-ngelfu__ada.ads",
"hie/a-ngelfu__ada.adb",
"hie/a-nlelfu__ada.ads",
"hie/a-nuelfu__ada.ads",
"hie/s-gcmain__ada.ads",
"hie/s-gcmain__ada.adb",
"hie/s-libdou__ada.ads",
"hie/s-libdou__ada.adb",
"hie/s-libsin__ada.ads",
"hie/s-libsin__ada.adb",
"hie/s-lidosq__ada.ads",
"hie/s-lisisq__ada.ads",
"hie/s-libm__ada.ads",
"hie/s-libm__ada.adb",
"hie/s-libpre__ada.ads",
],
"pikeos_srcs": [
"hie/a-ngelfu__ada.ads",
"hie/a-ngelfu__ada.adb",
Expand Down Expand Up @@ -1339,6 +1368,7 @@
"math/long_long_64bit": {
"conditions": ["Add_Math_Lib:!no", "CPU_Family:!x86,!x86_64"],
"bb_srcs": ["libgnat/a-nllefu.ads"],
"freertos_srcs": ["libgnat/a-nllefu.ads"],
"pikeos_srcs": ["libgnat/a-nllefu.ads"],
},
"math/long_long_80bit": {
Expand Down Expand Up @@ -1390,21 +1420,25 @@
"math/softsp": {
"conditions": ["Add_Math_Lib:softfloat,hardfloat_dp"],
"bb_srcs": ["hie/s-lisisq__ada.adb"],
"freertos_srcs": ["hie/s-lisisq__ada.adb"],
"pikeos_srcs": ["hie/s-lisisq__ada.adb"],
},
"math/softdp": {
"conditions": ["Add_Math_Lib:softfloat,hardfloat_sp"],
"bb_srcs": ["hie/s-lidosq__ada.adb"],
"freertos_srcs": ["hie/s-lidosq__ada.adb"],
"pikeos_srcs": ["hie/s-lidosq__ada.adb"],
},
"math/hardsp": {
"conditions": ["Add_Math_Lib:hardfloat,hardfloat_sp"],
"bb_srcs": ["hie/s-lisisq__fpu.adb"],
"freertos_srcs": ["hie/s-lisisq__fpu.adb"],
"pikeos_srcs": ["hie/s-lisisq__fpu.adb"],
},
"math/harddp": {
"conditions": ["Add_Math_Lib:hardfloat,hardfloat_dp"],
"bb_srcs": ["hie/s-lidosq__fpu.adb"],
"freertos_srcs": ["hie/s-lidosq__fpu.adb"],
"pikeos_srcs": ["hie/s-lidosq__fpu.adb"],
},
# Arithmetic
Expand Down Expand Up @@ -2188,14 +2222,17 @@
"gnat/parameters/light-small": {
"conditions": ["RTS_Profile:light", "Memory_Profile:small"],
"bb_srcs": ["hie/s-parame__zfp_small.ads"],
"freertos_srcs": ["hie/s-parame__zfp_small.ads"],
},
"gnat/parameters/light-large": {
"conditions": ["RTS_Profile:light", "Memory_Profile:large"],
"bb_srcs": ["hie/s-parame__zfp.ads"],
"freertos_srcs": ["hie/s-parame__zfp.ads"],
},
"gnat/parameters/light-huge": {
"conditions": ["RTS_Profile:light", "Memory_Profile:huge"],
"bb_srcs": ["hie/s-parame__zfp_huge.ads"],
"freertos_srcs": ["hie/s-parame__zfp_huge.ads"],
},
# Cert
"cert": {
Expand Down

0 comments on commit 0022e13

Please sign in to comment.