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

Migrate to embedded-hal v1 #66

Open
niondir opened this issue Jan 11, 2024 · 7 comments
Open

Migrate to embedded-hal v1 #66

niondir opened this issue Jan 11, 2024 · 7 comments

Comments

@niondir
Copy link
Member

niondir commented Jan 11, 2024

Since the embedded-hal v1 is released now, it would be great to have support in FreeRTOS-rust

See: https://blog.rust-embedded.org/embedded-hal-v1/

Since it's only a dependency of the examples. I assume only the examples need to be adjusted.

@TakashiKusachi
Copy link

Hello @niondir, @schteve and all.
I'm very interested in this project. So, I hope I can contribute to this project from this issue.

However, I have some question for this issue,
Firstly, What the goal of this task.
e.g.,

  • update the example of stm32-cortex-m4-blackpill only. I think CI test is passed with this fix.
  • update the example of all examples existed in this repository.

@TakashiKusachi
Copy link

currently, I created the modification on this MR TakashiKusachi#1 based on ("update the example of stm32-cortex-m4-blackpill only. I think CI test is passed with this fix.")

@schteve
Copy link
Collaborator

schteve commented Jun 30, 2024

I think the goal was just to replace any use of pre-1.0.0 embedded-hal with 1.0.0
A quick look shows the embedded hal is only explicitly used in the blackpill example and your PR link shows that doesn't cause much of an issue to upgrade.
The cortex-m3 example uses embedded hal indirectly (through the stm32 crate re-export. Looks like they don't have a newer version that supports embedded-hal 1.0.0 though, so I'm not sure if that one can be upgraded.

@TakashiKusachi
Copy link

Thanks for reply @schteve .

The cortex-m3 example uses embedded hal indirectly (through the stm32 crate re-export. Looks like they don't have a newer version that supports embedded-hal 1.0.0 though, so I'm not sure if that one can be upgraded.

Ah.., I had missed this.

@TakashiKusachi
Copy link

TakashiKusachi commented Jun 30, 2024

Currently, "cortex-m" and "cortex-m-rt" crates depend to all arm-platform examples as same version.
However, I think it have a concern.
So, I think there is some HAL(hardware abstraction layer) crate that use different "cortex-m" and "cortex-m-rt" " versions between arm platform. current Cargo.toml is not support different cortex-m version.
I specified each version of cortex-m for each individual platform and made it dependent, but it seems that another problem occurs. Sorry I can't fix them.
image

image
https://github.com/TakashiKusachi/FreeRTOS-rust/actions/runs/9730044292/job/26852635869?pr=1

@schteve
Copy link
Collaborator

schteve commented Jul 1, 2024

Yeah it doesn't seem to work, I assumed the cargo dependency resolver would allow different versions for each target but I guess that's not the case. I think it's the cortex-m-rt specified for target_arch = "arm" (which really just seems to be needed for the 9160 - removing it and the 9160 makes it work for me).

I'm getting linker errors on the 9160 example as-is so it looks to be already broken. Again if I delete the other examples dependencies then this build works so seems like something is interfering between them. Not sure what.

@TakashiKusachi
Copy link

Thanks @schteve,
Umm, It seems possible just by looking at https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
I tried to resolve this problem with some methods that do not change the directory structure but I have not resolved it.

I think it is better that this problem is resolved with #32.
This problem is due to an attempt to support multiple platforms with a single cargo.toml in the first place. there is the case of conflict that the same target-triple but not the same environment.

I will look at this issue #32 and try to do this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants