In-Application-Programming

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

In-Application-Programming

2,187 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcopompeo on Mon Aug 08 02:46:28 MST 2011
[FONT=Tahoma]I have a head modulewithin a LPC1768 and some smart pads with LPC1114 microcontrollers inside. TheLPC1114 microcontrollers comunicate with the LPC1768 with UART protocol. I'dlike to ask you if Can I update the LPC114 using the LPC1768 from UART bus? Isit possible to do it? If the answer is affirmative can you tell me a simple wayfor develop it? [/FONT]
[FONT=Tahoma][/FONT]
[FONT=Tahoma]Can you tell me more about IAP and how can I use it to do a firmware update of my LPC1114?[/FONT]
0 Kudos
Reply
7 Replies

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcopompeo on Fri Sep 02 07:52:31 MST 2011
I store the .HEX file (new file to be updated in the LPC1114 uC) in a sector of the LPC1768 using Flash Magic tool.
The LPC1114 is in ISP mode!!
Now I transfer this .HEX file byte to byte using UART from LPC1768 to LPC1114 [B][U]as it is[/U][/B].

Is it the correct way to accomplish data transfer of new code using UART?

Thank you in advance!!

Best regards,

MP
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by acno on Thu Aug 25 09:44:13 MST 2011

Quote: marcopompeo
...........
Now, if the part above is correct, I'd like to ask you if this sequence is correct:

1) First I invoke ISP in lpc1114
2) then data transfer of new code begins (lpc1768 sends data through uart)
3) In lpc1114 I do nothing because ISP takes care to store new code starting from address 0.
4) at the end, I cycle power for a reset and new code will do executed.
...........



Yes, it is correct and if I'm not wrong there should be also a way to invoke a reset directly from ISP .

Andrea
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcopompeo on Fri Aug 12 03:27:47 MST 2011
I read the AN11015 but It's a little bit different to my own application.
Refer to section 3 of AN11015 I'd like to develop my application in this way:

First time I program my LPC1114 with Flash Magic tool but then I'd like to update LPC1114 firmware using my head module within LPC1768 to download new firmware into LPC1114 flash memory.

I don't use the assertion of a LPC1114 pin to enter in ISP mode, but I do this sending a command (by UART) from LPC1768 to LPC1114.

Flow of  typical application I'd like to develop is:

•LPC1114 is running with its user code.
•The LPC1768 sends a command to instruct LPC1114 that there is an upload request.
•The code inside LPC1114 part will read this command and conditionally invoke ISP via the "Reinvoke ISP" IAP command.
•UART Data transfer of  new .bin or .hex (new user code for LPC1114) file from LPC1768 to LPC1114 take place. 

Now, if the part above is correct, I'd like to ask you if this sequence is correct:

1) First I invoke ISP in lpc1114
2 then data transfer of new code begins (lpc1768 sends data through uart)
3) In lpc1114 I do nothing because ISP takes care to store new code starting from address 0.
4) at the end, I cycle power for a reset and new code will do executed.

Thank you in advance!

Best regards,
MP
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcopompeo on Thu Aug 11 03:58:00 MST 2011

Quote: acno
I' m developing a similar application, the difference is that I update from an SD card instead of a serial port, using IAP commands.



You should not use IAP but ISP commands to doing this. Obviously the port used for RS485 must be the same of ISP. To update the software simply implement a way on the slave side to go in ISP mode and then go with updating.
This AN covers it:
http://ics.nxp.com/support/documents/microcontrollers/pdf/an11015.pdf

You can also use IAP, but in this case you need to reimplement the code for the communication and returning to document AN10995 reported by kendwyer, with all its implications.


There should'nt be problems with half duplex.


The code to be uploaded start from address 0, see in the hex file addresses.


Sorry, my application use IAP not ISP, but shouldn't be anything more than the code to upload.
Andrea



