Running sdcard fatfs exemple from sram

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Running sdcard fatfs exemple from sram

1,115 Views
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 Replies

807 Views
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

807 Views
YodaC
Contributor III

Thank you Carlos.

This work fine.

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

Best regards,

Christian.