mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
ports/stm32: Fix MPU region protection bug.
This commit is contained in:
parent
51511ecb10
commit
d48832c77c
@ -5,7 +5,7 @@
|
|||||||
/* Adds a section to a table */
|
/* Adds a section to a table */
|
||||||
#define OMV_ADD_SECTION(s) \
|
#define OMV_ADD_SECTION(s) \
|
||||||
LONG (ADDR(s)) \
|
LONG (ADDR(s)) \
|
||||||
LONG (SIZEOF(s) / 4)
|
LONG (SIZEOF(s))
|
||||||
|
|
||||||
/* Aligns a section to the next power of 2. */
|
/* Aligns a section to the next power of 2. */
|
||||||
#define OMV_ALIGN_DMA_SECTION(section) \
|
#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).
|
// Add GC blocks (if enabled).
|
||||||
#ifdef OMV_GC_BLOCK1_MEMORY
|
#ifdef OMV_GC_BLOCK1_MEMORY
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t *addr;
|
uint8_t *addr;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
} gc_blocks_table_t;
|
} gc_blocks_table_t;
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ void HAL_MspInit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t *addr;
|
uint8_t *addr;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
} dma_memory_table_t;
|
} dma_memory_table_t;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void HAL_MspInit(void) {
|
|||||||
if (buf->size >= 32) {
|
if (buf->size >= 32) {
|
||||||
MPU_InitStruct.Number = region_number--;
|
MPU_InitStruct.Number = region_number--;
|
||||||
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
|
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);
|
MPU_InitStruct.Size = dma_utils_mpu_region_size(buf->size);
|
||||||
HAL_MPU_ConfigRegion(&MPU_InitStruct);
|
HAL_MPU_ConfigRegion(&MPU_InitStruct);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user