Low level byte read command has a bug leaking LSb of previous byte to next MSb byte.
To correct this bug simply correct this part of code: In "SPI Flash System Initializer" section
From:
-- Handle the SPI shift register if (spi_state=GET_BYTE and clk_count(0)='0' and clk_count<CLK_COUNT_1BYTE) or (spi_state/=GET_BYTE and clk_count(0)='1' and clk_count<CLK_COUNT_1BYTE) then sr <= sr(6 downto 0) & spi_si_i; end if;
TO:
-- Handle the SPI shift register
if (clk_count(0)='1' and clk_count<CLK_COUNT_1BYTE) then
sr <= sr(6 downto 0) & spi_si_i;
end if;
and for "SPI Flash Interfacesame" for the same reason:
From:
-- Handle the shift register if (fsm_state=GET_BYTE and clk_count(0)='0') or (fsm_state/=GET_BYTE and clk_count(0)='1') then sr <= sr(6 downto 0) & spi_si_i; end if;
TO:
-- Handle the shift register if ( clk_count(0)='1') then sr <= sr(6 downto 0) & spi_si_i; end if;