AnsweredAssumed Answered

How can I write data to external Flash using FLEXSPI APIs?

Question asked by YongJin Choi on Aug 8, 2018
Latest reply on Aug 13, 2018 by igorpadykov

Hello,

 

I'am trying to write data to external Flash.

 

First, the code below works well to write code to flash

void NVDATA_Write() {

memset(wr_buf, 0xFF, 512*sizeof(uint8_t));

FLASH_page_program(FLEXSPI, (uint32_t)0x100000, (void *)wr_buf, 512));

}

 

However, in case of getting parameter of function, I does not work well.

void NVDATA_Write(uint8_t* data) {

   memset(wr_buf, 0xFF, 512*sizeof(uint8_t));

   memset(wr_buf, data, 16*sizeof(uint8_t));

   FLASH_page_program(FLEXSPI, (uint32_t)0x100000, (void *)wr_buf, 512));

}

 

Please let me know why it doesn't work well

Outcomes