Repository navigation
Conversation
73f7e49 to
1bf5a75
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18843 +/- ##
==========================================
- Coverage 98.42% 98.42% -0.01%
==========================================
Files 174 174
Lines 22334 22328 -6
==========================================
- Hits 21983 21977 -6
Misses 351 351 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Code size report: |
|
Hi @dpgeorge, I had the chance to check the PR and all is working smoothly😊 ! Only changes:
Still I am using the gcc-arm Infineon version, but I believe the official one should work as well. Honestly, I am unaware of the actual differences 😅 I would say the Regarding all the includes, flags, etc. How did you choose them? Manually copied from the MTB build output? Or did you use any other reference? I also see you added manually some of the Thanks! |
Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
1bf5a75 to
4077e29
Compare
Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
4077e29 to
012b2c1
Compare
Signed-off-by: Damien George <[email protected]>
4e1828b to
a4868f5
Compare
|
@jaenrig-ifx thanks for checking out this PR!
You are right, I missed that bit. I've now added it.
Yes that's necessary, depending on where you have them installed. But it was hopefully easy to do, just
Right. It shouldn't matter which gcc you use, as long as it's modern enough to support Cortex-M33 it should work.
OK, I've now changed that, moved
I just added the minimal set of flags needed to get it building and running, through trial and error adding files and flags until it would compile. I did not look at MTB. Well, I also knew from experience what a Cortex-M33 needs (eg
Right. There are a few approaches we can use here:
All options are pretty easy to get working. I would prefer option (2). Let me emphasize that while I do like this PR for its simplicity and similarity with other ports, we do not have to go with this approach if it doesn't work for you. We need to find something that works for both sides (for us maintainers and for you/Infineon). If we can get this PR into a state where you are happy to work on it and extend it, that would be great! That's also my preferred option. But if that doesn't work, at the very least we can hopefully use some ideas from here to improve your PR #18554. |
|
I also added CI in this PR to build the new |
|
Hi @dpgeorge, From the preliminary exploration, and after checking with the team, it seems reasonable for us to go with this approach. We understand that for the general MicroPython perspective, the harmonization of port integration eases the maintenance and support. I will take this PR and refactor our current fork's main branch (which enables a few more features already) based on it, and confirm that there isn't any major unforeseen issue. Give me some days to do that, and I will come back and we can discuss how to proceed with this PR, and eventually the upcoming ones. Thanks! Let me also reply here to comments and points you brought up in this draft PR and in the other PR #18554:
In general, we have based our development of features on reference examples provided by Infineon in ModusToolbox. With the provided working reference and pre-configured stack middleware libraries. In the case of the connectivity stacks, for example for PSOC6, this saved us quite some work to glue together LwIP, the transceiver driver, RTOS, etc. We could focus on enabling the I fully agree that we should strive for maximum reusability of existing MicroPython middleware. Still, in some cases, it might be more feasible from an effort and knowledge perspective to use the ModusToolbox-provided middleware, at least as a starting point. We can then later on refactor it to use the existing libs. I am sure we can discuss this on a case-by-case basis.
😊 Nice. Here we are not so experienced, and we find it handy to take the reference SDK examples to find out the right flags, includes, etc.
All good for me, I would also favor option (2) to have the latest CMSIS version available for all ports. (3) as an intermediate step if we break a lot of things with such a bump. Ideally, we can have a one-to-one mapping of the Therefore, preferably any other files such as
That already looks great, thanks! 😊 |
Excellent!
OK, I look forward to seeing the result. (I did try myself to enable UART interrupts to have a larger input ringbuffer (using the standard MicroPython approach with
Good that you agree we should try to reuse the existing MicroPython middleware code. I think we have good agreement as to the overall approach. Let's be pragmatic on a case-by-case basis, we can use ModusToolbox components if necessary.
Yes, I fully agree with that. Might be good to add a makefile target to regenerate these bsp files from ModusToolbox (assuming the latter is installed somewhere on the system).
Agreed. At least For now I will leave this PR as-is, and wait for your update. |
|
Hi @dpgeorge, Just a heads-up. As you can see in PR69, it was not so straightforward (at least to me) to handle the TrustZone and non-secure CM33 hex generation. The MicroPython application is hosted in the non-secure section of the CM33, but the boot for the non-secure part needs to be triggered always from the secure enclave. We are taking as reference the SDK projects and examples, in which a separate .hex is built for each of the cm33 secure, cm33 non-secure, and cm55 (which isn´t used/enabled here). We are wrapping up the HIL testing enablement, and making this our main fork branch. And from there we will create a new PR. Thanks! |
Ah yes, I thought this might be an issue. I saw your original port #18554 created a secure "bootloader" that jumped into a non-secure MicroPython application. But then I also saw zephyr do everything in secure mode, ie the zephyr application boots into secure mode and stays in secure mode for the entire application. So that's how I did it in this PR, and it seemed to work OK. I don't know the exact details and pros/cons of running in secure vs non-secure mode for the PSOC Edge. I'm keen to see your new PR and learn how you approached this problem. |
Yes, I am not well versed either. My current understanding is basically that there are limitations and/or additional considerations when handling memory regions and peripherals from the secure mode. The benefits would be the secure features: data protection, firmware integrity, encrypted storage, protected communications... I took your implementation to start with, but soon when I added some additional enablement it was not working anymore. The linker script was not the same provided by the BSP repo so the GC would just worked, the initial version was implemented for the non-secure part, and my zero experience with the secure mode. Thus, I decided to conservatively get things running as they were: minimal secure boot + micropython in non-secure😊 While we don´t need to leverage the actual secure features, not sure if we will benefit from running everything in secure mode other than simplifying the build with a single hex. Anyhow, this not an approach that can't be changed in the future as we learn further 😊 |
|
Closing, superseded by #18910. |
Summary
This adds a new port to PSOC Edge MCUs. It is intended as a proof-of-concept alternative to #18554 that aims to be as minimal as possible. It includes most of the SDK components as git submodules. Aside from the usual
arm-none-eaib-gcctoolchain that can be installed in most Linux distributions, it only needs:Testing
Tested on KIT_PSE84_AI board, a UART REPL is available.
Trade-offs and Alternatives
The
bspfiles added here don't seem to be available in any existing git repository, so they were added verbatim (from my understanding, they are generated by Modus Toolbox). That's similar to how the mimxrt ports board support files are handled (generated files added verbatim).