-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Won't flash using IDE 2.2.1 #312
Comments
Update: I wonder if I got some bad boards. I have 5 boards, 3 program ok, 2 won't. |
You could try to use one of the working ones for attempting to burn the bootloader on one of the defective boards. |
Can you show me how to connect the SPI pins? It is not clear from the board which ones connect to MOSI and MISO, CLK etc, seems to have a pin missing. Cheers (can only see SWC and SWD) |
You need LGTISP to burn the bootloader via SWD and SWC. |
Thanks, will give it a try. |
I loaded up a good LGT board with the LGTISP.ino sketch ok. However, when I go to program the bootloader to another LGT board connected with SWC,SWD etc it gives error.
I am somewhat confused as the instructions say to use AVR ISP as programmer, even though there is an " LGTSWD markii as ISP" option ?? |
There is a LarduinoISP sketch amongst the examples. Did you compile and load that one? The LGTSWD Mark II is this one. Probably not what you have. |
Right, you did not link that initially, now I understand. BUt the question remains, If I use LGT as ESP are the pin connections the same? |
I don't have those examples .... maybe I have the wrong LGT library? I got the library from here: |
I have added the core I am using above, is it incorrect? |
That's the one I use. |
So why no examples? |
I honestly have no clue.
|
LGTISP.ino may be a newer or older version. I have not used it myself as I usually grab my dedicated SWDICE programmer. The sketch I just uploaded here I have used a while back. But I just found my box with LGT's so let me try if it still works. |
Thanks will wait. Meantime I tried connecting the programming pins at the end of the board to the target board pins, but that did not work either. So Still unsure of pin connections. |
Just tested and works fine First burn the LarduinoISP.ino to your working Nano Then hook it up like
Keep AVRISP as programmer and press "burn Bootloader" I burned it to a "promini style" LGT board, as my second Nano has no pinheaders yet. But you will select the board you have to get the bootloader that goes with your board. |
I keep teling you, I am not using an Arduino Nano as ISP, I am using LGT Nano, do I still use pins 10,12,13 on the ISP side ? |
I also used LGT Nano |
Well I get this using those pinouts:
|
I have to go out, will pick this up later. Thanks for the help. |
I have exactly that! |
I'm back now if you have any more suggestions. I am using LarduinoISP.ino, but LGTISP.ino does not work either. |
Have you seen the tutorial in this repo? |
I have to get involved in this topic now. I have exactly the same problem. I have an LGT Nano as target and also an LGT Nano as ISP programmer. I have installed the Larduino and also read the example, which I have also installed on my LGT ISP as prescribed and then connected the ISP to the target as specified.
I have just tried again with a definitely working LGT EVB board, and come to the same result. I can't install the bootloader on this one either, with the same error message mentioned here. |
OK guys I have found the error, even if I can't really explain it to myself. |
The external crystal won't be used unless you specifically configure the board to use it. I made myself a connector with pogo pins and the reset cap and it has been a lot more reliable ever since. This leds me to believe that the ISP is particularly sensitive to bad connection issues (and also prone to them because of the temptation of "quickly" use jumper cables held with the hand) |
Hi @Devilscave , I am keen to try myself. I understood that the combination of the purple lgt based board and the green does not work. But I am not sure which board you used as programmer and which as target. Can you tell me that detail? Another point: you said you tried an Arduino Nano V3. This means a conventional one based on an ATmega328P? This is not a surprise that this does not work. |
Which purple one, the LQFP48 (larger) or LQFP32? |
Didn't know that Atmega328 do not work. What about an ESP-12 Uno board? |
Hi @lalo-uy , to be more precise: it possible to use a classic Arduino Nano but not if you follow the instructions here: https://github.com/dbuezas/lgt8fx/tree/master/lgt8f/libraries/LarduinoISP In oder to set the Serial RX Buffer to 250 Bytes you can't use the convenient way: Since you have to choose the board on which you want to upload the LArduinoISP sketch, you won't see this setting. Therefore, you have to make this setting manually in HardwareSerial.h which you hould find here: ...\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino If you should choose this way it works (I have tried beacuse I was curious), but I would recommend to spend little money for a second LGT8F328P based board instead.. With the ESP-12 Uno board it might work directly if the buffer is >= 250 bytes. Just check if the LArduinoISP sketch compiles. Done in a few seconds! |
In my text it says exactly when I used which one. I only tried a purple LGT in my first post and that didn't work.
I figured if it works with a UNO, why not. But I already encountered the error when programming that I can't make the bit settings at all, funnily enough the Nano eats the sketch anyway.
LQFP32 |
Hi @Devilscave, I can reproduce the issue with the purple LQFP32. It does not work as a programmer, at least when following the standard procedure. I tried burning the bootloader on a green LQFP32 as well as on a purple LQFP32 using the purple LQFP32 as programmer. I also tried a purple LQFP48 as a programmer and that worked perfectly. So, it is a specific problem of the purple LQFP32. I don't know what the problem is and how to fix it. My gut feel says it is related to the CH9340C USB-to-TTL Chip on the purple LQFP32 board and how it is wired. But I have no proof for that. |
That's very odd.
Since the pcb layout is different, I wonder if some pin is either not connected or has some unwanted pulldown or capacitive coupling with the xtal on PB6 and 7 (same port as the original isp code uses). (I use the ISP like this so that the pins between programmer and programmed are aligned) Regarding the USB to TTL chip, what is your hunch based on? the serial part should only affect pc <-> isp, and that obviously works if serial burning works. Also, it may be worth trying setting the clock differently, e.g using the external one. |
I have to try it again now, because yesterday I must have shot something on one of the purple LGTs, it works to load sketches on it, but runs much too fast and the sketches only make measurements, it almost seems to me as if the bootloader is wrong. |
Hi @dbuezas , I have tried your sketch and get the same error like before: In order to confirm that I have not wired something wrongly, I have done the same with green LQFP32 and it worked. Then I found something interesting. I changed back to the purple LQFP32 and uploaded the standard LArduinoISP sketch. Then I connected the purple LQFP32 to a USB-to-TTL Adapter instead of the PC directly: It looked like this: All the rest is set up as one would do using the normal procedure. And it works! I was able to burn the the bootlader and to upload sketches using the purple LQFP32 as a programmer. I really think the problem is the CH9340C Chip. There are also purple LQFP32 boards available which other USB-to-TTL Chips than the CH9340C. I have order some from China, so it will take a while until I can test. If anyone reads this and has such a board, it would be great to know if these can be used as programmer. @Devilscave, can you check which chip you have on your board? |
I also have the CH340C on all the purple ones. |
@Devilscave , thank you. But I don't have the CH340C, I have the CH9340C. It's a small difference in the name, but these are dfferent chips. Sorry, but can you double check? |
That's very interesting, i really didn't expect that. Serial communication works normally at any baudrate otherwise? Übrigens, lass uns auf Englisch bleiben, das hier wird wahrscheinlich von anderen auch gelesen. Or maybe the reset line is held too long? I think that's controlled by the usb-ttl chip. The capacitor trick could serve to test that. |
No it's a CH340C
Sorry, I worked with a page translator and he simply translated my English answer as well. I've changed it. |
@Devilscave , thank you. Helpful information. Then it's something else on the board. Yesterday I tried to use a purple LQFP48 board which uses a CH340C hip like yours and that work as a programmer. @dbuezas , usually I take a 10µF capacitor. I also tried a 100 µF and a 100 nF capacitor and no capacitor. It all didn't work. Or what do you mean with capacitor trick? |
Yes I meant a cap at the reset pin. I thought maybe the programmer maybe was reset for too long by dtr. I burnt my isp without bootloader to avoid accidentally flashing it instead of the target device. I wonder if the purple ones come with a different bootloader? |
I have just burned a new bootloader on the purple LQFP32 and tried again to use it as programmer. But no success. Maybe I will have a good idea over night. |
Could it be that the serial doesn't work well at the specific baudrate used when isp programming? |
At least worth a try to change the baud rate. I am quite busy currently and so I cannot promise trying this within the next days. |
I have some news. I have now received purple LQFP32 boards with a CH340C from two different shops and both work as programmers as they should. I double checked that the purple board with the CH9340C still did not work. Since @Devilscave tried a board with a CH340C chip, which did not the difference between the CH340C and the CH9340C should not be the reason. I have burned on all boards the same bootloader, so this is also not the reason. I have no idea yet why some of these boards do not work. Maybe a bad batch of the PCBs? Here's a photo of one board that is working and another which does not. I can't see obvious differences: So, good that this is no general issue, but bad that we don't know why the problematic boards behave like they do and how to identify them (before you buy them!). |
@wollewald Maybe you could, since you own both boards and they seem to be identical, simply swap the CH340 chips across. If the error moves, it is the chip, if it stays, it is the board. |
Hi @Devilscave , good idea. Let me check if get the chip desoldered and transferred without damage. |
I have an idea about the problematic serial converter chip, CH9340C. |
Hi @LaZsolt , you are the hero! I cut the pin 8 and then it worked. To be absolutely sure, I reconnected pin 8, then it did not work, disconnected again and it worked. And it does not seem to have negative side effects. I can still upload sketches to the board when not used as programmer. Cutting the pin is not the nicest workaround, but at least we know what that issue is. However, this is only an explanation for the boards that I used. It does not explain why the board of @Devilscave does not work as a programmer since his one has a CH340C chip. @Devilscave , do you still know where you ordered your board? I would buy a board from the same source and hope that they have not changed the design meanwhile. |
@wollewald |
@Devilscave there's dozens of other shops offering them, they're all fine :) |
@dbuezas I know, I don't want to buy any, but Wollewald asked for my source of supply. |
Hi, I am trying to program LGTBF328P - MiniEVB nano board. I get the following error:
Any idea's ?
The text was updated successfully, but these errors were encountered: