Hello
as a general reference, please refer to https://wiki.st.com/stm32mpu/wiki/STM32MP15_peripherals_overview to check which peripherals are usable/sharable between Cortex-A7 (Linux) and Cortex-M4 (HAL) world.
USART1 is reserved for Linux/OP-TEE usage, so, we recommend to use other UARTs. If you absolutely want to use USART1 with Cortex-M4 (i.e. no more choice in muxing choices), it requires some changes in device tree and add all HAL related functions (GPIO mux, UART init, interrupt handler, etc..) in your M4 software. This is not handled by STM32CubeMx.
For all other USARTs/UARTs, there could be assigned to Cortex-M4 in STM32CubeMx, and it will generates all relevant code and device tree settings.
Have you look at https://wiki.st.com/stm32mpu/wiki/USART_internal_peripheral ?
For OTG IP, things are different as OTG is always used by uBoot during board Flashing (i.e. using STM32CubeProgrammer).
It is no possible to use it with Cortex-M4. We did not provide HAL library and free USB stack for neither USBH and OTG IPs.
OTG device tree configuration is available in wiki https://wiki.st.com/stm32mpu/wiki/OTG_device_tree_configuration
Could you share your use case of having USB controlled on Cortex-M4 side ?
In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent