Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Barry Houser
    @barryhouser:matrix.org
    [m]
    For MCUs, where is the delay/delay until "operations" defined? They appear to be baked into Ada.
    4 replies
    Barry Houser
    @barryhouser:matrix.org
    [m]
    OK. I thought it would be a nice to have in the LightRuntime.
    Steven Bos
    @aiunderstand
    image.png
    @barryhouser:matrix.org . For MCU delay until is defined in the arm-eabi folder (if targetting ARM), see screenshot
    If you change anything in those files you need to gprbuild the runtime again
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    @aiunderstand: that is the Ravenscar-full profile :) That is like a small RTOS on its own and tends to be a bit customized for each board. I suppose ARM is fairly portable in that regard.
    ethin
    @ethindp:the-gdn.net
    [m]
    Well, to be more precise, a date, a time, a date and time, and so on and so forth. I don't think a simple timer would suffice for that. But if you just wanted to delay and no delay until, you could throw program_error when a delay until statement is found and you could just rely on relative delays
    "The Sociology of Programming Languages" by Leo Meyerovich, from Strange Loop
    2 replies
    ajdude
    @ajdude:matrix.org
    [m]

    Just an update, the alire installer I've been working on compiles and installs Alire on

    • x86_64 and aarch64 MacOS
    • x86_64 Linux (via WSL)
    • x86_64 Windows (it just bails out, but it WILL compile lol)

    I still need to test it on a couple other versions of linux + freebsd, but I should have something on github shortly for more people to test.

    4 replies
    ajdude
    @ajdude:matrix.org
    [m]
    :point_up: Edit: Just an update, the alire installer I've been working on compiles and installs Alire on
    • x86_64 and aarch64 MacOS
    • x86_64 Linux (via WSL)
    • x86_64 Windows (it just bails out, but it WILL compile lol)
    I still need to test it on a couple other versions of linux, but I should have something on github shortly for more people to test.
    Jeremy Grosser
    @JeremyGrosser
    fyi, I created a new category on the Ada forum for Advent of Code https://forum.ada-lang.io/t/about-the-advent-of-code-category/112
    ethin
    @ethindp:the-gdn.net
    [m]
    So I've got a bit of a question involving subunits. If I have an overloaded subprogram, but I want all overloads of that subprogram to also be subnits, how does gnat handle it? Does it require that all the functions of same name but differing profiels be in one file, or do I have to do something special like put numbers in the file name or something?
    Смаколик
    @cmakoluk:matrix.org
    [m]

    The defining_identifiers of all body_stubs that appear immediately within a particular declarative_part shall be distinct.

    So you can't two overloading subprograms to be subunits.

    1 reply
    jere
    @jere1227_twitter
    what you do is in your gpr file indicate which one of the subunit bodies is the body of your spec based on a build switch
    package Naming
    Steve Biedermann
    @hardliner66
    Hi, does anybody know if there is a simple way to cross-compile ada for armv7?
    I already found a tutorial using alire and gnat_arm_elf, but I couldn't get it to work on our dev board (imxsx with a cortex a9).
    is there any way without writing my own runtime? like a flag or something? :s
    Jeremy Grosser
    @JeremyGrosser
    I don't think there's a simple answer to that question
    you can try to use the bare_runtime with -march=armv7-a
    if you don't want to port bb-runtimes, then your best option is to run Linux or an RTOS
    Jeremy Grosser
    @JeremyGrosser
    getting the Cortex-A processors going is a bit more complicated than Cortex-M. There will be a few stages of bootloaders that need to do things like initialize the DRAM controller and load your ELF into memory... Usually you'd use something like u-boot for that.
    it looks like i.MXS is a very old chip... I'm not sure it's worth the effort unless you have some existing hardware you absolutely cannot change
    Steve Biedermann
    @hardliner66
    we use a custom built yocto linux
    changing it is not really a possibility. our board is deployed a few 100000 times at the very least. We have older boards too, but right now i'm just checking if we can run ada code at all
    Simon Wright
    @simonjwright
    @hardliner66, you presumably have a host environment, I’m guessing Linux, where you cross-build code to run under Linux on your target board. If you can run GNAT on your host, you’re I’d expect most of the way there.
    You might find the basis of an approach in the first half of this script runs an x86_64 Ada-capable compiler (on an M1 Mac; not sure this is necessary) to build an x86_64 cross compiler to aarch64 (Apple silicon), which might be all you need; the second part uses that to build a native aarch64 compiler, which you wouldn’t need unless you want to compile on the target.
    Of course, there’s a whole load of mac-isms in there!
    Steve Biedermann
    @hardliner66
    Thanks a lot. I'll have a look.
    Simon Wright
    @simonjwright
    I think I may have failed to mention a couple of points:
    Macs (x86_64, aarch64) are very very similar; you’ll probably need to have a copy of the target libraries on the host system; the last time I did this was in 2005 or so, linux / vxworks 5.3
    In all cases, building a cross-compiler is best if you have a host compiler built from the same sources.
    1 reply
    ethin
    @ethindp:the-gdn.net
    [m]
    I feel like we need an Ada compiler that's purely LLVM-based so we can avoid the msys2 weirdness on windows. Or try to. I just set up Alire using the installer and bash kept giving memory sigbase mismatches or something like that... The error was the familiar 0 [main] bash (2588) C:\Users\ethin\.cache\alire\msys64\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1289408/0x11D9408. The fact that errors like this still happen is just ridiculous IMO.
    The odd thing is that I don't really have multiple cygwin installs on here. I mean I have the coreutils package and related friends from Scoop.sh but still...
    Ah, it seems to be ASLR related. Will go mess with that -- though why these binaries don't have ASLR enabled by default nowadays is beyond me
    ajdude
    @ajdude:matrix.org
    [m]

    I've published the initial release of an installer for alire: https://github.com/AJ-Ianozi/getada

    I try to be clear in the readme, and I put some more details here: https://www.reddit.com/r/ada/comments/yzx6hz/getada_an_unofficial_installer_for_alire/

    Смаколик
    @cmakoluk:matrix.org
    [m]
    1 reply
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Irvise: do you think AURA needs to be in pkgsrc? https://annexi-strayline.com/blog/posts/4 or gcc-aux is enough for now ?
    3 replies
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    With that, we would have a base to do pretty much the rest.
    Maxim Reznik
    @reznikmm
    Advent of Code - an online programming challenge has started today. Join us with Ada (or even SPARK) solutions and have a fun! 🥳
    1 reply
    Maxim Reznik
    @reznikmm
    Unofficial Advent of Code survey has Ada in the programing language list :)
    Jasen Qin
    @hyperswine
    coming from rust, is alire like cargo with cargo.toml, unit & integration testing, examples, docs, etc?
    Fabien Chouteau
    @Fabien-Chouteau
    @hyperswine Alire is also a package manager with a similar workflow, but unit & integration testing, examples, docs are not as well integrated at the moment.
    Doesn't mean you can do "unit & integration testing, examples, docs", but it will be different than how you do it with cargo.
    We have a work-in-progress :registered: repo that explain the Alire workflow: https://github.com/alire-project/ada_spark_workflow
    Jasen Qin
    @hyperswine
    oh I’ll check it out :thumbsup:
    Barry Houser
    @barryhouser:matrix.org
    [m]
    Does anyone know how to attach a python debugger to Gnat Studio?
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    Barry Houser: this is just me guessing. But you could drop into the gdb terminal window and then do whatever setup you need there to connect the Python process... But this is just me guessing.
    GNAT Studio uses GDB basically.
    Barry Houser
    @barryhouser:matrix.org
    [m]
    I just read AdaCore's recently released "Introduction to Embedded Systems Programming" by Patrick Rogers. It's an excellent source of information on not only how to approach embedded systems development, but covers some of the more advanced, rarely discussed areas of the language. I was delighted when it directly addressed an issue I've been grappling with. While Ada encourages high-level abstractions when specifying a model, such as representing a device's status flags as boolean fields in a record, or defining a bank of registers as an indexable array of 32-bit unsigned values, it's unclear how they're implemented at the low level. Specifically, will the compiler wastefully generate a sequence of load and store instructions when setting several status flags in a record to true, or will it efficiently reduce those assignments into a bit mask and set them in single operation? The guide goes into depth how aspects such as atomic, volatile and full_access can specify the intent at the machine level. Coming from other languages such as C/C++, the ability to write code at an abstract level, instead of dumbing it down for the sake of the compiler has been an incredible revelation. The guide is a must read for not just embedded Ada development, but for all Ada development!