-
Notifications
You must be signed in to change notification settings - Fork 88
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? |
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. |
Things are getting weird. I have tested some additional purple LQFP32 boards and found different behaviour when trying to use them as programmers. In summary I found four types:
The behavior of each board is reproducible, i.e. it's no a random effect. In some cases I get the "out of sync" meassage, in other cases AVRDUDE reads 0x0000 as device signature. All boards look identical apart from the USB-to-TTL chip. I burned the bootloader on all boards but this had no effect. Whenever I tested several boards from one shop, they all behaved the same. I.e. this is not a random phenomenon. |
Are these with a known bootloader?
…On Fri, Jun 28, 2024 at 3:20 PM Wolfgang (Wolle) Ewald < ***@***.***> wrote:
Things are getting weird. I have tested some additional purple LQFP32
boards and found different behaviour when trying to use them as
programmers. In summary I found four types:
1.
Boards with CH9340C:
a) Some work if you cut pin 8
b) For others this workaround does not help
2.
Boards with CH340C:
a) Some just work without any trick
b) Others don't
The behavior of each board is reproducible, i.e. it's no a random effect.
In some cases I get the "out of sync" meassage, in other cases AVRDUDE
reads 0x0000 as device signature. All boards look identical apart from the
USB-to-TTL chip. I burned the bootloader on all boards but this had no
effect. Whenever I tested several boards from one shop, they all behaved
the same. I.e. this is not a random phenomenon.
—
Reply to this email directly, view it on GitHub
<#312 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPEX7EK6DPSPXBSHZ22MXTZJWZRDAVCNFSM6AAAAABDTZ5F42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGQ4TMMJWGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I have tested the boards with the bootloader which was on them when they arrived but I also burned the bootloader again using a green board as bootloader. This made no difference. |
I really don't get this. Once the isp starts up the communication between the pc and programmer is serial, and programmer <=> target is just gpio.
The only candidates left I see are specific baud rates, and here there's something odd:
That shouldn't work at all in any board (I don't understand how it works on any board), it may be worth trying:
|
Duno if it may help, but I remember that CHxxx UART IC that use internal clock source instead of an external crystal tends to fail more often (at certain baudrate speed). |
Interesting, then changing the baud rate in platforms.txt and the isp code may work |
I spent some hours playing with different baudrates with no success. I will stop here, at least for the moment. |
A mystery. |
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: