Merge pull request #2335 from kwagyeman/kwabena/mpu_fix

ports/stm32: Fix MPU region protection bug.
This commit is contained in:
Ibrahim Abdelkader 2024-07-31 10:25:08 +02:00 committed by GitHub
commit 617911227c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
/* Adds a section to a table */
#define OMV_ADD_SECTION(s) \
LONG (ADDR(s)) \
LONG (SIZEOF(s) / 4)
LONG (SIZEOF(s))
/* Aligns a section to the next power of 2. */
#define OMV_ALIGN_DMA_SECTION(section) \

View File

@ -140,7 +140,7 @@ void mp_init_gc_stack(void *sstack, void *estack, void *heap_start, void *heap_e
// Add GC blocks (if enabled).
#ifdef OMV_GC_BLOCK1_MEMORY
typedef struct {
uint32_t *addr;
uint8_t *addr;
uint32_t size;
} gc_blocks_table_t;

View File

@ -53,7 +53,7 @@ void HAL_MspInit(void) {
}
typedef struct {
uint32_t *addr;
uint8_t *addr;
uint32_t size;
} dma_memory_table_t;
@ -65,7 +65,7 @@ void HAL_MspInit(void) {
if (buf->size >= 32) {
MPU_InitStruct.Number = region_number--;
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = *(buf->addr);
MPU_InitStruct.BaseAddress = (uint32_t) buf->addr;
MPU_InitStruct.Size = dma_utils_mpu_region_size(buf->size);
HAL_MPU_ConfigRegion(&MPU_InitStruct);
}