Repository navigation
Added New Port PSOC Edge (II) - #18910
Conversation
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18910 +/- ##
==========================================
+ Coverage 98.51% 98.55% +0.03%
==========================================
Files 179 179
Lines 23243 23244 +1
==========================================
+ Hits 22899 22908 +9
+ Misses 344 336 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@jaenrig-ifx thanks for posting this PR, upon first glance it looks really great! I was able to build it without any trouble and deploy it to the E84-AI board. And the REPL appeared. Excellent! I will look at it in more detail. If you want something to work on, see if you can get $ ./tests/serial_test.pyThat should automatically connect to the device (assuming it's the only thing plugged in) and run the test. It currently fails (for me). To get it working, you'll probably need to implement the UART RX IRQ and store incoming characters from the UART into a stdin ringbuf, and make that ringbuf around 260 bytes big. See |
Perfect, glad to hear 😊
Ok, let us take care of that soon. 👌 We have some |
|
@jaenrig-ifx I'm wondering what the next steps are with this PR. Are you working on the serial port improvements? Or are you waiting for a more detailed review from me? I think the general approach here is good, so I'm happy to go through and make detailed comments to get this ready for merging. |
|
Hi @dpgeorge! @jaenrig-ifx is on vacation until mid of next week, so I'm jumping in. We're planning to take the serial port improvements together with enabling the For the next steps it would be great to get a more detailed review from your side, so that we can soon work on the improvements and clear the path to get this PR merged. Thanks! |
dpgeorge
left a comment
There was a problem hiding this comment.
I've done a first-pass review of this PR.
91cec0b to
4282abf
Compare
|
@jaenrig-ifx thanks for responding to my review. From your side, how much is left to do here? Is it just the UART that you are working on, or other things as well? |
Focus for me and left to do for this PR:
In parallel my colleagues are working on these:
Some of them have a good coverage of features already, and available in our main. But we will open subsequent PRs for each of them once this PR is handled😊 After that, we plan further coverage of the If you think that is convenient to prioritize the enablement of other certain features before, maybe that can be aligned with @ederjc. |
If we can tick off these 3 items of yours (UART, mpy-pse.py, cmsis) then I think this PR will be very close to merge. |
Hi @dpgeorge , The latest commits should complete these 2 issues. I tried not to add more files than necessary, but some alternate functions enablement extra sources has been also added or extended to support the
We look forward to your feedback 😊. |
|
Thanks @jaenrig-ifx for updating. It's looking really very good now! I managed to build the firmware straightaway without any issues (just needed I see that it has a filesystem using external QSPI which is great. And I was able to run the test suite. Some initial feedback:
|
Thanks @dpgeorge for following up this PR! Great 👍 Glad to hear!
Done!
Yes. This does not make much sense: Based on the code comments, it seems some time functions might require some review. I'll work on it.
I added the option to pass an We could add this But to avoid the need of going through the MCU manual and lengthy docs to find the ids, we should provide as well a pinout diagram with the matching Still, one needs to physically connect those pins and locate them on the board. In that case, not sure if all this
Done!
Yes, the latest version also works. The minimum OpenOCD version is still v5.8.0, as this is the first supporting the PSOC Edge. |
|
@jaenrig-ifx thanks for updating based on feedback. My aim is to try and get all the existing tests passing on the KIT_PSE84_AI board (all the tests that can run on it, that don't automatically skip). We are getting there! Let's try to get the UART tests passing. Or at the very least running without locking the board up. Those tests are Starting with the basic # Target wiring for KIT_PSE84_AI.
# UART(5) is on P17_1/P17_0.
uart_loopback_args = ()
uart_loopback_kwargs = {"tx": "P17_1", "rx": "P17_0"}Then do Investigating, even constructing the UART is problematic: MicroPython v1.29.0-preview.291.g8ce0af4fcb on 2026-05-19; KIT_PSE84_AI with PSOCE84
Type "help()" for more information.
>>> import machine
>>> machine.UART(tx="P17_1", rx="P17_0")
UART(tx='P17_1',
rx='P17_0',
baudrate=115200,
bits=8,
parity=0,
stop=2,
flow=0,
timeout=0,
timeout_char=1,
rxbuf=256)
>>> machine.UART(tx_"P17_1", rx="P17_0")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: SCB 5 is already in use by another I2C, SPI or UART instance.
>>>So it's not possible to construct the UART a second time. On other ports this is possible, and probably to achieve that you need to pass in the SCB id (UART id) that you want to use, which in the case above is UART(5). From looking at the af tables, it seems that it's quite restrictive what UART is connected to what pins. That's similar to stm32, so we can handle it in a similar way:
Because the PSE84 has restrictions for the UART and pin mappings, the user really needs to know this in order to use the peripheral. You could also keep the existing functionality in this PR and let the SCB/UART id be auto selected based on the pins. But it should also be possible to manually select the UART id so you can reuse a UART if needed (without first doing I was also trying to create a UART on other pins (the ones connected to the header on the board) so I could connect it up in loopback mode, but that also failed. Eg: MicroPython v1.29.0-preview.291.g8ce0af4fcb on 2026-05-19; KIT_PSE84_AI with PSOCE84
Type "help()" for more information.
>>> import machine
>>> machine.UART(tx="P16_1", rx="P16_0")
(locks up here)and MicroPython v1.29.0-preview.291.g8ce0af4fcb on 2026-05-19; KIT_PSE84_AI with PSOCE84
Type "help()" for more information.
>>> import machine
>>> machine.UART(tx="P17_3", rx="P17_2")
(locks up here)I understand one of the UARTs is used for the REPL, but surely that's not the reason the above is locking up? |
|
A few other minor issues I noticed:
|
|
Hi @dpgeorge,
Thanks for taking the time and effort here 😊 Currently, we are just adding to our CI HIL basic functional tests (sunny side mostly) mainly our port enablement ( At a later stage, this should be iterated and reusable from For the rest of the tests, we are assume what comes from the upstream "works". I am aware that is a bit naive and that our CI coverage is low. It is just a matter or prioritization and capacity.
Let me run it, and make sure it works 😊
The current approach was more, you would call
I suspect (on |
|
A recap of the TODOs:
|
Here's my test run (run from
Once the target wiring is added (might be a good idea to add it in this PR, as the file I don't want the scope of this PR to grow too much, but getting the above tests passing will give this new port a solid foundation. And since the |
|
Understood 👍 |
|
@jaenrig-ifx CMSIS_6 is now available in master. |
2d360ae to
6965f60
Compare
|
Thanks for updating! Two minor issues:
|
207702b to
453ff80
Compare
Ups! I missed those. Thanks! 😊 |
|
I maintain mpbuild which tries to simplify building MicroPython boards; I thought you might be interested to know that I've added support for the psoc-edge. So, after installing mpbuild v1.2.0 ( The build container repository is build-micropython-psoc-edge-docker and the container is published to the MicroPython docker hub. |
Thanks a lot @mattytrentini ! |
c42f3cd to
453ff80
Compare
Signed-off-by: jaenrig-ifx <[email protected]>
Signed-off-by: jaenrig-ifx <[email protected]>
453ff80 to
24ab428
Compare
dpgeorge
left a comment
There was a problem hiding this comment.
This is looking really good. I retested on KIT_PSE84_AI and did not see any issues.
There are just two minor comments, and then we can get this merged!
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]>
The MicroPython application runs on CM33 core in non-secure mode. The core boot sequence requires the secure mode to start the non-secure mode. This minimal application is located in the secboot directory. The board bsp-cfg directory includes the PSOC Edge SDK generated sources for a given board support package. The following modules are already enabled: - time - VFS (LFS2) - machine.Pin - machine.UART - machine.RTC This enablement is a collective work of the following contributors: Co-authored-by: Damien George <[email protected]> Co-authored-by: Eder Julian <[email protected]> Co-authored-by: IFX-Anusha <[email protected]> Co-authored-by: NikhitaR-IFX <[email protected]> Co-authored-by: Ramya Subramanyam <[email protected]> Co-authored-by: zhanglinjing <[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]>
24ab428 to
e536f45
Compare
|
Merged!! Thanks @jaenrig-ifx and everyone else who contributed to this new port. It took a while but the effort was worth it, and it's now in an excellent state. |
Wonderful! 😊 The whole team here is very happy about this achievement. |


Dear @dpgeorge,
As discussed in previous PRs #18554 and #18843:
arm-none-eabi-gcc,edgeprotecttoolsand (infineon)openocdboards/KIT_PSE84_AI/bsp-cfgdirectory includes all the SDK generated sourcessecbootdirectory contains the minimal secure boot application to start the non-secure MicroPythontime,VFS,machine.Pinandmachine.RTCI look forward to hear your feedback 😊
Thanks a lot!