AnsweredAssumed Answered

STM32L4R9I-EVAL OctoSPI problem with 8bit access

Question asked by s m on May 19, 2018
Latest reply on Jun 17, 2018 by s m

 

Hello,

I am currently using the OctoSPI RAM on the STM32L4R9I-EVAL board (IS66WVH8M8BLL-100BLI (Hyperram)).

At first sight everything looks as expected, but when I read and than write with 8 bit access, only every second write is successful.

I changed the code of the OSPI_RAM_MemoryMapped as follows to show the problem:

while (1)
  {
    BSP_LED_On(LED_GREEN);

    /* Writing Sequence ----------------------------------------------- */
    mem_addr = (__IO uint8_t *)(OCTOSPI1_BASE);
    for (index = 0; index < 1024; index++)
    {
      *mem_addr = (index & 0xff);
      mem_addr++;
    }
    
    /* Reading Sequence ---------------------------------------------- */
    mem_addr = (__IO uint8_t *)(OCTOSPI1_BASE);
    for (index = 0; index < 1024; index++)
    {
      if (*mem_addr != (index & 0xff))
      {
        BSP_LED_On(LED_ORANGE);
      }
      mem_addr++;
    }

    /* Reading/Writing Sequence ---------------------------------------- */
    mem_addr = (__IO uint8_t *)(OCTOSPI1_BASE);
    for (index = 0; index < 1024; index++)
    {
      if (*mem_addr != (index & 0xff))
      {
        BSP_LED_Off(LED_GREEN);

        while(1)
            ;
      }
      *mem_addr = 0;
      if ( *mem_addr != 0 )
      {
          BSP_LED_On(LED_RED);

          //while(1)
              ;
      }

      mem_addr++;
    }
  }

During debugging and inspecting the memory region 0x90000000, the problems is visible.

When changing mem_addr to an uint16_t or an uint32_t everything works as expected.

 

Even when adding directly after '*mem_addr = 0;' the same statement again; thus writing twice to the same location, it works.

I need some advise to understand and hopefully fix that problem.

 

Thanks.

Outcomes