Skip to content
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

soc: st: stm32mp13xx series support #82701

Open
arifbalik opened this issue Dec 8, 2024 · 12 comments
Open

soc: st: stm32mp13xx series support #82701

arifbalik opened this issue Dec 8, 2024 · 12 comments
Assignees
Labels
platform: STM32 ST Micro STM32 RFC Request For Comments: want input from the community

Comments

@arifbalik
Copy link
Contributor

arifbalik commented Dec 8, 2024

Introduction

ST Recently released STMicroelectronics/cmsis_device_mp13.git for STM32MP13 series bare metal development. But Zephyr currently only has support for STM32MP15 series. If there is no one working on this I would like to try and implement it.

Problem description

Currently applications can not be build on STM32MP13 series. There is a Kconfig SOC_SERIES_STM32MP1X but its designed to be run on the co-processor (only available in mp15xx series) and not the cortex-a7

Proposed change

I would like to define the SOC and STM32MP135F-DK board, which is the only board I have atm.

Detailed RFC

The SOC directory inside hal_stm32 repo does not contain header files for stm32mp13xx series but it exists at https://github.com/STMicroelectronics/cmsis_device_mp13.git

Proposed change (Detailed)

After updating the hal_stm32 I would follow the standard practice for defining the SOC, but for board I'm not sure which drivers are missing, but I do not think much. The board I'll be using has all security features inside the chip, that part may require some work.

@arifbalik arifbalik added the RFC Request For Comments: want input from the community label Dec 8, 2024
@arifbalik arifbalik changed the title soc: st: stm32mp13 series support soc: st: stm32mp13xx series support Dec 8, 2024
@JarmouniA JarmouniA added the platform: STM32 ST Micro STM32 label Dec 8, 2024
@JarmouniA
Copy link
Collaborator

@arifbalik I know someone who would be interested in this @arnopo :)

@erwango
Copy link
Member

erwango commented Dec 9, 2024

@arifbalik There is actually a port initiated and which should be pushed upstream soon.

@arifbalik
Copy link
Contributor Author

@arifbalik There is actually a port initiated and which should be pushed upstream soon.

Is there a branch we can follow maybe?

@arnopo
Copy link
Collaborator

arnopo commented Dec 9, 2024

@arifbalik , we have started the porting but nothing sharable for time being (at PoC level)
When do you expect to start your work on stm32mp13?

@arifbalik
Copy link
Contributor Author

@arifbalik , we have started the porting but nothing sharable for time being (at PoC level)
When do you expect to start your work on stm32mp13?

I don't really have a project for it. I just wanted to contribute

@arnopo
Copy link
Collaborator

arnopo commented Dec 10, 2024

We will try to find time to share something with you as soon as possible (by the end of this week or next week). Even if it is not clean yet, it should help you. I will keep you informed.

@arifbalik
Copy link
Contributor Author

We will try to find time to share something with you as soon as possible (by the end of this week or next week). Even if it is not clean yet, it should help you. I will keep you informed.

That would be very nice, I would really like to contribute whereever possible.

I already worked with stm32mp1 series so I'm familiar with it

@arnopo
Copy link
Collaborator

arnopo commented Dec 16, 2024

Hi @arifbalik

As discussed, please find below two links to my GitHub that allow you to run the sample blinky on the STM32MP13 board.

This code is not yet clean enough to be upstreamed, but we expect to do it in January.

Current status:

  • you need to load a stm32CUbe package on SDcard to be able to initialize the DDR. Then boot the board and you will be able to load zephyr application using west debug
  • No UART console yet

If you want to contribute, please tell us which part you want to work on so that we can avoid duplicating efforts. On our side, we will probably focus first on making the SoC and board parts clean, so don't hesitate if you want to enable UART or some other peripherals or to focus on some frameworks such as USB, LVGL.

Thanks!

@arifbalik
Copy link
Contributor Author

Hi @arifbalik

As discussed, please find below two links to my GitHub that allow you to run the sample blinky on the STM32MP13 board.

This code is not yet clean enough to be upstreamed, but we expect to do it in January.

Current status:

  • you need to load a stm32CUbe package on SDcard to be able to initialize the DDR. Then boot the board and you will be able to load zephyr application using west debug
  • No UART console yet

If you want to contribute, please tell us which part you want to work on so that we can avoid duplicating efforts. On our side, we will probably focus first on making the SoC and board parts clean, so don't hesitate if you want to enable UART or some other peripherals or to focus on some frameworks such as USB, LVGL.

Thanks!

That looks great. I'll try to build and run something on my board and see if i can get a console.

Thanks for sharing, can't wait to get started

@arifbalik
Copy link
Contributor Author

arifbalik commented Dec 19, 2024

@arnopo Just a quick question, I got the blinky working on my board, but whenever I enable my newly defined uart, and the driver uart_stm32, I get an exception as soon as the driver tries to access the memory region of the uart4 (0x40010000). Spesifically on this line;

LL_USART_Disable(usart);

Note: I've also made sure correct LL libraries are included from hal_stm32

Which just writes to the CR register. After this we drop into

ldr pc, =z_arm_data_abort /* data abort offset 0x10 */

Which means this is a weird memory region we are not allowed to work on? I took a quick look at the ext loader to see if there is a configuration for enabling the core for a region of memory (like in optee) but I think not.

I don't have an svd file so I can not snapshot the registers for RCC and UART4 but it seems like we have to enable access to this peripheral as far as I understand it. Am I missing something here? Maybe this has to do with the TZC

@arnopo
Copy link
Collaborator

arnopo commented Dec 20, 2024

There is probably an issue in the MMU configuration. I have updated the MMU table to declare all the peripheral buses and also moved the code to DDR, as it was running in SYSRAM.
please see my Zephyr branch: https://github.com/arnopo/zephyr_stm32mp1/tree/stm32mp135f_dk
I hope this will solve your issue

@arifbalik
Copy link
Contributor Author

arifbalik commented Dec 21, 2024

There is probably an issue in the MMU configuration. I have updated the MMU table to declare all the peripheral buses and also moved the code to DDR, as it was running in SYSRAM. please see my Zephyr branch: arnopo/zephyr_stm32mp1@stm32mp135f_dk I hope this will solve your issue

That was it, thanks.

I now have a console. But my workspace is kinda messy right now. I'll refactor the RCC part and open a PR

Edit:

PR for LL libraries

Pr fot the UART console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32 RFC Request For Comments: want input from the community
Projects
Status: No status
Development

No branches or pull requests

4 participants