AnsweredAssumed Answered

Usb mass storage Hard fault Handler?

Question asked by tech.haris on Dec 3, 2012
Latest reply on Dec 28, 2012 by Chain_Chelliah
hi:
    after receiving DCMI data i am writing it to USB. after writing some files Hard fault handler occurs... why is it so?

Firstly I capture the DCMI data to buffer, after one frame capture I stop the DCMI and start to transmit data over serial. I repeat this in while(1) loop. e.g
              while(1)
     {
      frame_capture();
      //when frame is capture
      Send_usart(Buffer);
     }     // it works fine it keep on running

secondly, I capture a single frame, then write it on USB mass storage device, repeatedly. e.g like this
 
  frame_capture();
  while(1)
  {
     fopen(......);
    fwrite(buffer);
     fclose(....);
  }   // it works also fine. it keep on running

but whne I combine both codes , Hard fault Handler occurs. like this

while(1)
{
  frame_capture();
     fopen(......);
    fwrite(buffer);
     fclose(....);
 
}  // i get error after random file write after at 15, at 90 at 110  etc
  // some time i even go 400 write file but then fault handler occurs.

why is this happening? I also have set interrupt priority differently. but no effect !!

thanks

Outcomes