Repository navigation
New port PSOC Edge - #18554
New port PSOC Edge#18554jaenrig-ifx wants to merge 14 commits into
Conversation
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18554 +/- ##
==========================================
- Coverage 98.38% 98.38% -0.01%
==========================================
Files 171 171
Lines 22300 22298 -2
==========================================
- Hits 21939 21937 -2
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @jaenrig-ifx , thanks for making this PR. I have taken a first pass look over it and have the following high-level comments.
|
|
Hi @dpgeorge, Thanks a lot for checking out this PR :)
|
Yes. If I click that link in Firefox or Chrome I get: Application is not available. The application is currently not serving requests at this endpoint. It may not have been started or is still starting. |
Same issue from Amsterdam |
OK, thanks for the explanation. I would then suggest removing it, in order to simplify this PR.
Aaah, you are right! My mistake. I see it's using docker to set up the build environment. That is then an alternative to downloading the Modbus Toolbox. Maybe using docker should be mentioned in the README, and perhaps be the preferred way of building? Although it's still good to be able to set up a build environment from scratch using Modbus packages. |
Fine, I´ll do so👍
Right, that is another alternative. I'd like to give it a try to see if there are any inconveniences during the local development flow, and polish it a bit. This is also part of our technical debt, as with the other PSOC6 port, we could reuse the same ModusToolbox toolchain container, and maybe some of the |
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
|
Hi @jaenrig-ifx . I now have a PSOC Edge E84 AI Kit dev board. It's a really neat board with lots of functionality! I tried to get this PR building and deployed on that board, but I had some troubles. I'm using Arch Linux so can't directly follow the README to get the Modus components installed, but I did manage to make some good progress (I could start up an Ubuntu VM, but I wanted to see if it could work with Arch Linux). Steps taken:
This is successful! I could build the board. It's a bit awkward setting everything up, but it does work. Then I tried to deploy it using I think that it cannot find the Modus programming tool. How does the toolchain find the programming tool, are there some environment variables that I need to set? I also noticed a lot of these warnings: |
|
Hi @dpgeorge, Thanks for checking out the port again Unfortunately, we have not tried out building MicroPython on Arch Linux. Neither the just ModusToolbox toolchain itself. You mention that you installed The Programming tools in step 3. But it seems that some tools are not yet in the system path? If possible I would try in Ubuntu. Thanks! |
|
I eventually managed to work out how to deploy the signed firmware to the KIT_PSE84_AI, using Infineon's custom version of OpenOCD. Doing that I got a REPL over UART on the board! So that's great. I then also tried out MicroPython's zephyr port, and was able to build that for the KIT_PSE84_AI as well (using Zephyr 4.3, which supports this board). And after deploying that build to the board I got a REPL as well. Note that zephyr does not need the Modus Toolbox to be installed, although it does still need the edgeprotecttools and custom OpenOCD. Instead of Modus it uses a set of git repositories with the relevant Infineon SDK code. These repositories are hosted by Infineon on GitHub, although Zephyr makes their own custom repo which combines many of the Infineon ones into a single, big repo. @jaenrig-ifx did you consider using the zephyr MicroPython port running on the PSOC Edge, instead of creating a new bare-metal port? A bare metal port does have its benefits, but leveraging zephyr would mean that a lot of the work is already done. Regarding this PR itself. The way the Modus Toolbox is set up and used, and the way the build is done, is rather complicated. The things that make it difficult are:
I was curious to see if all these issues could be overcome, so I made my own, minimal PSOC Edge port. See #18843. That has all the necessary SDK code as submodules (similar to Zephyr), uses standard At this point there are three different approaches to the PSOC Edge port:
@jaenrig-ifx what is your opinion on these three different approaches? From my point of view as a maintainer here, this PR would not be ready for merging without addressing point (3) above (making sure all build artefacts are in the build directory) and ideally also point (2) (not downloading during the build process). |
|
Dear @dpgeorge , Thank you for your reply. I am happy to see all the energy going into the PSOC Edge board. About enabling PSOC Edge through the Zephyr portWe are not considering the Zephyr approach. The enablement for the PSOC Edge might not cover the features that we would like to support in MicroPython. If I am not mistaken, it seems only a small subset of the features have been enabled so far: UART, GPIO, clock and memory. https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/infineon/kit_pse84_ai/kit_pse84_ai_m55.yaml Besides, our (working group's) influence on the Zephyr enablement is constrained, and the bare-metal port gives us the autonomy to grow the MicroPython support without dependencies on the Zephyr roadmap and priorities. Still, I don't see this as a mutually exclusive alternative to the bare-metal port. The Zephyr approach is always there as an alternative, and of interest depending on the use case and the level of enablement for each MCU/board. About why we are using ModusToolbox and removal concernsVery valid points and concerns. We are also aware of this and not fully satisfied with the ModusToolbox The reason we opted for this approach is mainly to delegate the Board Support Package (BSP) dependencies management and the integration of middleware libraries to ModusToolbox. My concern with getting fully rid of ModusToolbox is that it may become a bit more troublesome to maintain and keep up to date, when trying to support multiple boards and a large number of middleware libraries. About next steps and your requirements for mergeAnyhow, the current ModusToolbox approach isn't a hard requirement for us. Actually, easing the development and maintenance efforts is part of our goal. You already provided this new approach with that in mind, so give me some days to go through it, and find out more about its implications. Upfront, the requirement of bringing the build artifacts to the build directory does not seem hard to fulfill, even with the ModusToolbox in place, that would be just copying the output files to the MicroPython build directory. About the second requirement, not downloading the packages during the build. Technically, they are downloaded during the project settings. Definitively, adding each lib as a submodule is doable. Then: One of the issues I foresee is when/if multiple boards use different versions of the same library. Do you have such a situation in any port? And if so, how are you handling it? Another topic is all the code generation and configuration. This needs to be hardcoded and imported manually according to the BSP and subsequent potential modifications. As said, let me check your PR, and find out about the best ways to move forward 😊 |
Yes, I did spend quite some time with this PR, building using Zephyr, and creating my minimal port. Overall that has taught me a lot about this chip and the way it and the build system works. The PSOC Edge chip itself is really nice and I would definitely like to see it supported in MicroPython! Regarding Zephyr
I fully understand this point. A bare-metal port definitely gives more freedom. That's why we have a lot of bare-metal ports like stm32, mimxrt, samd and rp2.
Yes that's very true. OK, so the case for a bare-metal PSOC Edge port is clear, and we will concentrate on that. Regarding ModusToolbox
OK, so at least we agree that there are things to improve in this PR with respect to the build system. As I mentioned, to help with ongoing maintenance and support within this repo, the closer this new PSOC Edge port aligns with existing ports, the better.
Yes, that's definitely a valid reason to use ModusToolbox, to easily support multiple boards and libraries. As two counterpoints to that:
I think we should discuss in more detail point (2). For example TCP/IP: we use lwIP as the TCP/IP library and have a relatively mature (non-OS) integration of that with the bare-metal ports. It works very well, is pretty efficient, and we have spent a lot of time to make sure the Similarly with BLE, all the port needs to provide is a HCI UART/stream interface, and then MicroPython does the rest: using NimBLE or BTstack, and then our Hopefully that doesn't sound restrictive to you. After all, you didn't want to use the Zephyr port because you wanted more freedom with adding features. But I think there's still a lot of freedom to be had in a bare-metal PSOC Edge port, even if things like networking and BLE are provided by MicroPython. Next steps
Simply moving files could work. But isn't it possible to pass some setting through to ModusToolbox for the output location?
Maybe there can be a separate step (eg
Adding all required source as a submodule is definitely preferable. That seems awkward if different boards use different versions of a library. Do you have an example of that, of such a library? Can't we just make sure everything steps forward with new library versions in sync? As a related example, our lwIP bindings (in
Yes, it seems the BSP code is the hardest point to address. As an example, the mimxrt and renesas-ra ports do have generated BSP files that are committed verbatim to this repo. If you look at a renesas-ra board, eg Maybe we can have a separate make target (eg |
|
Closing this PR. Continued in #18910. |


Dear @mattytrentini, @dpgeorge,
This PR contains the basic enablement of PSOC Edge microcontrollers:
timemoduleSupported boards ->
KIT_PSE84_AIThanks for taking the time and effort to consider this contribution :)