cancel
Showing results for 
Search instead for 
Did you mean: 

Files for STM32H563 External Loader

PFlor.2
Senior II

Anybody have Linker.ld and Loader_src.c file for STM32H563?  I have done one for the STM32H743 on another project and made an attempt to modify these for the STM32H563 but it's not working.  Appreciate any guidance.

I changed the RAM location from 0x24000000 for the H7 to 0x20000000 for the H5 but not sure what else is different as it pertains to a loader.

Something with the Init could be wrong...

int Init(void) {
  *(uint32_t*)0xE000EDF0 = 0xA05F0000; //enable interrupts in debug

  // Added per suggestion from ST to clear out QSPI structure
  memset(&hospi1, 0, sizeof(hospi1));

  SystemInit();

  /* ADAPTATION TO THE DEVICE
   *
   * change VTOR setting for H5 device
   * SCB->VTOR = 0x20000000 | 0x200;
   *
   * change VTOR setting for other devices
   * SCB->VTOR = 0x20000000 | 0x200;
   *
   * */
  SCB->VTOR = 0x20000000 | 0x200;

  __set_PRIMASK(0); //enable interrupts

  HAL_Init();

  SystemClock_Config();

  MX_GPIO_Init();

  __HAL_RCC_OSPI1_FORCE_RESET();  //completely reset peripheral
  __HAL_RCC_OSPI1_RELEASE_RESET();

  if (CSP_QUADSPI_Init() != HAL_OK) {
    __set_PRIMASK(1); //disable interrupts
    return LOADER_FAIL;
  }

  if (CSP_QSPI_EnableMemoryMappedMode() != HAL_OK) {
    __set_PRIMASK(1); //disable interrupts
    return LOADER_FAIL;
  }

  /*Trigger read access before HAL_QSPI_Abort() otherwise abort functionality gets stuck*/
  uint32_t a = *(uint32_t*) 0x90000000;
  a++;

  __set_PRIMASK(1); //disable interrupts
  return LOADER_OK;
}
10 REPLIES 10
Abhiram_12
Associate II

Finally HAL_Delay(); worked for me by ticking both the check boxes of "enabled" and "initialize", kindly refer to my reply at https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/regarding-external-loader-with-at25q128a-nor-flash/td-p/790941 

thank you,