Searching a good Embedded Development Setup

I want to do more embedded ada development. I had setup alr on my laptop to build and push on an stm32 device. But having three terminals open just to develop and debug the device has become tiresome. And I also want to develop on the go and on my desktop.

My current plan is to setup a raspberry pi where I would only have to ssh into. The stm32 device is connected to the pi, the pi has a camera to get a live feed of the device+peripherals and a code editor. I would ssh into the pi where I code and push the build and watch the device from the camera

Does anyone have a setup like this, tips, tricks or guides to similar setups?

I would guess that there is already something that does this but I haven’t been able to find it.

Nvm. I just bodged something together.

The only thing missing now is an editor. But I dont think that installing an entire editor is practical. Will have to look into integrating an editor using ssh somehow.

Btw. Here is some code I threw together. It now compiles and works!

with STM32F303;      use STM32F303;
with STM32F303.RCC;  use STM32F303.RCC;
with STM32F303.TIMs; use STM32F303.TIMs;
with STM32F303.GPIO; use STM32F303.GPIO;

with HAL; use HAL;

procedure Main is
   Counter_Value : HAL.UInt16;
   Wait_Time : HAL.UInt16;
begin
   -- Init LED PB0
   RCC_Periph.AHBENR0.IOPBEN := True;
   GPIOB_Periph.MODER0.MODER0 := HAL.UInt2 (2#01#);

   -- Init Timer
   RCC_Periph.APB1ENR0.TIM7EN := True;
   TIM7_Periph.PSC0.PSC :=
     7_999;  -- Prescaler: 8 MHz / (7999+1) = 1 kHz (1ms per tick)
   TIM7_Periph.ARR0.ARR := 1_000;  -- Auto-reload value: 1000 ms = 1 sec
   TIM7_Periph.CR10.CEN := True;  -- Enable TIM7

   -- Set Wait Timer
   Wait_Time := 1000; 

   while True loop
      -- set LED on
      GPIOB_Periph.ODR0.ODR0 := True;

      -- wait 500 milliseconds
      TIMs.TIM7_Periph.EGR0.UG := True; --update event
      loop
         Counter_Value := TIMs.TIM7_Periph.CNT0.CNT;
         exit when Counter_Value >= Wait_Time; -- Wait for the desired time
      end loop;

      -- set LED off
      GPIOB_Periph.ODR0.ODR0 := False;

      -- wait 500 milliseconds
      TIMs.TIM7_Periph.EGR0.UG := True; --update event
      loop
         Counter_Value := TIMs.TIM7_Periph.CNT0.CNT;
         exit when Counter_Value >= Wait_Time; -- Wait for the desired time
      end loop;
   end loop;
end Main;

using startup_gen and svd2ada

You can take a look at GitHub - gabriele-galeotti/SweetAda: Ada-language framework or Renode (as documented for Ada in Getting Started with Renode: Simulating an Ada… | The AdaCore Blog). They both use emulated boards (QEMU or Renode) to play around.

You can also run Emacs over SSH (TRAMP mode) or vim/neovim over ssh without any issues!

Best regards,
Fer

Would you mind posting some sort of set of steps/example scripts for future people to use? You know enough to get something working - but not all of us are as well-educated, good-looking, or smart as you :slight_smile:

1 Like

First of all. Thank you for those flatering words!

I do plan on posting my setup! I just haven’t gotten around to do so :sweat_smile:. Sadly I can’t promise that I’ll be able to post a good setup guide this year (too much school work :upside_down_face:). I will try to write it as beginner friendly as possible. Except for the pico docs there aren’t that many great embedded ada guides.

Since starting my small embedded journey I have found alot about ada development. There are some things I would do differently now. Like using github runners on the pi. I’d push my code and it would automatically build and run on the embedded system. No need to ssh anymore. I also got a camera for the pi! (But I still have to set it up tho)

Currently my pi and stm32f3dev board are collecting dust but once I have the time I’ll make a guide on the development setup and finally try to port the light-tasking runtime. That is my end goal!


(Picture of a clear box with the stm32f3development board connected to a raspberry pi. The stm32 is connected to a breadboard with an led blinking every second)

Where are you going to school, and when do you graduate?

I’d rather not say. I do not know you and I am wary about posting personal information.

I can give a rough estimate tho.

I live in Europe and I am currently pursuing my Bachelor’s Degree in Computer Science.