LPC1114 - IAP ERASE PAGE - BUSY

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

LPC1114 - IAP ERASE PAGE - BUSY

651 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by masterboy on Thu Nov 06 01:26:20 MST 2014
Hi all,

I have a problem. I try use iap for erase page, but result is 1 = BUSY. What could be the problem? I tried it on a simple program:

#ifdef __USE_CMSIS
#include "LPC11xx.h"
#endif

#include <cr_section_macros.h>

#define IAP_LOCATION 0x1fff1ff1
#define IAP_PREPARE_SECTOR50
#define IAP_COPY_RAM_TO_FLASH51
#define IAP_ERASE_SECTOR52
#define IAP_BLANK_CHECK_SECTOR53
#define IAP_READ_PART_ID54
#define IAP_READ_BOOT_CODE_VERSION55
#define IAP_COMPARE56
#define IAP_REINVOKE_ISP57
#define IAP_READ_UID58
#define IAP_ERASE_PAGE59

#define PAGE_LEN256
#define SECTOR_NUM_PAGES16

unsigned int command_param[5];
unsigned int status_result[4];

typedef void (*IAP)(unsigned int [],unsigned int[]);
static const IAP iap_entry = (IAP)IAP_LOCATION;

volatile static uint8_t au8_buffer[256];

uint8_t u8_page = 96;

int main(void) {

command_param[0] = IAP_PREPARE_SECTOR;
command_param[1] = u8_page / SECTOR_NUM_PAGES;
command_param[2] = u8_page / SECTOR_NUM_PAGES;
iap_entry(command_param, status_result);

command_param[0] = IAP_COPY_RAM_TO_FLASH;
command_param[1] = u8_page * PAGE_LEN;
command_param[2] = &au8_buffer;
command_param[3] = PAGE_LEN;
command_param[4] = SystemCoreClock / 1000;
iap_entry(command_param, status_result);

command_param[0] = IAP_PREPARE_SECTOR;
command_param[1] = u8_page / SECTOR_NUM_PAGES;
command_param[2] = u8_page / SECTOR_NUM_PAGES;
iap_entry(command_param, status_result);

command_param[0] = IAP_ERASE_PAGE;
command_param[1] = u8_page;
command_param[2] = u8_page;
command_param[3] = SystemCoreClock / 1000;
iap_entry(command_param, status_result);

    while(1) {
    }
    return 0 ;
}
Labels (1)
0 Kudos
Reply
4 Replies

536 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Nov 08 12:09:08 MST 2014

Quote: masterboy
I have to disagree.



:quest:

Quote:

26.7.10 Erase page
Remark: [color=#f00]See Table 369 for list of parts that implement this command.[/color]



So does your MCU support it or not?
0 Kudos
Reply

536 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by masterboy on Sat Nov 08 11:53:10 MST 2014
I have to disagree. According UM10398 on page 440 is the command given in the table. So I assume that this command is functional. Please NXP statements.
0 Kudos
Reply

536 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Nov 07 11:31:31 MST 2014

Quote: masterboy
What could be the problem?



... that your MCU isn't supporting IAP 59 (see UM table...)  :(

0 Kudos
Reply

536 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Fri Nov 07 10:10:15 MST 2014
I don't see any obvious problem.  Can you confirm that SystemCoreClock has been initialized correctly?

Paul
0 Kudos
Reply