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

Updates necessary because of rp2040-pac update to v0.6.0 #770

Merged
merged 17 commits into from
Feb 24, 2024

Conversation

AkiyukiOkayasu
Copy link
Contributor

This is a proof of concept regarding rp-rs/rp2040-pac#91.
It is not yet suitable to be merged.

Still some work to be done and will be updated from time to time.

@AkiyukiOkayasu
Copy link
Contributor Author

I have finished making changes to my updated PAC for use at HAL.
When a new version of rp2040-pac is released, I will need to remove the following.

https://github.com/AkiyukiOkayasu/rp-hal/blob/bd428da43df775eba855fcb9c52af119359d532d/Cargo.toml#L11

@AkiyukiOkayasu
Copy link
Contributor Author

I noticed that dma_spi_loopback_u16 and dma_spi_loopback_u8 in on-target-tests are no longer terminating.

transfer.wait() is no longer terminating.
https://github.com/AkiyukiOkayasu/rp-hal/blob/bd428da43df775eba855fcb9c52af119359d532d/on-target-tests/tests/dma_spi_loopback_u16.rs#L126

@jannic
Copy link
Member

jannic commented Feb 19, 2024

I noticed that dma_spi_loopback_u16 and dma_spi_loopback_u8 in on-target-tests are no longer terminating.

transfer.wait() is no longer terminating. https://github.com/AkiyukiOkayasu/rp-hal/blob/bd428da43df775eba855fcb9c52af119359d532d/on-target-tests/tests/dma_spi_loopback_u16.rs#L126

I found the bug: AkiyukiOkayasu#1

Overall, it looks like the updated PAC does work, but we need to carefully check that there are no more bugs of that kind in the ported rp2040-hal. Anyway, I think we can merge rp-rs/rp2040-pac#91.

@jannic
Copy link
Member

jannic commented Feb 19, 2024

A quick search found three more occurrences of that pattern, which are likely bugs as well:

$ rg "&.*\(\) as"
rp2040-hal/src/adc.rs
697:        DmaReadTarget(&self.adc.device.fifo() as *const _ as u32, PhantomData)

rp2040-hal/src/uart/reader.rs
247:        (&self.device.uartdr() as *const _ as u32, u32::MAX)

rp2040-hal/src/uart/writer.rs
203:        (&self.device.uartdr() as *const _ as u32, u32::MAX)

Right now I'm too tired to check and fix them. And the regex might be too simplistic to find all instances.

@AkiyukiOkayasu
Copy link
Contributor Author

Thank you for fixing it.

Perhaps these may also be bugs. I will check when I have time.

rp-hal/rp2040-hal/src/pio.rs

Lines 1431 to 1436 in e175d2a

fn rx_address_count(&self) -> (u32, u32) {
(
&unsafe { &*self.block }.rxf[SM::id()] as *const _ as u32,
u32::MAX,
)
}

rp-hal/rp2040-hal/src/pio.rs

Lines 1625 to 1630 in e175d2a

fn tx_address_count(&mut self) -> (u32, u32) {
(
&unsafe { &*self.block }.txf[SM::id()] as *const _ as u32,
u32::MAX,
)
}

@AkiyukiOkayasu
Copy link
Contributor Author

AkiyukiOkayasu commented Feb 22, 2024

@jannic I think I have no more to fix. Please give your review.
Assuming there is no problem with this PR, pac v0.6.0 release is needed before merging.

@jannic
Copy link
Member

jannic commented Feb 22, 2024

@jannic I think I have no more to fix. Please give your review.

I already looked through all the changes, they look good to me. I'll do the final approval as soon as it can actually be merged, ie. when pac v0.6.0 is released.

If we decide to include the new naming scheme from rust-embedded/svd2rust@30eb398 in rp2040-pac 0.6.0, we need to update rp-hal as well.

In any case, I don't want to delay this much longer. If there's no new release of svd2rust really soon now, we should go with what's available now, merge rp-rs/rp2040-pac#92 as it is, release pac v0.6, and merge this pull request. And then release rp2040-hal 0.10.0 as well.

@jannic jannic added this to the 0.10.0 milestone Feb 22, 2024
This obsoletes the patch.crates-io entry
@jannic jannic changed the title Updates necessary because of rp2040-pac update Updates necessary because of rp2040-pac update to v0.6.0 Feb 24, 2024
@jannic jannic merged commit c11fed9 into rp-rs:main Feb 24, 2024
6 checks passed
@AkiyukiOkayasu AkiyukiOkayasu deleted the update-pac-v06 branch February 29, 2024 04:49
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

Successfully merging this pull request may close these issues.

2 participants