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?
已解决! 转到解答。
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
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