Author Topic: LPC1114 Auto-baud Inconsistency  (Read 6258 times)

coolbrian

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
LPC1114 Auto-baud Inconsistency
« on: July 11, 2013, 04:58:12 am »
Hello all,

I just tried the Flash Magic to program my LPC1114 board.  However, it often fails at the auto-baud stage.  Yes, it sometimes passes the auto-baud stage, but rarely.  I always pull low the ISP pin and reset the board before trying a new cycle.

If I manually sync the baud rate with a terminal, the subsequent programming will go smoothly.
I am not sure what is going on.  I have attached the debug log, which I cannot comprehend, to help isolate the problem.

One thing to note is that when manually doing the auto-baud stage, the terminal will often echo garbled bytes when '?' is sent.
I have to try again with <ENTER> then '?'.  This may have to be tried several times.
When 'Synchronized' string is received, sending 'Synchronized' again will complete the auto-baud stage. 
ISP commands will then go smoothly.

If it is a hardware connection problem, I have no idea why the lengthy programming steps would go smoothly after a successful auto-baud.

P.S.  I tried the latest version, which is 7.50.

Thanks in advance for any pointers.


Brian

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC1114 Auto-baud Inconsistency
« Reply #1 on: July 12, 2013, 01:54:29 am »
Something is wrong in your serial port driver, although I am unsure what.

Windows is reporting that it has received a response to the '?', however when Flash Magic attempts to read the number of bytes read Windows reports a timeout error.

We have never seen this before so I think the problem is somehow specific to your PC. Perhaps try a different COM port and/or a different PC?

In regards to autobauding the bootloader is in a fast loop sampling the RxD pin. It looks at the waveform of the '?' and measures the bit time so it can calculate the baudrate. If the measurement is successful then the following communications will use the UART shift register and should be reliable. However if the measurement fails then the UART will not be able to understand any subsequent data.

Have you tried lowering the baudrate you are using? 115200 at 12MHz is probably pushing the limit of what will reliably work.

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

coolbrian

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: LPC1114 Auto-baud Inconsistency
« Reply #2 on: July 14, 2013, 08:03:38 pm »
Hello Andy,

Thank you for looking into the issue.

Fist of all, I must admit that I am using Flash Magic on my Linux box on top of wine, which I believe is not officially supported.
It just seems odd that when the auto-baud stage is manually done, the rest of lengthy erase and program cycles is done properly.

I just downloaded the secret 7.51 on your website, where the web page says it's 7.50.
This version indeed works fine on the same Linux box+wine+USB RS232 combo!
Does Version 7.51 include the fix to the problem or is it just some random combination of board, cable, OS... that fixed my problem?

Thank you for keeping the tool improving. :-)


Brian



Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC1114 Auto-baud Inconsistency
« Reply #3 on: July 15, 2013, 12:43:51 am »
The only change between 7.50 and 7.51 was a change to the signatures of a couple of devices. So it is indeed puzzling why 7.51 behaves differently to 7.50.

If you still have the 7.50 installer it would be interesting to go back and try it again to confirm that it still doesn't work correctly.

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

coolbrian

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: LPC1114 Auto-baud Inconsistency
« Reply #4 on: July 15, 2013, 01:24:45 am »
Hello Andy,

Thank you for the comments.

I reinstalled 7.50 and did another round of tests with 7.50 and 7.51.  Here are the findings:
  • 7.50 and 7.51 do work with the option, "Assert DTR and RTS while COM Port open", ticked.
  • 7.50 and 7.51 do NOT work, at least not reliably, without the option, "Assert DTR and RTS while COM Port open".

I did three fresh cycles of erase/program/verify for each version in the same Linux+wine environments and same USB RS232 cable.

I did not keep track of what options my previous failed tests were based on.  Sorry about that.

Well, I am still not sure what went wrong, but I am glad that Flash Magic works for a Linux guy like me. ^^

Just for reference:
# wine --version
wine-1.4.1



Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC1114 Auto-baud Inconsistency
« Reply #5 on: July 15, 2013, 01:28:36 am »
That setting might have an effect on your hardware depending on the circuit. Currently it looks like an electrical issue of some kind.

Thank you for retesting and posting back.

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