Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Legacy microcontrollers Forum Discussions

Anonymous
Not applicable

HI, I'm trying to write (program) the workflash in the chip MB9DF566. The code is as follows:

IDE: IAR for ARM

#define WFCFG_UNLOCK_CODE      0xCF6DF1A5

#define WFCFG00_MA1_BASE           (0x0E000000)     // Base Addr of the workflash

#define WFCFG00_UNLOCK                                             \

{                                                                                            \

          WFCFG00_CPR = WFCFG_UNLOCK_CODE;        \

}

void Init_WorkFlash00(void)

{

          // Program enable

          //WFCFG00_UNLOCK;

          //WFCFG00_CR_WE = 1;

          // Flash wait control

          WFCFG00_UNLOCK;

          WFCFG00_CR_FAWC = 2;

          // Enable ECC

          WFCFG00_UNLOCK;

          WFCFG00_ECR_ECCOFF = 0;

          // Disable DMA

          WFCFG00_WCR_DMAEN = 0;

          // Disable the generation of hang interrupt requests

          WFCFG00_ICR_HANGIE = 0;

          // Disable generation of ready interrupt requests

          WFCFG00_ICR_RDYIE = 0;

          // Clear interrupts

          WFCFG00_ICR_HANGIC = 1;

          WFCFG00_ICR_RDYIC = 1;

          // Software reset

          WFCFG00_UNLOCK;

          WFCFG00_CR_SWFRST = 1;

}

void WorkFlash00Write(uint32_t Addr_Offset, uint32_t Data)

{

          uint32_t *pDes = ((uint32_t *)WFCFG00_MA1_BASE) + Addr_Offset;

          // Program enable

          WFCFG00_UNLOCK;

          WFCFG00_CR_WE = 1;

          while(0 != WFCFG00_WSR_ST);

          *pDes = Data;

          while(1 != WFCFG00_SR_RDY);

          // Program disable

          WFCFG00_UNLOCK;

          WFCFG00_CR_WE = 0;

}

When the code steps over the line: 

*pDes = Data;

the regester WFCFG00_BERR_ACCIGN  = 1, which means a command overrun, and the write operation fails.

Then when steps over the next line, the IAR show me a dialog "Warning: Stopped at unknown breakpoint".

Please help me to find the right way to write the workflash. Maybe directly access the workflash by point is not right, but I couldn't find a register which could access the workfalsh area.

0 Likes
1 Solution

For your concerned issue, please kindly contact your local Cypress Sales or Cypress distributors to get technical support.

Best regards,

Amy Wang

View solution in original post

0 Likes
3 Replies
HongyanW_86
Moderator
Moderator
Moderator
100 solutions authored 100 replies posted 50 solutions authored

nofl​ Do you have any suggestion about this MB9DF566 workflash write issue?

Best regards,

Amy Wang

Anonymous
Not applicable

The problem still bothers me.

0 Likes

For your concerned issue, please kindly contact your local Cypress Sales or Cypress distributors to get technical support.

Best regards,

Amy Wang

0 Likes