• AVR Freaks

pic32MZ and SQI read problems

Author
PastrelloMarco
Starting Member
  • Total Posts : 54
  • Reward points : 0
  • Joined: 2013/08/30 12:26:20
  • Location: Venezia, Italy
  • Status: offline
2019/10/19 13:10:07 (permalink)
0

pic32MZ and SQI read problems

Hi all,

I have a big problem with my PIC32MZ4028EFG100 and SQI peripheral. I want to command an IS25LP080D (SPI/SQI memory)

I started studying the "peripheral\sqi\flash_read_pio_mode" example:
in my project I can send out the command but I can't read the response from the memory because interrupt doesn't fire.

The firmware call in order the routines : APP_SQI_Initialize, APP_SQI_Flash_Initialize and APP_SQI_Flash_ID_Check.
With the debugger and a logic analyzer I can see the "RSTEN", "RST", EQIO commands on the SPI/SQI channel and they seem OK.
Instead when I send the QJID for read the JEDEC CODE from memory, the memory answer correctly but FW never receive response and the firmware remain locked
on row

 while (PLIB_SQI_InterruptFlagGet(APP_SQI_ID_0, APP_SQI_TXTHR) == false);



follwing the code I use for read the JEDEC CODE (based on IS25LP080D datasheet):

SQI_STATUS APP_SQI_Flash_ID_Check (void)
{
    /* Configure SQI for PIO mode */
    PLIB_SQI_TransferModeSet(APP_SQI_ID_0, APP_SQI_XFER_MODE_PIO);

    /* Setup CONTROL, TX and RX buffer thresholds */
    _APP_SQI_BufferThrSet(1, 2, 3);

// /* Enable TXTHR interrupt signal */
    PLIB_SQI_InterruptSignalEnable(APP_SQI_ID_0, APP_SQI_TXTHR);

    /* Configure to send the QJID command */
    PLIB_SQI_ControlWordSet(APP_SQI_ID_0,1,APP_SQI_CS_0,APP_SQI_LANE_SINGLE,APP_SQI_CMD_TRANSMIT,1); /* EQIO */
    //PLIB_SQI_ControlWordSet(APP_SQI_ID_0,1,APP_SQI_CS_0,APP_SQI_LANE_QUAD,APP_SQI_CMD_TRANSMIT,1); /* NOP */
    PLIB_SQI_ControlWordSet(APP_SQI_ID_0,0,APP_SQI_CS_0,APP_SQI_LANE_QUAD,APP_SQI_CMD_TRANSMIT,1); /* QJID & DUMMY */
    PLIB_SQI_ControlWordSet(APP_SQI_ID_0,0,APP_SQI_CS_0,APP_SQI_LANE_QUAD,APP_SQI_CMD_RECEIVE,3); /* ID READ */

    //Write the command to the transfer buffer
    PLIB_SQI_TransmitData(APP_SQI_ID_0, (FLASH_QJID << 8)| /*|(FLASH_NOP << 16) | (FLASH_NOP << 8) |*/ (FLASH_EQIO));
    
    while (PLIB_SQI_InterruptFlagGet(APP_SQI_ID_0, APP_SQI_TXTHR) == false);
    //while (!(SQI1INTSTATbits.RXTHRIF ));
    jedecID = PLIB_SQI_ReceiveData(APP_SQI_ID_0);
    
    jedecID = jedecID & 0x00FFFFFF;

    if (jedecID != FLASH_JEDECID_B)
        return SQI_STATUS_FAILURE;
    else

        return SQI_STATUS_SUCCESS;
}



in the attachment you can see the waveform of the signal:

reset_part1.PNG = show first part of reset command sent to memory
reset_part2.PNG = show second part of reset command sent to memory after 5ms
EQIO_enable.PNG = show SQI mode enable on memory and on the right the JEDEC CODE request with the answer

I use :MPLABX 5.25, Harmony 2.06, cx32 compiler 2.30 without optimization

Has someone some ideas?
Thanks in advance
 
Today update : i changed PLIB with DRV_S25L but i have the same result: i'm testing with 2MHz SQI Clock. I can't read JEDEC _ID from memory
post edited by PastrelloMarco - 2019/10/20 08:53:29

Attached Image(s)

#1

1 Reply Related Threads

    PastrelloMarco
    Starting Member
    • Total Posts : 54
    • Reward points : 0
    • Joined: 2013/08/30 12:26:20
    • Location: Venezia, Italy
    • Status: offline
    Re: pic32MZ and SQI read problems 2019/10/20 11:38:02 (permalink)
    0
    Hi all: I have an important update:
    I needed to add an external resistor for realize a pull UP on SQID3 and on SQID2.
    Now memory answer correctly (checked with Logic Analyzer), but DRV_SQI_TransferFrames no Read nothing: the buffer used for memoryze the JEDEC_ID called gS25flFlashId[4] is always empty. Instead SQ1RXDATA receive the real 4 bytes sent by memory.
    Why this happens? How can I get the data from RX of SQI?
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5