LPC1768 IAP flash programming functions crash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1768 IAP flash programming functions crash

1,216 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jchan12345 on Thu Aug 23 01:10:01 MST 2012
I am using the IAP functions at 0x1FFF1FF1 to erase and program flash of LPC1768, but it will crash occasionally at the address of [FONT=&quot]0x1FFF0F3E[/FONT].

6<symbols is not available>[FONT=&quot]0x[/FONT]fffffffe
5<signal handler called>0 0xfffffff1
4<symbols is not available>[FONT=&quot]0x[/FONT]fffffffe
3<signal handler called>0 0xfffffff9
2<symbols is not available>[FONT=&quot]0x1fff1890[/FONT]
1<symbols is not available> [FONT=&quot]0x1fff0f3e[/FONT]

Do you know if there is any bugs in the IAP ROM functions ??

Thanks,

:confused:
Joseph
[email]jchan12345@yahoo.com[/email]



---------------------------------------------------------------------------------------

/* IAP boot ROM location and access function */
#define IAP_ROM_LOCATION                0x1FFF1FF1UL
#define IAP_EXECUTE_CMD(a, b)            ((void (*)())(IAP_ROM_LOCATION))(a, b)


 
[COLOR=#3F7F5F][FONT=&quot]/* IAP Command Definitions */[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_PREPARE_SECTORS             50[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_COPY_RAM_TO_FLASH           51[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_ERASE_SECTORS               52[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_BLANK_CHECK_SECTORS         53[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_READ_PART_ID                54[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_READ_BOOT_ROM_VERSION       55[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_COMPARE                     56[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]     IAP_CMD_REINVOKE_ISP                57[/FONT][/COLOR][FONT=&quot][/FONT]
  [B][COLOR=#7F0055][FONT=&quot]#define[/FONT][/COLOR][/B][COLOR=black][FONT=&quot] IAP_CMD_READ_SERIAL_NUMBER              58[/FONT][/COLOR]


 
[COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] [B]u32IAP_EraseSectors[/B]([/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32StartSector, [/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32EndSector);[/FONT][/COLOR]


 
[COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] [B]u32IAP_PrepareSectors[/B]([/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32StartSector, [/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32EndSector);[/FONT][/COLOR][FONT=&quot][/FONT]
 
[COLOR=black][FONT=&quot][/FONT][/COLOR][FONT=&quot][/FONT]
 
[COLOR=black][FONT=&quot][/FONT][/COLOR]
 
[COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] [B]u32IAP_CopyRAMToFlash[/B]([/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32DstAddr, [/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32SrcAddr, [/FONT][/COLOR][COLOR=#005032][FONT=&quot]uint32_t[/FONT][/COLOR][COLOR=black][FONT=&quot] u32Len);[/FONT][/COLOR][FONT=&quot][/FONT]
0 项奖励
回复
6 回复数

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Mon Dec 02 07:14:45 MST 2013
User manual 10360

32.7.15 ISP Return Codes

9 : SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION
Command to prepare sector for write operation was not executed.
0 项奖励
回复

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by robin48gx on Fri Nov 29 09:07:48 MST 2013
Yes or just copy it out using pointers.
Cannot seem to get it to write now, the erase and protect IAP
functions return with OK but the copyramtofalsh function
returns error code 9
0 项奖励
回复

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Nov 27 09:44:31 MST 2013

Quote: robin48gx
...
but how do I read it back out ?



memcpy  :)
0 项奖励
回复

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by robin48gx on Wed Nov 27 09:35:50 MST 2013
How do you read from FLASH memory though ?
I have some data that I wish to use on powerup, i.e. I want to use about
5k of flash to store non volatile data.

I can write to flash,  u32IAP_CopyRAMToFlash, I can compare it to RAM, u32IAP_Compare
but how do I read it back out ?

----

Ah just been told about this, its a flat address space I can just read it. Was used to PIC18F family, where
its all special `table read' instructions and such like to read data out of flash.....
0 项奖励
回复

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jchan12345 on Thu Aug 23 11:29:07 MST 2012
This problem is fixed after disable irq before erasing or writing to the flash.:)
0 项奖励
回复

1,089 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Aug 23 02:18:46 MST 2012
No known problems - but have you read the section on how IAP uses the stack???
0 项奖励
回复