SterlingPeet / fprime-arduino

A platform support library allowing fprime to be run on a limited number of Arduino compatible devices.
1 stars 2 forks source link

Building math component for fprime-arduino platforms #15

Open capsulecorplab opened 1 year ago

capsulecorplab commented 1 year ago

Shot in the dark, but attempted to build the fprime-tutorial-math-component project using @ethancheez's fprime-arduino fork on the rpipicow branch with the config folder and settings.ini (with default_toolchain set to rpipicow) from fprime-arduino-led-blinker, but encountered a few cmake errors Screenshot from 2023-07-24 14-42-14 Has anyone else had more success attempting to build the math component for an fprime-arduino platform?

ethancheez commented 1 year ago

Currently the math component tutorial does not support baremetal because it uses Linux drivers.

capsulecorplab commented 1 year ago

Ah, that makes sense

ethancheez commented 1 year ago

If you want, you could create an Arduino version of the math component tutorial. The Components/ directory would remain untouched. Then you can use my Arduino cookiecutter to create an Arduino-based MathDeployment by following this from my fprime-arduino-led-blinker tutorial. Then, add the Math components to your topology.

capsulecorplab commented 1 year ago

This might be cheating, but I just forked the fprime-arduino-led-blinker and added the math components (with deployment + updated topology) here :upside_down_face: So far, the build seems to be working~

Screenshot from 2023-07-24 23-14-40

Will have to try to build/port/test the deployment for the rpipicow tomorrow morning...

capsulecorplab commented 1 year ago

Not much luck with trying to build the math component for the rpipicow :confused:

Screenshot from 2023-07-25 16-31-20 Screenshot from 2023-07-25 16-32-24 Screenshot from 2023-07-25 16-33-24 Screenshot from 2023-07-25 16-34-23 Screenshot from 2023-07-25 16-34-50

ethancheez commented 1 year ago

I can give a few pointers right now (I was able to deploy math component on my Teensy), but I will be able to help more in detail later today.

After taking a peek at your fork, the MathDeployment/ directory you have is still built for Linux systems. Instead, you can directly add the math instances to the LedBlinker deployment.

You also need to edit the config/ files as those configurations were specific to the fprime-arduino-led-blinker project. Or, you can use the default config inside of fprime/config/ if you are using a board with sufficient memory (i.e. Teensy 4.1).

capsulecorplab commented 1 year ago

Still waiting on my Teensy 4.1 to arrive in the mail, so just testing with the rpipicow for now~

What should I look out for as far as editing the config files?

ethancheez commented 1 year ago

Still waiting on my Teensy 4.1 to arrive in the mail, so just testing with the rpipicow for now~

What should I look out for as far as editing the config files?

The main ones are the telemetry configurations (TlmChanImplCfg.hpp) and command dispatcher (CommandDispatcherImplCfg.hpp). The macros defined in here depend on how many components/commands/telemetries you have.

ethancheez commented 1 year ago

Feel free to take a look at this.

Bug that needs fixing: Since there's no file system on baremetal, there is no prmDb component so the initial parameter values cannot be loaded (hence the loadParameters() is commented out). Before sending the mathSender.DO_MATH command, send the mathReceiver.FACTOR_PRM_SET command with a val of 1.