WAVGAT AVGA328P
David H. Bronke wrote 08/13/2019 at 01:17 • 0 pointsHas anyone successfully flashed one of these chips? I picked up a couple of these Pro Mini clones from AliExpress: https://www.aliexpress.com/item/32954944560.html?spm=a2g0s.12269583.0.0.86a0619bj6M0VB
So far, after installing the "drivers" from https://www.pcboard.ca/arduino-uno-r3-wavgat-setup , I've tried flashing them with:
- An FTDI board (https://www.aliexpress.com/item/714576465.html?spm=a2g0s.9042311.0.0.27424c4dTUyrZr - the red one): I was able to get the flash portion to "work" (by which I mean the write seemed to succeed, but verify failed, being unable to read the flash) by using this command: avrdude -v -c arduino -P /dev/ttyUSB0 -p atmega328p -b57600 -Uflash:w:build/rt-soldering-station.ino.hex:i
- A USBtinyISP clone (https://www.aliexpress.com/item/32963596310.html?spm=a2g0s.9042311.0.0.27424c4dTUyrZr): Unable to get it working at all; gets "avrdude: initialization failed, rc=-1", which doesn't help diagnose things at all. Used command: avrdude -v -c usbtiny -p atmega328p -Uflash:w:build/rt-soldering-station.ino.hex:i
- The trusty old BusPirate (http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming): Tried with both "buspirate" and "buspirate_bb" (bitbang) modes, and neither worked.
So far, nothing works. Has anyone actually been able to flash anything to one of these chips? If so, how?
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
This is the most updated repository that I'm aware of:
https://github.com/dbuezas/lgt8fx
In the repository above,
LGT8FX > lgt8f > bootloaders > lgt8fx8p > makefile
the makefile definition info for programming this chip is:
---------------------------------------------------------------------------------------------------------
# LGT8F328P
lgt8f328p: EXT_OSC ?= 0
lgt8f328p: TARGET = lgt8f328p
lgt8f328p: MCU_TARGET = atmega328p
lgt8f328p: CFLAGS += $(COMMON_OPTIONS)
#lgt8f328p: CFLAGS += $(COMMON_OPTIONS) '-DSOFT_UART'
lgt8f328p: CFLAGS += '-DVIRTUAL_BOOT_PARTITION'
lgt8f328p: AVR_FREQ ?= 16000000L lgt8f328p: LDSECTIONS = -Wl,--section-start=.bootv=0x0
lgt8f328p: LDSECTIONS += -Wl,--section-start=.text=0x7400 -Wl,--section-start=.version=0x77fe
lgt8f328p: $(PROGRAM)_lgt8f328p.elf
lgt8f328p: $(PROGRAM)_lgt8f328p.hex
lgt8f328p: $(PROGRAM)_lgt8f328p.lst
lgt8f328p_isp: lgt8f328p
lgt8f328p_isp: TARGET = lgt8f328p
lgt8f328p_isp: MCU_TARGET = atmega323p
lgt8f328p_isp: isp
_____________________________________________________________
AVRdude manual (https://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions):
-C config-file
Use the specified config file for configuration data. This file
contains all programmer and part definitions that AVRDUDE knows about.
If you have a programmer or part that AVRDUDE does not know about, you
can add it to the config file (be sure and submit a patch back to the
author so that it can be incorporated for the next version). If not
specified, AVRDUDE reads the configuration file from
/usr/local/etc/avrdude.conf (FreeBSD and Linux). See Appendix A for
the method of searching for the configuration file for Windows.
If config-file is written as +filename
then this file is read after the system wide and user configuration files. This can be used to add entries to the configuration
without patching your system wide configuration file. It can be used several times, the files are read in same order as given on the command line.
---------------------------------------------------------------------------------------------------------------
It doesn't look like logic green has made a proper -C configuration file for AVRdude, at least not inside of the ArduinoISP core and build files. It looks like the configuration was baked into the ArduinoISP tool chain. I haven't figured out how to extract it...yet.
Their ArduinoISP sketch is pretty different than the one used by default too. I'm no expert though.
-Jake
Are you sure? yes | no
Hello,
Did you find a way to program it through SWD or with a HV programmer?
Are you sure? yes | no
(If it's the LGT8F328 chip) There was a thread here: https://www.avrfreaks.net/forum/forbiden-tech-china-has-arrived , and a modified "LArdinoISP" here: https://github.com/LGTMCU/LarduinoISP
The LGT chip is "more or less" pin and code compatible with the ATmega328p, with a few extra features...
See also: https://github.com/RalphBacon/LGT8F328P-Arduino-Clone-Chip-ATMega328P
Are you sure? yes | no
I just watched Ralph Bacon's video on the way home. He has some great info there!
I may try out that LarduinoISP project for programming it pretty soon... just need to adapt it to a Pro Micro or a DigiSpark. (probably the former, since it's at least an ATmega168)
Thanks for the links!
Are you sure? yes | no
I just tried programming LarduinoISP on a different pro mini (which actually does use an ATmega168P) and hooking it up to the WAVGAT, but programming the WAVGAT failed. It's probably complicated a bit by the fact that the SWC and SWD pins aren't actually exposed on the board, so I had to clamp directly on to those chip leads.
Are you sure? yes | no
The first few comment from aliexpress:
>The chip is not atmega!!! And some other side! Everything works with additional manipulations in the development environment.
>it is not atmega328 you need download support WAVGAT boards to arduino ide
read through some of the forums and some said it might be LGT8F328P
The Chinese datasheet shows it is a different beast. More like modern day Arm peripherals (DAC, 12-bit ADC), but with some 32MHz 8-bit CPU probably similar to AVR.
SWD/SWC for debugger look similar to Arm, but no further info. So no AtMega HVISP nor 6-pin ISP is going to work.
English datasheet:https://www.avrfreaks.net/sites/default/files/forum_attachments/LGT8F88A%20V1_1.pdf
Are you sure? yes | no
Thank you for finding that datasheet! I hadn't had any luck with that. I'll take a look sometime soon.
Are you sure? yes | no
Looks like this guy did a really in-depth investigation into another of the WAVGAT devices: http://arduino.ru/forum/apparatnye-voprosy/obzor-klona-megi328-lgt8f328p (I really wish I could get Google Translate to actually translate the page; I've had to resort to copy/pasting text into Google Translate manually) On that one, at least, it definitely seems like they're using a chip that's a copy of the LGT8F328P.
I'm hoping I'll be able to program it via SWD, once I get a programmer/debugger capable of that. Looks like the ST-Link v2 is a pretty cheap option for this, and I found a cheap combo that also comes with an STM32 board: https://www.aliexpress.com/item/33044684058.html?spm=a2g0o.productlist.0.0.4c224e33kDtLNu&algo_pvid=6235240e-7af0-44ee-9ad5-b0b0f2b66572&algo_expid=6235240e-7af0-44ee-9ad5-b0b0f2b66572-10&btsid=341c0e1a-838b-4e7a-8cf3-208773077cbf&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_52 As a bonus, as long as that ST-Link V2 breaks out the right pins, I should be able to flash the Black Magic Probe firmware on it. :)
Are you sure? yes | no
Maybe I'll try doing HV programming and see if I can recover it that way... https://hackaday.com/2009/03/13/avr-hv-rescue-shield/
Are you sure? yes | no
There could be a few things that could go wrong. Are you sure it comes with a boot-loader? Have you tried re-burning the boot-loader through the Arduino? Since it's a normal ATmega328, you probably won't need exotic hardware to just program it, a simple USB-UART bridge should do.
Are you sure? yes | no
That's why I was trying to use the USBtinyISP and BusPirate; those program over SPI, so from what I understand they should still be able to program it even without a bootloader. (at least, that's how they work on the Nano and the Pro Micro) Sadly, I couldn't get either of them to talk to this chip.
I've been asking the seller about it too, and after reposting the same instructions he had in the description of the item, he said he'll refund the money for the boards since they aren't working. Honestly, though, I'm not concerned about the money - it totaled $2.82 for two of them, including shipping. I'd much rather be able to find a way to actually make the chips useful. ;)
Oh, also... the chip is not actually an ATmega328, but rather a clone: a WAVGAT AVGA328P.
Are you sure? yes | no