-
Notifications
You must be signed in to change notification settings - Fork 8.2k
board: arduino: portenta_h7: Add support for various peripherals. #70530
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
board: arduino: portenta_h7: Add support for various peripherals. #70530
Conversation
45dd141 to
a629842
Compare
|
After further testing, |
|
Hello, sorry for the delay. Tried your PR on a Portenta H7 and could not get the clock to stabilize. This is the backtrace from a This was after doing this: The board has the Arduino bootloader which is unaffected. The Portenta H7 is on a Portenta Max Carrier, but I see the same behavior also if I don't connect anything. |
So just tried running the sample against the commit and it is working: During development I noticed that the oscillator enable pin & ethernet release pins would not getting toggled correctly. This is done via the device tree via the regulator enable pin. Can you try completely powering the board off and turning it on after flashing? @pillo79 Thanks. |
Already done, no difference.
In either case, a double tap allows me to enter bootloader and reflash. |
I am using the arduino bootloader based out of the |
|
@pillo79 what version of zephyr sdk are you using? Have you tried running the blinky sample without any carrier board? I only use the breakout board for ethernet port access. |
|
@pillo79 would it make sense to add Arduino platforms to the MAINTAINERS files so that boards' PRs are correctly assigned? If you think it's a good idea, could you please take care of this? :) |
|
After looking into zephyr a little more, I realized the Murata 1DX chip is supported by hal-infineon: look at drivers/wifi/infineon/Kconfig.airoc:100 as well as driver/bluetooth/hci/Kconfig.infineon:75. If there is interest in trying to get this PR merged, I can spend some time and try to get that working as well. |
Sure, but let keep this for another PR. Let's complete review on this one first. |
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies @rahul-arasikere for dropping the ball on this.
I discussed this internally with the Portenta H7 folks and did some experiments this week on different boards. The issue I was having is related to the missing LSE clock on my board (see comment).
I can confirm that the PR works fine on a fully-populated board; however, there are a few changes to be made to clocks to keep in the design parameters.
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts
Outdated
Show resolved
Hide resolved
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts
Outdated
Show resolved
Hide resolved
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts
Outdated
Show resolved
Hide resolved
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts
Outdated
Show resolved
Hide resolved
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m4.dts
Outdated
Show resolved
Hide resolved
a629842 to
80ce426
Compare
|
@pillo79 I have implemented the requested changes, let me know if I need to change anything. |
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates and your effort. Found some minor issues that are easily fixable.
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_1_0_0 .overlay
Outdated
Show resolved
Hide resolved
boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_4_1_0.overlay
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add a paragraph on the different board revisions and LSE. Something along these lines (not a native speaker so feel free to adapt!):
The high precision low speed external (LSE) clock is only fully supported on boards with hardware revision 4.10 or greater. By default the internal source is used; to enable the use of the external oscillator, manually specify the hardware revision at build time (see :ref:`application_board_version` for information on how to build for specific revisions of the board).
Also, probably an empty line is required after the table? CI doc builds are down currently so I'm not sure 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, how to check the board revision we have on hand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is easy using the Arduino IDE and mbed_portenta core: just print out the output from boardRevision() (it's a uint16-packed major.minor combo).
In Zephyr, though, this functionality is not yet available. To get this information directly, you have to read the contents of the revision field of the PortentaBoardInfo structure that is flashed at memory address 0x801F000.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks, this might be added to the documentation.
Interestingly, running the STM32H747_getBootloaderInfo Arduino sketch does print a lot of information but not the board revision if we are not in Secure mode (magic == 0x85)
Previous clock frequencies were taken directly from the arduino example and were limited to 96 MHz and 48 Mhz for the CM7 and CM4 respectively. Updated the clock tree to take advantage of the faster clock speeds. Introduced two board revisions as revision 1 of the portenta board does not have the external LSE oscillator populated (default) and version 4.1 onwards does have the external oscillator populated. The user can choose to build support for the required clock configuration using the revision scheme built in to west. Updated the docs to reflect the same. Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
80ce426 to
4ed2c58
Compare
|
I have tested this PR on my Arduino Portenta H7. But I have noticed this warning: With the Arduino Portenta Breakout board, I have managed to test Ethernet by adding: and I could run the following samples: I am curious about this line in the defconfig: What is it supposed to provide? Isn't the An nice addition for a new PR would be to automatically go to the bootloader when the serial baudrate is set to 1200 bauds, as done by the Arduino IDE. |
That must be a holdover from when I was trying to build mcuboot. However I would first need to support the nxp pmic first as I learned from soft bricking one board. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Odd indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Odd indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Odd indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Odd indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, there is now a new usage of reg property to encode the actual memory address mapping to be taken into account.
See #68274
reg = <0x90000000 DT_SIZE_M(16)>; /* 128 Mbits */
Note also the unit that might need to be fixed. I let you check this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling the USB stack is application responsibility. I propose to provide USB settings in .defconfig file under if USB_DEVICE_STACK condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the arduino IDE you would use the USB stack to talk to Serial port. Would it not make sense to have the USB enabled by default for this board?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this long line
|
@romainreignier that is a good tip about the L2_ETHERNET config, I have added the if ETHERNET config to Kconfig.portenta_h7 file. |
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rahul-arasikere for this contribution! Tested on both board revisions with no issues.
|
@erwango can you take another look? |
For BLE enabling - you can refer to arduino/giga_r1:
For Wi-Fi part, so far it is not supported for STM32H7 because of missing SDHC driver for this platform. |
|
@npal-cy I notice that the st chip has a sdmmc driver, would that not work with the wi-fi driver? I have not looked too hard at it yet. |
It will not work. it should be sdhc driver. stm32 disk driver does not have needed API. |
ebdd1f7
ebdd1f7 to
46fe41d
Compare
|
Should have got all the formatting issues in the devicetree files. @erwango |
46fe41d to
75c156a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was correct
d553d9f to
475c55e
Compare
Enabled the flash memory controller node along with the necessary pin muxing. This allows us to interface with the additional 8MB of external SDRAM available on the Portenta H7 board. This has been tested minimally with the tests/drivers/memc/ram test. Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
475c55e to
accad55
Compare
Enabled the QuadSPI node and necessary pin muxing to enable interfacing with the external flash chip on the Portenta H7 board. The jedec data was validated with the samples/drivers/jesd216 project to extract the JEDEC data. Additionally added `flash` to the list of ignored tags as the flash driver should not be built on the M4 CPU domain. Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
Enable the mac node along with the necessary pinmuxing to enable the ethernet and usb hs peripheral. I additionally defined the `ethernet_phy_en` node the uses a fixed regulator to release the PHY reset. Additionally an usb_cdc_acm node was defined to enable serial over usb for the console. Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
Updated the docs to reflect changes to devicetree files. Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
accad55 to
57663c3
Compare
I have been developing with the Arduino Portenta H7 with the machine controller shield and I had noticed some of the peripherals were not enabled in the device tree. As such I have enabled a few of them and done some basic testing to ensure they work.
I have opened this pull request to see if there was any interest in merging them upstream and plan to in the coming few weeks to add support for the additional features of the board in a seperate pull request.
This pull request adds support for the following:
The remaining work required to fully support this board is the following:
I would appreciate any feedback or comments on this pull request. Thanks.