HardwareFault on erase_user_flash with emWin

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HardwareFault on erase_user_flash with emWin

469 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dennisyeung on Wed Apr 23 23:35:24 MST 2014
Hi All,

I use LPC1788 with emWin. When I call erase_user_flash, everything is OK.
But with emWin in this way:
         GUI_Init();
         erase_user_flash();

This gives HardwareFault when calling     prepare_sector(USER_START_SECTOR,MAX_USER_SECTOR,cclk);
inside erase_user_flash();

Do anyone have the solution about it?

BR
Dennis
Labels (1)
0 Kudos
2 Replies

449 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dennisyeung on Thu Apr 24 04:03:09 MST 2014
Hi All,

After searching from internet, here is the link that giving the solution:

http://host.lpcware.com/content/forum/lpc1788-matrixarb-register-not-working-properly

BR
Dennis
0 Kudos

449 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dennisyeung on Thu Apr 24 03:30:57 MST 2014
Hi NXP FAE,

I found the fact that causing the HardFault Error without knowing the reason.

Inside the GUI_Init, it access the code MATRIX_ARB = 0xD, this causes the erase_user_flash to generate HardFault Error.
That is:
             MATRIX_ARB = 0xD;
             erase_user_flash();                  // Running this code with MATRIX_ARB is accessed, it will generate the error code.
With the MATRIX_ARB = 0xD is removed inside the _Initlcdcontroller, that is:
             GUI_Init();                                 // No MATRIX_ARB access inside the _Initlcdcontroller
             erase_user_flash();                  // It works well

Can anyone know why accessing MATRIX_ARB will causes the erase_user_flash() to generate the HardFault Error?

BR
Dennis
0 Kudos