M4 hello world patches for use with remoteproc¶
- Apply patches to the imported hello_world project
- Without the patches, the program can be loaded via JTAG but not through the remoteproc process.
- With the patches, the program can be loaded through the remoteproc process, but not through JTAG.
- See https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1114668/am6252-load-m4-firmware-generate-from-mcu-rtos-sdk
Add the lines shown in red
modify main.c
Note that you must use the modified resource_table_no_ipc.h
attached below.
#include "FreeRTOS.h" #include "task.h" /* add a resource table to the project so it can be loaded by Linux RemoteProc driver */
#include "resource_table_no_ipc.h"
#define MAIN_TASK_PRI (configMAX_PRIORITIES-1)
modify linker.cmd
.sysmem: {} palign(8) > M4F_IRAM /* This is where the malloc heap goes */ .stack: {} palign(8) > M4F_IRAM /* This is where the main() stack goes */ GROUP {
// This is the resource table used by linux to know where the IPC "VRINGs" are located
.resource_table: {} palign(4096)
} > DDR_0/* Sections needed for C++ projects */
.ARM.exidx: {} palign(8) > M4F_IRAM // Needed for C++ exception handling
.init_array: {} palign(8) > M4F_IRAM // Contains function pointers called before main
and
M4F_IRAM : ORIGIN = 0x00000200 , LENGTH = 0x0002FE00 M4F_DRAM : ORIGIN = 0x00030000 , LENGTH = 0x00010000 // when using multi-core application's i.e. more than one R5F/M4F active, make sure
// this memory does not overlap with R5Fs
// Resource table must be placed at the start of DDR_0 when M4 core is early booting with Linux
DDR_0 : ORIGIN = 0x9CC00000 , LENGTH = 0x1000
new header file resource_table_no_ipc.h
- See attached: resource_table_no_ipc.h
Go to top