定义核心STM32H7

发布于 2025-01-21 12:24:26 字数 1092 浏览 1 评论 0原文

我目前正在尝试使用STM32H747数据表中的寄存器对我的poltentah7进行编程。到目前为止,我只是尝试访问一个核心(M7),现在我想同时尝试使用这两个内核。关于如何同时使用两者,有很多景象,但没有一个解释core_cm7和core_cm4的定义位置。 这是我到目前为止所做的:

volatile uint32_t* const SYSCFG_UR1 = (uint32_t *) 0x58002704;
volatile uint32_t* const RCC_GCR = (uint32_t *) 0x58024400A0;//to boot M4
void boot_CM4(void){
   *SYSCFG_UR1 = (1<<0);//BCM4 = 1;
   *RCC_GCR|=(1<<3);//BOOT_C2
}

此功能应该引导M4核心。我读过的大多数代码在线使用:

#ifdef CORE_CMx

#endif

它允许它们与core_cmx一起使用。我的问题是如何定义core_cmx。此处的数据表: https://www.st.com/resource/en/reference_manual/dm00176879-stm32h7457557555555-and-stm32H747777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777757-ADVANDEC-ARMBASED-32BIT-MCUS-MCUS-StROELECTRECTROCT.PDF 注册以编写核心的起始地址,以定义core_cmx。但是,数据表中的此寄存器几乎没有信息。任何提示都将不胜感激。

I am currently trying to program my PortentaH7 using the registers in the STM32H747 datasheet. So far I was only trying to access one core (M7) and now I want to try using the two cores at the same time. There are a lot of exemples on how to use both at the same time but none explains where the CORE_CM7 and CORE_CM4 are defined.
Here is what I have done up till now :

volatile uint32_t* const SYSCFG_UR1 = (uint32_t *) 0x58002704;
volatile uint32_t* const RCC_GCR = (uint32_t *) 0x58024400A0;//to boot M4
void boot_CM4(void){
   *SYSCFG_UR1 = (1<<0);//BCM4 = 1;
   *RCC_GCR|=(1<<3);//BOOT_C2
}

This function should boot the M4 core. Most of the codes I have read online use :

#ifdef CORE_CMx

#endif

And it allows them to work with the CORE_CMx. My question is how is CORE_CMx defined. The datasheet here : https://www.st.com/resource/en/reference_manual/dm00176879-stm32h745755-and-stm32h747757-advanced-armbased-32bit-mcus-stmicroelectronics.pdf has me thinking that I should use the SYSCFG_UR3 register to write the starting address of the core in order to define CORE_CMx. However there is close to no information on this register in the datasheet. Any hints is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

金橙橙 2025-01-28 12:24:26

经过一项研究,我发现标识符core_cmx由IDE定义,并获得相当于:

#ifdef 1

您需要做的(在Arduino IDE上)要去 tools&gt; boars&gt; arduino mbed mbed os os portenta boards 并选择要编程的核心。这就是标识符被视为定义的地方。在使用之前,仍然需要在CM7上引导CM4。
(快速检查:在编译期间,闪存地址为CM4的代码为0x08100000和CM7的0x08000000,如数据表中所定义的)。
感谢您的帮助。

After some research I found out that the identifier CORE_CMx is defined by the IDE and to get something equivalent to :

#ifdef 1

All you need to do (on Arduino IDE) is to go to Tools>boards>Arduino Mbed OS Portenta Boards and choose the core you want to program. And that's where the identifier is considered to be defined. It is still needed to boot CM4 on CM7 before using it.
(Fast check : during compilation the Flash memory address to where the code is wtritten is 0x08100000 for CM4 and 0x08000000 for CM7 as defined in the datasheet).
Thanks for your help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文