Where to start STM32H7 support

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 9:58 am

Giovanni wrote:Hi,

No need to struggle too much, in mcuconf.h there is this:

Code: Select all

/*
 * Memory attributes settings.
 */
#define STM32_NOCACHE_MPU_REGION            MPU_REGION_6
#define STM32_NOCACHE_SRAM1_SRAM2           FALSE
#define STM32_NOCACHE_SRAM3                 TRUE


The related code is in hal_lld.c, you can use that as example.

Giovanni


Ah great thanks. We are on 19.1.x at the moment - is this a later feature?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Fri Jan 22, 2021 10:02 am

Yes, H7 support has been enhanced, you may look at current code and do this at application level before calling halInit().

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 10:18 am

Giovanni wrote:Yes, H7 support has been enhanced, you may look at current code and do this at application level before calling halInit().

Giovanni


Thanks, which LLD? I was looking for MPU but that doesn't exist?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Fri Jan 22, 2021 10:24 am

It is not an LLD, it is under /os/hal/ports/common/ARMCMx.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 10:27 am

Giovanni wrote:It is not an LLD, it is under /os/hal/ports/common/ARMCMx.

Giovanni


Thanks!

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 10:42 am

andypiper wrote:
Giovanni wrote:Hi,

No need to struggle too much, in mcuconf.h there is this:

Code: Select all

/*
 * Memory attributes settings.
 */
#define STM32_NOCACHE_MPU_REGION            MPU_REGION_6
#define STM32_NOCACHE_SRAM1_SRAM2           FALSE
#define STM32_NOCACHE_SRAM3                 TRUE


The related code is in hal_lld.c, you can use that as example.

Giovanni


Ah great thanks. We are on 19.1.x at the moment - is this a later feature?


It looks like I can just set STM32_NOCACHE_SRAM1_SRAM2 and use memory from 0x30000000 for now?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Fri Jan 22, 2021 11:39 am

You can make any combination of the two settings, you could also add extra regions if you want.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 12:34 pm

Giovanni wrote:You can make any combination of the two settings, you could also add extra regions if you want.

Giovanni


Thanks Giovanni. So I think this will clear up any DMA problems I am currently having (I notice on F7 we are using DTCM memory so that may explain some of the differences I am seeing between F7 and H7).

Is the gcc volatile keyword observed correctly for data located in cachable memory?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Fri Jan 22, 2021 1:41 pm

On F7 DTCM is accessible by DMAs, this is not the case on the H7. F7 is generally much easier to use.

Is the gcc volatile keyword observed correctly for data located in cachable memory?


No, the compiler is not cache-aware.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Where to start STM32H7 support

Postby andypiper » Fri Jan 22, 2021 2:57 pm

Giovanni wrote:On F7 DTCM is accessible by DMAs, this is not the case on the H7. F7 is generally much easier to use.

Is the gcc volatile keyword observed correctly for data located in cachable memory?


No, the compiler is not cache-aware.

Giovanni


Urg, so I guess the next question is do the ChibiOS mutexs provide a memory barrier (I guess not since you need help frome the compiler) and does it matter on a single core H743? If I have multiple threads interacting through SRAM what do I need to do to ensure I don't get dirty reads and the like.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 14 guests