I guess this is what I’ll do for now, it doesn’t seem to break the inference, at least.
#define KB_IN_BYTES(N) (1024UL * (N))
/* set these KB according the STM32Cube AI Studio */
#define AI_NPURAM5_SIZE KB_IN_BYTES(400)
#define AI_NPURAM4_SIZE KB_IN_BYTES(192)
__attribute__((section(".AI_NPURAM5")))
static uint8_t ai_npuram5[AI_NPURAM5_SIZE];
__attribute__((section(".AI_NPURAM4")))
static uint8_t ai_npuram4[AI_NPURAM4_SIZE];
/****in linker script, sections *****
AXISRAM4 : ORIGIN = 0x34270000, LENGTH = 0x70000
AXISRAM5 : ORIGIN = 0x342E0000, LENGTH = 0x70000
************** after .text **********
.AI_NPURAM4 (NOLOAD): {
. = ALIGN(4);
KEEP(*(.AI_NPURAM4))
. = ALIGN(4);
} >AXISRAM4
.AI_NPURAM5 (NOLOAD): {
. = ALIGN(4);
KEEP(*(.AI_NPURAM5))
. = ALIGN(4);
} >AXISRAM5
*************************************/
Since my axisram4 is not filled a lot, I used the rest of that space for something else, and (again) the inference still works. I therefore take this as a confirmation to my assumption that the AI studio/model/exported code simply uses the beginning of that memory… (hopefully)