Josfemova / eos-s3-rs

Bringing support for the EOS-S3 in Rust
Apache License 2.0
9 stars 1 forks source link

Help getting started on development #5

Open shulltronics opened 1 year ago

shulltronics commented 1 year ago

Hi,

I'm interested in contributing to this project. I just got a Sparkfun EOS S3 Thing Plus, and would love to get some Rust code running on it. I have a decent amount of experience with Embedded Rust, but only on well-supported chips (RP2040, nRF528xx), and have never explored the process of creating a PAC or HAL from scratch. I understand the principle of mapping out the chip's registers in an SVD file and using the automated tools to convert to Rust structs, but have never actually performed the process.

Is this still a project that you are interested in pursuing? Are there any reasons that this might not be worth pursuing? With a little bit of guidance I would be happy to fork this repo and start trying to make some contributions. :)

Thanks!

Josfemova commented 1 year ago

Hello!

So quick answer to the last questions, yes, I'm still interested in working on this project, the reason why I've been unable to work on this is that my life changed quite a lot in the lasts months and free time has been scarce. That changes in about 2 weeks.

Is it worth pursuing working on this? I think it depends. I find it entertaining, but the EOS-S3 doesn't have a big user base. Perhaps the most interesting part is what follows after the hal/bsp, which is the tooling part. Having a comfy workflow with Rust+F4FPGA is one of the side-quests for this project. In didactic terms, imho is totally worth it. Touching SDK code is not only fun but also teaches you quite a lot.

About the status of the project, the SVD/PAC is basically done, but it can be improved with better documentation. It also needs to be regenerated from time to time if we want to be using the latest svd2rust features. It's currently just a basic SVD patched with a bunch of yaml using svdtools.

The HAL hasn't received any love yet. This includes the implementation of the bitstream loading functionality. I want to follow a similar style to whats done in atsamd-rs, specially in regards to type system usage.

We can further talk about this via twitter/telegram to coordinate. My handle for both is the same as the one for github.

wmaxfield commented 1 year ago

I saw your YouTube Video about debugging rust on eos-s3. There are no debug tools for EOS-S3, so how did you do this? J-Link? ST-Link? BlackMagic? I have a blog at socmaker dot com, and am interested in following through on getting a debug environment cheaply for this device. Thanks!

Josfemova commented 1 year ago

Hi @wmaxfield , I used a Xiao M0 I got for $4 and loaded the DAP-Link firmware on it. https://wiki.seeedstudio.com/Seeeduino-XIAO-DAPLink/

Pinout here: image

I think that's the cheapest way to get debugging working on the EOS-S3. Other probes supported by OpenOCD should work, but they are a bit pricier. I could try using a bootleg stlinkv2 to see if it works but I It would take me some time as a friend of mine has it in their house

wmaxfield commented 1 year ago

That sounds good. In USA, from Amazon, the sam21d XIAO is $10, so is still a good price.

OpenOCD requires a .cfg file. Did you create one for the EOS S3? If so, would you mind showing it?

Also, I would like to see the launch.json file you have for this. I am very new to all of this and my brain is overloaded.

I am debugging on the Macintosh, and currently using PSOC5 KitProg debugger stub. I wrote how to set it up on my blog.

What did you use to go from the large 0.1" (2.54mm) pin connector to the 1.27mm connector for the EOS-S3?

I will be getting a clone STLink V2 later, and will report on using it on socmaker blog.

Josfemova commented 1 year ago

@wmaxfield

About the VSCode setup, I used this as a guide: https://dev.to/rubberduck/debugging-rust-arm-cortexm-programs-with-visual-studio-code-336h

I kind of forgot the adjustments I had to make apart from changing the .svd file, basically just related to some configs being deprecated and so on, but Cortex-M debug had warning messages for that so I think you-ll just have to check the log to know what to update.

BTW I also got the Xiao M0 from Digikey.

Let me know If I can help you with anything else. I might be able to play around with my setup on the weekend, but work got me pinned down until then