AnsweredAssumed Answered

"Exception vector name: Address error"  with QSPI example + other tasks

Question asked by Jaime Rodriguez on May 1, 2009
Latest reply on May 28, 2009 by Jaime Rodriguez

I am using the QSPI example and it works fine. However, when I add more TASKS to the project an error comes up, the error reads: "Exception vector name: Address error".

I have observed the following:

1.-Project works fine when I only use QSPI task.

2.-The other tasks work fine without QSPI task.

3.-If I insert a breakpoint into QSPI task and hit the run button continously, the error never comes up.

 

Within the QSPI task there is memory allocation... I asign memory with this function

send_buffer = _mem_alloc_zero(SEND_BUFFER_SIZE); 

and I free memory with this function  _mem_free(send_buffer);

What am I missing?

What documentation should I read?

 

Task is like this:

  void QSPI_task
   (
   )
{
   FILE_PTR                     fd;
   uint_32                      i=0, result;
   uint_32                      len;
   uint_32  param = 0;
   uint_16 algo[1];

   printf("\n\n-------------- Begin QSPI EEPROM example --------------\n\n");
   /* Open the QSPI controller */        
   fd = fopen(IO_PORT, (pointer)(QSPI_DEVICE_MASTER_MODE));
   if (fd == NULL)
   {
      printf("\n Failed to open the QSPI Controller, exiting....");
      _time_delay(200L);
      _mqx_exit(1L);
   } /* Endif */


   while(1)
   {
     // Allocate memory for the buffers
 send_buffer = _mem_alloc_zero(SEND_BUFFER_SIZE);
   if (send_buffer == NULL)
   {
      printf("\nFailed to get buffer");
      _task_block();
   }
   recv_buffer = _mem_alloc_zero(RECV_BUFFER_SIZE);
   if (recv_buffer == NULL)
   {
      printf("\nFailed to get buffer");
      _mem_free(send_buffer);
      _task_block();
   }
   data_buffer = _mem_alloc_zero(RECV_BUFFER_SIZE);
   if (data_buffer == NULL)
   {
      printf("\nFailed to get buffer");
      _mem_free(send_buffer);
      _mem_free(recv_buffer);
      _task_block();
   }
  
  
  
  
      algo[0] = 0xAA;
      send_buffer[0] = 0xAA;
      recv_buffer[0] = 0;
      recv_buffer[1] = 0;
      param = QSPI_CHIP_SELECT_SET_1;
      ioctl(fd, IO_IOCTL_QSPI_SET_CHIP_SELECT_STATE, &param);
     
         param = QSPI_CS3;
      ioctl(fd, IO_IOCTL_QSPI_CHIP_SELECT, &param);

      result = write(fd, send_buffer, 1);
      param = QSPI_CS2;
      ioctl(fd, IO_IOCTL_QSPI_CHIP_SELECT, &param);
      result = write(fd, send_buffer, 1);
      //result = write(fd, &algo, 1);
         /* Free the buffer memory */
      _mem_free(send_buffer);
      _mem_free(recv_buffer);
      _mem_free(data_buffer);
  
      _time_delay(1000L);
     
     
   }


 
} /* Endbody */

 

Regards,

 

Jaime

Outcomes