AnsweredAssumed Answered

M25P16 Serial Flash on BF592 Ez-Kit

Question asked by Taylord on Aug 13, 2014
Latest reply on Aug 14, 2014 by Taylord

Hi all,

 

I am trying to get this SPI flash chip working so I can read and write to it. I have one of these chips set up on an external board, using Chip Select 1 or PG0 (the flash chip mounted on EZKit uses CS0). Right now I am attempting to use code from the example project bf592_m25p16_dpia to get this working. This seemed like a convenient way to go about this, but if anyone knows of an easier way let me know.

 

Here is my main() for now. m25p16_open is supposed to send a write enable command so I am just testing that for now.

 

int main(void)

{

  int result = 0;

  adi_initComponents();

  spi_ctlr = &adi_spi_bf5xx_ctlr;

  flash_info = &m25p16_info;

  result = m25p16_open(flash_info);

  if(result != 0){

  printf("ERROR\n");

  }

  return 0;

}

 

debugging my program I found it gets stuck in the function adi_spi_bf5xx_send(uint8_t *buf, int count) in the line

while (spi_message.size != -1);

 

So message size never makes it to -1, does anyone know what that indicates. Any insight into this is appreciated

 

Again, if there is a better way of going about this please let me know. This example project just seemed like a good starting point to get this working. Also before you ask I am sure the chip is wired correctly. Any comments appreciated. thanks

 

Taylor

Outcomes