mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
Merge pull request #2335 from kwagyeman/kwabena/mpu_fix
ports/stm32: Fix MPU region protection bug.
This commit is contained in:
commit
617911227c
@ -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) \
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user