Author Topic: Shared Serial Port  (Read 4333 times)

Shawn

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Shared Serial Port
« on: November 02, 2007, 11:58:45 am »
Hi (Andy?).

My target device uses a LPC2378.  The serial port on the device is always connected to the PC and communicating data between the micro and our own software app.  In our micro app there is a command that the PC an send that will put the 2378 into the boot block. 

With an unprogrammed device, it will startup in the boot block.  Our PC app can not detect that the unit is in the boot block so it sends the command to put the unit into the boot block.

My questions are:

If data is sent to the 2378 before the "?" character for autobaud, what happens?  Does the bootblock go off in the weeds never to return?

If the unit is already in the bootblock, is there a way we can detect that?  Can we interact with the bootblock at all?

Thanks,

Shawn

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Shared Serial Port
« Reply #1 on: November 05, 2007, 07:45:47 am »
The bootloader autobauds on the first character it receives, so anything other than a '?' will cause it to measure the wrong baudrate. Communications likely will not work. The bootloader will continue to execute however, but you won't know the baudrate it is using, and it could be anything like 3712 baud - i.e. a baudrate that the PC can't use.

If the bootloader has already been through the autobaud process and the crystal frequency has been sent, then you can sent it an unknown command (followed by CR-LF) and it will respond with something logical. As long as your application doesn't also do that then you can tell the difference.

Note that there is a feature in Flash Magic called Start Bootloader, which allows you to send any arbitary command out of the serial port in order to tell your firmware to enter ISP mode. You can find it on the ISP menu.

Can your firmware change the state of one of the handshaking signals on the COM port? The bootloader doesn't use them, so if your firmware toggles the state a couple of times and your PC application sees this, then you know that your firmware is running.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com