9 Replies Latest reply on Sep 17, 2019 1:23 PM by StWa_1982846

    PSoC1 CY8C20xx6 How does one read multi-block flash data (const data) for SPI?


      I am working with PSoC Designer 5.4 (Windows7) on the CY8C20x66A. I have some large (~4k) image data which I store into ROM/Flash by coding them in a header file as

      const unsigned char Image_X[4000] = { 0xFF, <... lots of bytes ...> };

      The compiler eats this up without complaint, but when I read the data to display it, I see random hash. The display output routine is a simple pointer increment loop which transmits the image through the SPI block:

      for(i=0; i<bytes; i++) {

      SPI_SendTxData( *dBytes ); /* load the byte for transmit */

      dBytes++; /* increment the pointer */

      while( ! (SPI_bReadStatus() & SPI_SPIM_TX_BUFFER_EMPTY) );



      Regardless of the size of the data, if the source data to this loop is in RAM, the display is correct. If the data is in Flash (i.e. const), the display shows hash. What is wrong with this? What is the workaround?