What is the USART boot protocol?

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

What is the USART boot protocol?

595 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Grant.Edwards on Thu Apr 11 10:04:26 MST 2013
I'm trying to boot a Keil MCB1857 eval board through
USART 3, and the protocol described in the NXP user's
manual appears to be wrong.

I send a 0x3f as described in the NXP user manual,
and I expected to get back the string "OK\r\n", but
instead I get back "Syncrhonized\r\n".

So, I change my code to accept "Synchronized" instead
of "OK".  After I send the header and the file, I
expect to get back "OK\r\n" or "FAILED\r\n".  But, I
get neither -- I get back three bytes: "\xda\x00\r".

Where can I find a document describing the protocol
used to to download a binary to the LPC1800 when
booting via USART?

Labels (1)
0 Kudos
3 Replies

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Grant.Edwards on Fri Apr 12 07:55:35 MST 2013

Thanks for the reply.I've been a bit disappointed in the accuracy and completeness of the NXP docs, so it's good to have somewhere to find accurate info.


<pre> From memory, the flash-based parts will only boot from external sources if there is no
valid code in internal flash, or the ISP pin (P2_7) is pulled low.</pre>

AFAICT, the flash-based parts do pay attention to the boot-source configuration pins, so they will will boot from USART using the ISP protocol even when there is valid code in flash and P2_7 is high. What they apparently won't do is boot using the binary USART protocol as described by the User's manual.


<pre> You should still be able to load code into ram using the ISP (then jump to the
appropriate location to execute it), it will just be slightly more work, and will
need to be UUencoded</pre>

Yes, that's not a problem -- I have an ISP utility I wrote which can upload, download, and run code in SRAM. It could be extended pretty easily to program flash as well. But, I don't really care about using the USART in ISP mode to program the LPC1857 eval board: I've got JTAG for that, and JTAG is a lot faster and more flexible.


The goal was to develop and test support for the binary USART boot mode which is what we were planning on using in production with the custom LPC1830 boards we're designing. OTOH, perhaps the NXP manuals are wrong about the LPC1830 also, and they are going to boot from USART using the ISP protocol. In that case: mission accomplished.

0 Kudos

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Hydron on Thu Apr 11 20:29:33 MST 2013

From memory, the flash-based parts will only boot from external sources if there is no valid code in internal flash, or the ISP pin (P2_7) is pulled low. If it does boot from an external source for either reason, if a UART is selected as a boot source it will invoke the ISP handler on that port, rather than the simpler binary based boot method that the non-flash parts used. You should still be able to load code into ram using the ISP (then jump to the appropriate location to execute it), it will just be slightly more work, and will need to be UUencoded before upload as the ISP is ASCII only. As I said before, this is from memory so might not be 100% right, but I thought it could help (was a bit of work figuring out this stuff myself!)


Edit: also, I'm using the LPC43xx rather than LPC18xx, but i believe most of the non-core-cpu stuff is the same between the families

0 Kudos

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Grant.Edwards on Thu Apr 11 11:25:23 MST 2013

After a little more experimentation, it looks like the LPC1857 is going into ISP mode.


According to the NXP user manual, it's not supposed to go into ISP mode unless P2_7 is pulled low.


According the the Keil eval board schematic, P2_7 is being pulled high. There's an "ISP" button that pulls it low, and according the the Keil docs, you have to hold the ISP button down while resetting the board to go into ISP mode.


How do I get the LPC1857 to boot from USART3?

0 Kudos