Hi,
Thank for your answer.
I have read how to move function inside SDRAM using your link. This is main.c file contents:
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_emc.h"
#include <stdbool.h>
#include "pin_mux.h"
#include "cr_section_macros.h"
__RAMFUNC(BOARD_SDRAM) void testSDRAM(void)
{
for (int i = 0; i < 10; i++) {
PRINTF("It works!\n");
}
}
int main(void)
{
/* Initialization inside SystemInitHook function */
testSDRAM();
EMC_Deinit(EMC);
while (1) {}
}
Also I moved all of the init function inside SystemInitHook function in systemLPC54628.c:
/* ----------------------------------------------------------------------------
-- SystemInitHook()
---------------------------------------------------------------------------- */
void SystemInitHook (void) {
/* Void implementation of the weak function. */
/* Hardware Initialization */
CLOCK_EnableClock(kCLOCK_InputMux);
/* attach 12 MHz clock to FLEXCOMM0 (debug console) */
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
BOARD_InitPins();
BOARD_BootClockPLL220M();
BOARD_InitDebugConsole();
BOARD_InitSDRAM();
}
Now the program can reach first breakpoint inside main function but jumping into function code causes HardFault (MMSR) IACCVIOL.
I attached project structure. Could you provide any working "Hello world" example using attached project?