-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/stm32/boards: Add WEACT_STM32H743 board. #12540
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
base: master
Are you sure you want to change the base?
ports/stm32/boards: Add WEACT_STM32H743 board. #12540
Conversation
Note: Currently only the 8M QSPI flash is available. There is an additional 8M SPI flash that is currently unused by this board definition. I'm not sure how best to add both... |
690eb56
to
46103a3
Compare
46103a3
to
479df8c
Compare
Hi @mattytrentini, good to see this being added. I've been using this board and was not sure if it was derirable to submit it. I've added some comments in your code. Additionally, you can look at my config below and files in the zip.
|
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.
Added some comments
// https://community.st.com/t5/embedded-software-mcus/issue-with-bootloader-on-stm32h743-using-boot0-and-inline/td-p/73183 | ||
|
||
// CAN buses | ||
#define MICROPY_HW_CAN1_TX (pin_B9) |
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.
Alternatively:
#define FDCAN_FILTER_RANGE ((uint32_t)0x00000000U) /*!< Range filter from FilterID1 to FilterID2 /
#define FDCAN_FILTER_DUAL ((uint32_t)0x00000001U) /!< Dual ID filter for FilterID1 or FilterID2 /
#define FDCAN_FILTER_MASK ((uint32_t)0x00000002U) /!< Classic filter: FilterID1 = filter, FilterID2 = mask /
#define FDCAN_FILTER_RANGE_NO_EIDM ((uint32_t)0x00000003U) /!< Range filter from FilterID1 to FilterID2, EIDM mask not applied */
// FDCAN bus
#define MICROPY_HW_CAN1_NAME "FDCAN1"
#define MICROPY_HW_CAN1_TX (pin_D1)
#define MICROPY_HW_CAN1_RX (pin_D0)
#define MICROPY_HW_CAN2_NAME "FDCAN2"
#define MICROPY_HW_CAN2_TX (pin_B13)
#define MICROPY_HW_CAN2_RX (pin_B12)
#define MICROPY_HW_CLK_PLLVCO (RCC_PLL1VCOWIDE) | ||
#define MICROPY_HW_CLK_PLLFRAC (0) | ||
|
||
#define MICROPY_HW_CLK_PLL3M (25) |
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 was using this, not sure which is better:
#define MICROPY_HW_CLK_PLL3M (5)
#define MICROPY_HW_CLK_PLL3N (48)
|
||
#define MICROPY_HW_UART2_TX (pin_A2) | ||
#define MICROPY_HW_UART2_RX (pin_A3) | ||
|
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.
There are some extra pins that can be mapped
#define MICROPY_HW_UART3_TX (pin_B10)
#define MICROPY_HW_UART3_RX (pin_B11)
#define MICROPY_HW_UART4_TX (pin_C11)
#define MICROPY_HW_UART4_RX (pin_C10)
#define MICROPY_HW_UART5_TX (pin_B12) // or SPI2
#define MICROPY_HW_UART5_RX (pin_B13) // or SPI2
#define MICROPY_HW_UART6_TX (pin_C6)
#define MICROPY_HW_UART6_RX (pin_C7)
#define MICROPY_HW_UART7_TX (pin_E8)
#define MICROPY_HW_UART7_RX (pin_E7)
#define MICROPY_HW_SDCARD_D1 (pin_C9) | ||
#define MICROPY_HW_SDCARD_D2 (pin_C10) | ||
#define MICROPY_HW_SDCARD_D3 (pin_C11) | ||
|
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.
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_D4)
#define MICROPY_HW_SDCARD_D3 (pin_C11) | ||
|
||
// USB config | ||
#define MICROPY_HW_USB_FS (1) |
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.
#define MICROPY_HW_USB_FS (1)
// LEDs
#define MICROPY_HW_LED1 (pin_E3) // blue
#define MICROPY_HW_LED_OTYPE (GPIO_MODE_OUTPUT_PP)
// NOTE: LEDs are active high.
#define MICROPY_HW_LED_OFF(pin) (pin->gpio->BSRR = (pin->pin_mask << 16))
#define MICROPY_HW_LED_ON(pin) (pin->gpio->BSRR = pin->pin_mask)
Thanks @JohnieBraaf! These additions look great, I just need to get my head around some of them and test them out. The CAN registers in particular are not familiar to me - and I'm not yet sure of the best clock domain configuration either. I'll try to find some time to spend with the reference manual this weekend! |
Good, yes I've spent some time in the datasheet as well figuring out those pins. Be sure to check the zip. You could test with that. Haven't build in couple months though, so it might need updates |
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0) | ||
|
||
// Clock config | ||
#define MICROPY_HW_CLK_PLLM (5) |
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 add a comment stating the frequency of the external HSE crystal (and if it's a crystal or an oscillator).
btw, here is the manufacturers version: https://github.com/WeActStudio/MiniSTM32H7xx/tree/master/SDK/openmv/Ports/micropython/boards/WeActStudioSTM32H7xx |
@mattytrentini Hi Mat. Thank you for the PR. I tried it today with a WEACT STM32H750 board, and it works. But, the PR needs a maintenance, since it does not compile any more. Two topics:
P.S.: I wonder why you included the networking support but did not define e.g. Ethernet pins, like these:
|
Thanks @robert-hh, that'll help when I finally get a chance to return to this PR!
I should have; I was just collating various mpconfig files and must have removed the eth details. Will add them. |
Today I added a LAN8720 breakout board to my STM32H750 board and tested it using the changes in PR #13630. To get it working, I had to add a few lines to mpconfigboard. Without these, the clock frequency for the MDIO CLK signal was too high, 4.5MHz instead of 2 MHz. With that change, Ethernet works well. I did not check other devices like UART, SPI, etc. after that change.
Edit: I use the H743 files for the H750. I ordered a H743, but it did not yet arrive. |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
@mattytrentini are you still interested in updating this PR based on the above feedback? |
Yes, just lacking time right now. Will try to revisit it soon! |
Hi Matty and Damien, I just ordered a couple of these boards and will be happy to test. |
I expect my board here shortly. Question about the repl. Does that need to be explicitly set for a uart? There look to be at least two uarts as per the config file. |
The native USB interface is used for REPL. So both UARTs can be used for other purposes. |
If I got the code from this PR, and built it, the repl over USB should work? And flashing will need to be done via an stlink. Thanks |
Yes.
No, you can use DFU and flash over USB. |
Thanks, @mattytrentini . That worked. I had to add the
Now to test the functionality. |
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
479df8c
to
f1f1082
Compare
Code size report:
|
OK, I've just made a first-pass update. It now builds again and some of the comments have been integrated. It only provides access to the 8MB QSPI: $ mpremote df
mount size used avail use%
8368128 12288 8355840 0
flash 8368128 12288 8355840 0 I still have a few more comment to address...and it would be nice to also add access to the second 8MB SPI flash. Looking into it now... |
Adds a board definition for the WeAct Studio STM32H743 board.