LPC812 Reprogramming Over SPI

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

LPC812 Reprogramming Over SPI

1,869 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Tue Oct 28 09:12:54 MST 2014
I'm trying to configure my LPC812 so that if after we have put it into application we need to change the code, we can do that through our established communication chain without having to physically access the devices. Our main processing unit communicates to the microcontroller over SPI, and in the case where we need to reprogram the microcontroller, we would be sending the new program over the same SPI line we receive communications over. I think I have set up the IAP commands I need to write the received program into flash.

However, it seems to me there are no IAP commands for reading Flash into RAM. I can use an IAP command to invoke ISP mode, but once in ISP mode, where Flash can be read, but I can't find a way to send the commands to the ISP within the program. If there is a way to do this, I would like to know.

My plan B is to simply use the IAP command to write over my current program in Flash, but this approach is more prone to failure, and I would rather not. In plan B, I will need to know where I can begin writing, won't I? Or should I erase the whole flash and write the new program in fresh?
标签 (1)
0 项奖励
回复
5 回复数

1,789 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Fri Nov 07 14:10:24 MST 2014
Thanks, that's the syntax I was looking for.
0 项奖励
回复

1,790 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc_bloke on Thu Oct 30 13:18:21 MST 2014

Quote: starblue

Quote: Rorrik
I'm not immediately familiar with how to create a pointer for a location in flash.


Since that is the bread and butter of embedded programming you'd better learn it.



You can't type:

*(uint8_t*)(LOCATION_IN_FLASH)

like the rest of us?
0 项奖励
回复

1,789 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Oct 29 01:53:15 MST 2014

Quote: Rorrik
I'm not immediately familiar with how to create a pointer for a location in flash.


Since that is the bread and butter of embedded programming you'd better learn it.
0 项奖励
回复

1,789 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Tue Oct 28 10:13:40 MST 2014

Quote: starblue
[The flash is accessible as normal memory, so to read it you can just copy it, for example with memcpy.



That's extremely helpful! Thank you!

I'm not immediately familiar with how to create a pointer for a location in flash. I'm sure I can find it somewhere online, but I wouldn't mind a direct answer for it.  :p
0 项奖励
回复

1,790 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Oct 28 09:30:49 MST 2014

Quote: Rorrik
there are no IAP commands for reading Flash into RAM.



The flash is accessible as normal memory, so to read it you can just copy it, for example with memcpy.
0 项奖励
回复