This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FMC problem on GD32E103

Hi everyone.

I'm making a bootloader for the GD32E103, and i can't write on memory, even using the libraries from gigadevice.

This is a simple code i made to test it.

int main(void)
{
  SysTick_Config(SystemCoreClock / Systick_Frequency);
  NVIC_SetPriority(SysTick_IRQn, 2);

  Setup();      //just configuring ports, timers and others

  update = Decide_Update();    
  if(update)
    Update_Setup();     //Here is where i configure the fmc

  /* Infinite loop */
  while (1)
    {;}
}

void Update_Setup(void)
{
  fmc_prefetch_enable();
  fmc_unlock();
  fmc_program_width_set(FMC_PROG_W_32B);
  fmc_dbus_enable();
  fmc_ibus_enable();

}

void TIMER1_IRQHandler(void)
{
  if(timer_interrupt_flag_get(TIMER1, TIMER_FLAG_UP) != RESET) {

    if(update)
    {
      stado = fmc_word_program(0x08004000, 0xaabbccdd);
      fmc_flag_clear(FMC_FLAG_END); 
    }
  timer_interrupt_flag_clear(TIMER1,TIMER_FLAG_UP);
  }
}

Don't getting any problem erasing the pages, or that seems, but when write, didn't change the memory bytes and didn't get any error in the fmc bytes.

I will apreciate so much some help, this is getting me mad.

Ty :)

Parents Reply Children
No data