cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with the STM32H735-DK, OSPI Hyperram

Naldr.1
Associate

Hi, in the example for the OSPI-memorymapped example, the test procedure is as follows..

// This is running fine on the DEV board, ( it also works in byte mode fine.)
 while (1)
  {
    /* Intensive Access ----------------------------------------------- */
    mem_addr = (__IO uint32_t *)(OCTOSPI2_BASE + address);
 
    for (index = 0; index < BUFFERSIZE; (index += 4))
    {
      /* Writing Sequence --------------------------------------------------- */
      *mem_addr = *(uint32_t *)&aTxBuffer[index];
 
      /* Reading Sequence --------------------------------------------------- */
      if (*mem_addr != *(uint32_t *)&aTxBuffer[index])
      {
        BSP_LED_On(LED_RED);
      }
      mem_addr++;
    }

An this indeed runs and i get a flashing green light indicating that its correct,

BUT......

// Running in byte mode or word mode fails
void writeTest(void)
{
	__IO uint8_t *mem_addr;
	uint32_t address = 0;
	uint32_t index;
	printf("Write Test\n");
	while (1)
  {
    /* Intensive Access ----------------------------------------------- */
    mem_addr = (__IO uint8_t *)(OCTOSPI1_BASE + address);
 
    for (index = 0; index < BUFFERSIZE; (index ++))
    {
      /* Writing Sequence --------------------------------------------------- */
      *mem_addr = *(uint8_t *)&aTxBuffer[index];
      mem_addr++;
    }
    address += OSPI_HYPERRAM_INCR_SIZE;
    if(address >= OSPI_HYPERRAM_END_ADDR)
    {
      address = 0;
			return;
    }
  }
}
 
 
 
void readTest(void)
{
	__IO uint8_t *mem_addr;
	uint32_t address = 0;
	uint32_t index;
	printf("Read Test\n");
	while (1)
  {
    /* Intensive Access ----------------------------------------------- */
    mem_addr = (__IO uint8_t *)(OCTOSPI1_BASE + address);
		printf("0x%p-",mem_addr);
    for (index = 0; index < BUFFERSIZE; (index ++))
    {
			if (*mem_addr != *(uint8_t *)&aTxBuffer[index])
      {
				printf("ERROR Writing\n");
			}
      mem_addr++;
    }
    address += OSPI_HYPERRAM_INCR_SIZE;
    if(address >= OSPI_HYPERRAM_END_ADDR)
    {
      address = 0;
			return;
    }
  }
}
 
 
/*****************************************
 
 
*****************************************/
void hyperRamTest(void)
{
	 uint32_t address = 0;
  uint32_t index;
  __IO uint8_t *mem_addr;
	
 
	long size = OSPI_HYPERRAM_END_ADDR*2;
	printf("Hyper RAM test size 0x%x (",OSPI_HYPERRAM_END_ADDR*2);
	printfcomma(size);
	printf(") bytes\n");
 
//	
	writeTest();
	readTest();
}

So now i have split up the read and write functions, and it ALWAYS fails?

Anyone know whats going on..

I have the STM32H735-DK dev board, and i have also built 2 PCBs that act the same way, with the same code.

I have checked that __IO is defined as volatile.

3 REPLIES 3
David Littell
Senior III

(Yeah, 6 months and no answer. Sad.) The combined test uses OCTOSPI2_BASE while your split tests use OCTOSPI1_BASE. Was that intentional?

Providing support here pays very poorly..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hahaha, and yet here you are! 😉