This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: Read/write to NOR Flash S29GL128P from TMS570 via EMIF

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Trying to write/read to the NOR Flash S29GL128P using EMIF but can only read 0xFFFF instead of the actual data that was written, here are my steps

  1. Halcogen settings
    1. Enabled EMIF interface but disabled the pins EMIF_nOE, EMIF_nDQM[0], EMIF_RNW due to conflicts
    2. Selected ASYNC1, selected NOR Flash
    3. Left the timing fields as default
  2. Added the following line to linker file HL_sys_link.c

    /* USER CODE BEGIN (3) */
    EMIF_1 (RX) : origin=0x60000000 length=0x00000100
    /* USER CODE END */

  3. Here is the main code

    int main(void)
    {
    /* USER CODE BEGIN (3) */

    _enable_IRQ_interrupt_();

    _mpuInit_();
    _mpuEnable_();
    emif_ASYNC1Init();

    uint16_t *base_addr = (uint16_t *) 0x60000000;
    uint16_t data1 = 0x1234;
    uint16_t Read_back_data = 1947;

    *((uint16_t *) base_addr + 0x555) = 0x00AA; /* write unlock cycle 1 */
    *((uint16_t *) base_addr + 0x2AA) = 0x0055; /* write unlock cycle 2 */
    *((uint16_t *) base_addr + 0x555) = 0x00A0; /* write program setup command */
    *((uint16_t *) 0x60000000) = data1; /* write data to be programmed */
    __delay_cycles(150000);

    Read_back_data = *((uint16_t *) 0x60000000);

    /* USER CODE END */

    return 0;
    }

Questions:

  1. Any missing code/HALCOGEN settings to be added?
  2. As per the datasheet of the NOR Flash S29GL128P, polling algorithm should be performed after writing program data. This polling algorithm involves monitoring of the DQ pins. But the DQ pins are not found in HL_emif.c, HL_emif.h or HL_reg_emif.h. Where to access these DQ pins in the user space?

Many thanks in advance!