Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Submission] Open source proposal: enhancement of embedded Rust libraries (testing) #1673

Merged
merged 12 commits into from
Apr 9, 2022
37 changes: 31 additions & 6 deletions contributions/open-source/maiga-jolov/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Title

Contributing to Rust Embedded ecosystem to improve developers experience.
Contributing to Rust Embedded ecosystem to improve developers experience. Submission on proposal #1587.

## Names and KTH ID
- Johanna Löv ([email protected])
Expand All @@ -16,15 +16,40 @@ Task 1

Contribution to open-source

## Description
### Description

As anyone would say, Rust is hot 😉. The Rust embedded ecosystem is also blooming to provide support to embedded platforms. For example The [Knurling project](https://github.com/knurling-rs) is an open source project to automate Rust Embedded development by providing Rust-native level of support.
As anyone would say, Rust is hot 😉. The Rust Embedded ecosystem is also blooming to provide support to embedded platforms. For example The [Knurling project](https://github.com/knurling-rs) is an open source project to automate Rust Embedded development by providing Rust-native level of support.

In Knurling
- `probe-run` is a custom runner to use Rust on embedded devices.
- `defmt` provides an effective logger for testing
- `flip-link` offers [stack protection](https://github.com/knurling-rs/flip-link). When sensitive memory regions are reached, compilation fails instead of undefined behaviour.

`defmt` can be improved with missing [type hints](https://github.com/knurling-rs/defmt/issues/660)
`flip-link` needs some enhancements to improve developper experience: a new parser to check that the memory.x file (a file that describes memory regions) is in the right format, and if not, reformat it. It also needs support for arithmetic operations and [some debugging](https://github.com/knurling-rs/flip-link/issues).
`flip-link` needs some enhancements to improve developper experience:
`rust-lld` is a [linker](https://nxmnpg.lemoda.net/1/ld.lld) for GNU files. `flip-link` should accept the same files as `rust-lld`. Currently, some memory.x files (describing the memory) are not accepted by `flip-link` while being accepted by `rust-lld`. Meaning that developers must updates files by hand if they are incorrect.

This contribution can fit in CI/Testing as it automates necessary work that was precedently done manually (i.e. a human needed to check if files were formatted correctly to avoid failure), and support for testing programs.
This OSS contribution fits in CI/Testing as it automates necessary work that was precedently done manually (i.e. a human needed to check if files were formatted correctly to avoid failure), and support for testing programs.

1. We added in total 7 tests to [manage input](https://github.com/knurling-rs/flip-link/pull/69) that is currently accepted by `rust lld`, to make `flip-link` more resilient.
Target [PR](https://github.com/knurling-rs/flip-link/pull/69)

2. Fixed a [bug](https://github.com/knurling-rs/flip-link/pull/70) about arithmetic operations handled incorrectly:
Issue [#65](https://github.com/knurling-rs/flip-link/issues/65) Easy bug


Self-assessment


| | Yes | No |
| ----------------------------------------------------------------------------------- | --- | --- |
| bug: The contribution fixes bugs | Yes | |
| documentation: The contribution improves documentation |Yes* | |
| feat: The contribution adds new features | Yes | |
| difficulty: The contribution is a difficult piece of engineering | Yes** | |
| conversation: There is an interesting engineering conversation with the maintainers | Yes | |
| merge: The contribution is merged in the main branch. | Yes | |

\* Added documentation on the components.

** It is quite a hefty code base that we needed to dive in.
The change we got merged was not a difficult piece of engineering, more code reformatting. But understand and rewrite a parser is more challenging.