Writing variables to FLASH with IAP

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

Writing variables to FLASH with IAP

500 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanJames on Tue Mar 12 07:15:49 MST 2013
Hi,

I am attempting to write a 512 byte variable to FLASH using the IAP routines.

The problem is I get an error code 2 [SRC_ADDR_ERROR]

I have looked in the map file and see that the address of the variable is                 0x10000901                gNodeAddrTable

I assume this is the problem but how can I force the variable to to be word aligned?

I have another variable which works fine:

0x10000b12                gConfig

Thnaks,

Ian
0 Kudos
5 Replies

411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Mar 13 04:15:29 MST 2013

Quote: IanJames
Is there any way of preventing the Information blocks being erased during programming?



Usually programming (LPC-Link) is erasing only used sectors (if you don't enable Mass Erase) :)
0 Kudos

411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanJames on Wed Mar 13 02:43:05 MST 2013
Is there any way of preventing the Information blocks being erased during programming?
0 Kudos

411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Mar 12 10:00:59 MST 2013
#1 Reserve IAP RAM http://www.support.code-red-tech.com/CodeRedWiki/ReserveIAPRam ;)

#2 Disable Interrupts :eek:

#3 Do your IAP: Prepare/Erase/Prepare/Write :)
0 Kudos

411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanJames on Tue Mar 12 09:05:37 MST 2013
Thanks for that.

Now I need to find why I the write to flash using the IAP routines aren't working!
0 Kudos

411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Mar 12 08:10:42 MST 2013

Quote: IanJames

I assume this is the problem but how can I force the variable to to be word aligned?



Use your compiler
uint8_t dummy[COLOR=Red] __attribute__((aligned(align_value)));[/COLOR]
0 Kudos