❌ About FreshRSS

Reading view

There are new articles available, click to refresh the page.

Volatile records containing an array

svd2ada generates volatile arrays.

e.g. IMR_MR_Field_Array

There are two other options that I believe will work easily with spark. The .Val Hal.UInt32 or a record of booleans with different names instead of the array.

The array makes for simpler code. So before I switch to the value. Could anyone suggest how the Spark compatibility error may be avoided. Editing the svds isn’t ideal but possible. A function or procedure local instantiation would be ideal. Any ideas?

IMR1.MR.Arr(Var) := True;

error: volatile object cannot appear in this context. Spark RM 7.1.3 (10).

Thanks

2 posts - 1 participant

Read full topic

Gnatd.v elaboration

I wonder. Is gnatd.v a better option than
pragma preelaborate

Is preelaborate more compiler portable? Though I do not use the features that it protects against such as dynamic dispatch, so it is simply an unneeded restriction for me with Gnat. However gnatd.v seems to offer more such as in regard to uninitialised variables? Assuming it works as I had no compile issues :joy:.

see 7.7

https://docs.adacore.com/spark2014-docs/html/lrm/packages.html

2 posts - 2 participants

Read full topic

Spark with a private global log store

I have a log package with a private global variable that passes silver mode except for a couple of low upper bound string issues. It has a fixed sized global variable as the log store.

However any external procedure running in spark mode that tries to execute a log function is wanted by spark to have the state or log store listed in it’s global aspect even though it has no access to the private log store directly.

I assume that I am missing something and shall keep reading but any help would be much appreciated? It isn’t workable for me to create global aspects for any procedure that uses my log package. I guess I could pass the log store but I am not sure that that is a good solution.

Thanks

3 posts - 2 participants

Read full topic

Does Initialize_Scalars require a Full runtime or does light need s-scaval.ads?

When I add
pragma Initialize_Scalars

To my local configuration pragmas on a light runtime.

I get

hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available

The complete output follows.

gprbuild --target=arm-eabi -d -P/mnt/crypt/elansys/code/Ada/stm32l4r9_hal/stm32l4r9_hal.gpr -XMODE=Compile -XADAFLAGS= -g -j12 -gnat2022 -largs -Wl,-Map=map.txt
Compile
[Ada] stm32_svd-spi.ads
[Ada] stm32_svd-swpmi.ads
[Ada] stm32_svd-rcc.ads
[Ada] stm32_svd-lcd.ads
[Ada] stm32_svd-fpu.ads
[Ada] stm32_svd-opamp.ads
[Ada] stm32_svd-dma.ads
[Ada] stm32_svd-octospim.ads
[Ada] stm32_svd-rtc.ads
[Ada] stm32_svd-syscfg.ads
[Ada] stm32_svd-octospi.ads
[Ada] stm32_svd-crc.ads
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available

compilation of stm32_svd-crc.ads failed
compilation of stm32_svd-octospi.ads failed
compilation of stm32_svd-syscfg.ads failed
compilation of stm32_svd-rtc.ads failed
compilation of stm32_svd-octospim.ads failed
compilation of stm32_svd-dma.ads failed
compilation of stm32_svd-opamp.ads failed
compilation of stm32_svd-fpu.ads failed
compilation of stm32_svd-lcd.ads failed
compilation of stm32_svd-rcc.ads failed
compilation of stm32_svd-swpmi.ads failed
compilation of stm32_svd-spi.ads failed

gprbuild: *** compilation phase failed
[2023-01-16 14:11:59] process exited with status 4, 23% (27/113), elapsed time: 00.31s

7 posts - 3 participants

Read full topic

Gnat arm elf 12.2.1 (alire) undefined reference to strlen

Merry xmas all.

I simplified my Last Chance Handler by using

Interfaces.C.Strings.Value

The compiler output undefined reference to ‘strlen’

light-cortex-m4f/adalib/libgnat.a(i-cstrin.o)

I could go back to my manual string null termination finding function. Or should I look into Gnat. Could someone point me to the right place to report and or submit a patch (is it gerrit that GCC uses or something)?

7 posts - 3 participants

Read full topic

@sjvn @smouton @ZDNET @rustlang I have been using Ada for just over 14 months (primarily embedded work). I chose it over Rust actually and it is now m...

@sjvn @smouton @ZDNET @rustlang I have been using Ada for just over 14 months (primarily embedded work). I chose it over Rust actually and it is now my favourite language. I probably only use a fraction of it but it is very neat.
❌