How to adjust the memory allocation of M4?
Answer.
Using the latest BSP, you can modify the usage space of M4 as follows:
Buildroot can modify the usage space of M4 (maximum 4MB). Users can modify it according to their needs.
1. Modify Kernel of device tree: ma35d1-som-512m.dts
Code: Select all
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
rproc_buf: rproc_buf@0 {
//reg = <0x0 0x80020000 0x0 0x60000>; /* 384KB */
reg = <0x0 0x80020000 0x0 0x3E0000>; /* 3M+896KB */
no-map;
};
Modify :
kernel_addr_r=0x80080000
To:
kernel_addr_r=0x80400000
Code: Select all
uint8_t test_buf[3 * 1024 * 1024];
int main()
{
SYS_Init();
/* Init UART to 115200-8n1 for print message */
UART_Open(UART16, 115200);
/* Connect UART to PC, and open a terminal tool to receive following message */
printf("Hello World\n");
/* Got no where to go, just loop forever */
while(1)
{
memset(test_buf, 0x00, sizeof(test_buf));
printf("Hello World\n");
}
}
#MA35 , #M4
.