Flash to RAM -()Executing From RAM

manoalex123 wrote on Friday, November 25, 2016:

I am Using STM32F4 serious Contoller.
I want run my code from RAM Memory. (Here i want turn OFF Flash memory)

Without FreeRTOS code- I am able to RUN my code in RAM memory. But if i enable FreeRTOS code-
1.The task creation code got excuted but-the task is not created. "if(xTaskCreate(MainThread, "MainApp", 512, NULL, 3, &Handle) != pdPASS)"
2.After reaching "vTaskStartScheduler()"-Its going to "HardFault_Handler".

i. I Given the Vector table in RAM.
ii. And I checked in debugging mode- Its excuting from RAM only.
iii. I am using Keil Compiler.

Is my way is right? If its worng Please guide me in correct way?
If i missed any configuration-Please guide me in correct way?

rtel wrote on Friday, November 25, 2016:

How are you telling the application to run from RAM? Are you using
compiler extensions to mark functions as RAM functions, or are you using
a linker script that only places code in RAM? Are you sure the ISRs are
also in RAM?

Use the debugger to step into the xTaskCreate() function to see WHY the
task is not being created. If you step through the source code that you
are building it should be obvious.

That may also fix the problem with the scheduler starting, but if not,
also use the debugger to find where the hard fault is triggering - if
tasks are not being created the the idle task will also not be created
(it should be created automatically when the scheduler is started).

Alternatively, if the crash is when the SVC instruction executes, check
the function it is trying to jump to (the SVCall_Handler) is where you
think it is.