Problem with FreeRTOS, FatFS on FRDM-K22F

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

Problem with FreeRTOS, FatFS on FRDM-K22F

Jump to solution
1,128 Views
vishalgirisagar
Contributor II

Hi All,

   I am trying to get a simple data logger up on FRDM-K22F. I am using KDS and Processor components. I have tried to simplify the problem to the best I can. Below are three scenarios.

1. FatFS with SDcard, HW en, Utility, Timeout, CS1, SPIMaster_Ldd, Generic Time Date.
These are the components.

During Fat1Init, SD1_init(), Below function is called.

void SD1_SPI_WRITE(unsigned char write) {
unsigned char dummy;
SD1_DataReceivedFlag = FALSE;
(void)SM1_ReceiveBlock(SM1_DeviceData, &dummy, sizeof(dummy));
(void)SM1_SendBlock(SM1_DeviceData, &write, sizeof(write));
while(!SD1_DataReceivedFlag){}
}

After that, I see the interrupt getting triggered. I have put break point in SM1_Interrupt.

Everything in this scenario works fine. I can write, read to SD card.

2. Adding FreeRTOS component to the existing project.

Interrupt does not get triggered at all.

Everything gets screwed up as soon as I add FreeRTOS component.

3. Remove FreeRTOS component.

ISR is called.

Again Everything starts working.

This is weird. I do not have any clue what is happening. Can someone please please help me?

0 Kudos
1 Solution
807 Views
BlackNight
NXP Employee
NXP Employee

Interrupts are disabled until you start the operating system. Therefore calling anything like FAT1_Init() which depends on interrupts will not work.

You need to call FAT1_Init from a task context.

I hope this helps,

Erich

View solution in original post

2 Replies
808 Views
BlackNight
NXP Employee
NXP Employee

Interrupts are disabled until you start the operating system. Therefore calling anything like FAT1_Init() which depends on interrupts will not work.

You need to call FAT1_Init from a task context.

I hope this helps,

Erich

807 Views
vishalgirisagar
Contributor II

Hi Erich,

  Thank you for the answer. Thanks a ton.

0 Kudos