Running sdcard fatfs exemple from sram

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Running sdcard fatfs exemple from sram

1,164 次查看
YodaC
Contributor III

Hello,

I try to make run a sdk exemple from sram on a frdmK64F.

As explained in this thread https://community.nxp.com/thread/435198, i  remove the flash section from the memory map in the Memory Configuration Editor, and tick the "Link application to RAM" option.

I can debug this project with a PEmicro interface debugging but it stays stuck in the delay function because the systick event is never triggered.

This problem does not appear on flash. 

Do you have some suggestion ?

Thanx.

2 回复数

856 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Christian,

When you link the application to RAM you need to make sure that the VTOR is pointing to the RAM vector table, you can add the following code to your SystemInit function:

.
.
.

extern uint32_t __Vectors;
 
void SystemInit (void) {
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
     SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));    /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */

     /* Point the VTOR to the position of vector table */
     SCB->VTOR = (uint32_t)&__Vectors;

.
.
.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

856 次查看
YodaC
Contributor III

Thank you Carlos.

This work fine.

I only had to add   extern void * __Vectors;  in the file.

Best regards,

Christian.