LPC1768 does not work (uart bootloader does not want to work) - Page 1
Forum section: electronics / general

author: DocRaptor
author_rank: Contributor
timestamp: January 21, 2021, 07:22:40 pm
content: Hello everyone,this is my first post in this forum in hope, someone can help me with my problem. I'm in the process in making a 3d controller board with the lpc1768 microcontroller and five tmc2209, but I have a big porblem. I let jlcpcb made five pcbs, from which two are partially populated (only max. 10 different extended parts). I soldered on some extra resistors. What is missing are the three mosfets, the five tmc2209 chips and most of the connectors. I wanted to add them, when the mcu works. The problem is now that the lpc1768 does not work. I bodge a button on P2.10, so I can connect it to ground for starting the serial bootloader in combination of the reset button. In the next version of the board I will change the function of the pin to something different, so this pin goes to to a socket instead to be for the serial conection of the z-axis stepper motor. When I release the reset button and than the boot button (the button I bodged betwen P2.10 and ground), the serial bootloader should start and I should be able to load something on the mcu with flash magic. But instead it fails and this error show up: failed to autobaud-step 1. I tried with swapping the rx tx lines to the ftdi232 (so that rx from the mcu goes to the rx of the ftdi chip instead of tx and the same for tx), but it doesn't work. I remove resistor R19, which bridges P2.10 to P2.11 for the serial to the stepper driver in hope that it works, but nothing. Whats wierd is that a some of the io pins (including the serial) shows around 2.45v, some 0v. Also when I try to flash the mcu, the osciloscope show a tiny spike on one of the serial lines, where the voltage drops to half, but thats all. Whats even weirder, both mcus show similar behavior. If one would show this behavior, I would gues it is broken, but both show this behavior. Is there something I did wrong?Github of all the files:https://github.com/Doc-Raptor/dragon_controller_v2The pdf attached is the schematic

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: January 21, 2021, 07:35:19 pm
content: Dunno if this helps, but quite a few years ago, I did a project with an LPC1768 and described several ways to reprogram it:http://lemmini.de/NGen/NGen%20Reprogramming.html

author: DocRaptor
author_rank: Contributor
timestamp: January 22, 2021, 08:54:33 am
content: Quote from: 0xdeadbeef on January 21, 2021, 07:35:19 pmIt is similar to all the other description on the internet exept that it says to use 9600 baud. It still say "failed to autobaud-step 1". Note: In my version of flash magic I don't have the options Interface and Oscillator.

author: nctnico
author_rank: Super Contributor
timestamp: January 22, 2021, 04:20:58 pm
content: The best way to deal with these MCUs is to make a dedicated programming port which includes the reset and bootloader entry pins. That way Flash magic can use the serial port control lines to reset the MCU and get into the bootloader. Now you have to keep the bootloader entry pin low to enter the bootloader mode. From there Flashmagic should be able to access the MCU.BTW: you should also have a pull-up on the UART RX pins of the MCU.

author: DocRaptor
author_rank: Contributor
timestamp: January 23, 2021, 09:18:44 am
content: Quote from: nctnico on January 22, 2021, 04:20:58 pmHolding the bootloader entry pin up like you recommended helped. It is weird, every tutorial, every forumpost says to hold the reset pin, hold the bootloader pin, than release the reset pin and than release the bootloader pin and than start flashing with flash magic. But in my case this doesn't worked. But your recommendation worked in my case. Hold the reset pin, hold the bootloader pin, than release the reset pin and hold the bootloader pin as long as flash magic flash the mcu. Thanks.

author: nctnico
author_rank: Super Contributor
timestamp: January 23, 2021, 07:55:10 pm
content: It is weird you need to keep the bootloader enable pin low the entire time. This shouldn't be necessary but be sure to have a 10k pull-up on P2.10 . I also see you kept the JTAG interface floating. In one of my designs I connected TCK to ground to make sure the JTAG interface is inactive.