Thank you thousand, your help have been precious for me. I'll study your app note!
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by acno on Wed Aug 10 06:30:27 MST 2011
I' m developing a similar application, the difference is that I update from an SD card instead of a serial port, using IAP commands.


Quote: marcopompeo

.......................
  [B]I'd like to use IAP command to send the new firmware from 1768 to  1114 and store the it in the portion of lpc1114 flash memory so it can  be executed at next power-on or reset.[/B]

So, my idea to design the upload of LPC1114 firmware is:

1) generate the LPC1114 user code .bin/.hex file
2)store this .bin file into a block of LPC1768 flash memory using flash magic software
3) send to LPC1114 the .bin file using UART protocol and IAP command
4) store it in  the code user segment of LPC1114 flash memory using IAP command
5) Then I'd like that at next power-on or reset the LPC1114 execute the new software.
.......................
    1) Are these steps correct?
   .......................
    



You should not use IAP but ISP commands to doing this. Obviously the port used for RS485 must be the same of ISP. To update the software simply implement a way on the slave side to go in ISP mode and then go with updating.
This AN covers it:
http://ics.nxp.com/support/documents/microcontrollers/pdf/an11015.pdf

You can also use IAP, but in this case you need to reimplement the code for the communication and returning to document AN10995 reported by kendwyer, with all its implications.


Quote: marcopompeo

2) Is it possible to send the .bin file using UART protocol passing through an half duplex RS-485 transceiver?


There should'nt be problems with half duplex.


Quote: marcopompeo

3)Where do I have to write the LPC1114 user code in LPC1114 flash memory?..
or which is the start and stop address for storing the new user code in LPC1114 flash memory?


The code to be uploaded start from address 0, see in the hex file addresses.


Quote: marcopompeo

4) When I transfer the .bin/.hex file from LPC1768 to LPC1114 flash memory Do I have to add special bytes or somethings to similar
or I only fransfer the .bin/.hex file as it is?
 
5)Do you have some examples code for this applications?
Please send me all document or application notes about this application!!


Sorry, my application use IAP not ISP, but shouldn't be anything more than the code to upload.
Andrea
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcopompeo on Wed Aug 10 03:30:07 MST 2011
Thank you thousand for the AN10995!!

My hardware is so configured: I have two different board, the first within a LPC1768 and the second
within a LPC1114. LPC1768 UART1 on P0.15 and P0.16 pins is connected to a RS485 bus transceiver (like st1480) to convert the LPC1768 UART1 signals in RS485 signals. These signals arrive to the second board passing
throug another RS485 transceiver that convert signals and connect these to the UART0 of the LPC1114.
[B]I'd like to use IAP command to send the new firmware from 1768 to 1114 and store the it in the portion of lpc1114 flash memory so it can be executed at next power-on or reset.[/B]

So, my idea to design the upload of LPC1114 firmware is:

1) generate the LPC1114 user code .bin/.hex file
2)store this .bin file into a block of LPC1768 flash memory using flash magic software
3) send to LPC1114 the .bin file using UART protocol and IAP command
4) store it in  the code user segment of LPC1114 flash memory using IAP command
5) Then I'd like that at next power-on or reset the LPC1114 execute the new software.

So I'd like to ask you:

1) Are these steps correct?

2) Is it possible to send the .bin file using UART protocol passing through an half duplex RS-485 transceiver?

3)Where do I have to write the LPC1114 user code in LPC1114 flash memory?..
or which is the start and stop address for storing the new user code in LPC1114 flash memory?

4) When I transfer the .bin/.hex file from LPC1768 to LPC1114 flash memory Do I have to add special bytes or somethings to similar
or I only fransfer the .bin/.hex file as it is?

5)Do you have some examples code for this applications?
Please send me all document or application notes about this application!!

Thank you in advance!
0 Kudos
Reply

1,690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kendwyer on Mon Aug 08 15:12:35 MST 2011
I think that this Application note will help:
http://ics.nxp.com/support/documents/microcontrollers/zip/an10995.zip
0 Kudos
Reply