HC32L110 complete erase - Page 1
Forum section: electronics / general

author: buttim
author_rank: Contributor
timestamp: August 28, 2023, 05:34:30 pm
content: Anyone can tell me if this MCU can be completely erased in case the debug interface and/or the reset pin have been disabled?I can't find any such information in the (translated) datasheet but some (https://github.com/pyocd/pyOCD/issues/1364#issuecomment-1098492831) say it should be possible.Thanks

author: IOsetting
author_rank: Regular Contributor
timestamp: August 30, 2023, 02:47:05 am
content: Translated from Datasheet Rev2.5 Page13QuoteDatasheet and HDSC ISP tool can be downloaded from their product pagehttps://www.hdsc.com.cn/Category82For HC32L110https://www.hdsc.com.cn/Category82-1389ISP programming uses UART port so USB2TTL dongle is required.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 30, 2023, 03:25:13 am
content: I guess you found that mcu somewhere in a device and you're trying to repurpose it?Because for what it costs you can get a much better STM32G030F6P6 for same price or lower.

author: buttim
author_rank: Contributor
timestamp: August 30, 2023, 12:43:09 pm
content: Quote from: DavidAlfa on August 30, 2023, 03:25:13 amExactly. The device (https://www.ebyte.com/en/product-view-news.html?id=129) has an interesting radio module on it, the AX5243. That's the source of my interest

author: buttim
author_rank: Contributor
timestamp: August 30, 2023, 12:46:58 pm
content: Quote from: IOsetting on August 30, 2023, 02:47:05 amI'm not proficient in chinese so I can't read the datasheet from the link you specified. Instead I found an (automatically translated) english version. I noticed it talks of an ISP methos but I guess it must be supported by the current firmware. Or is it a built-in feature of the MCU? What software should I use to upload a different firmware using ISP?

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 30, 2023, 01:42:03 pm
content: Probably it's the same as most, setting pin BOOT0=1 and powering it up.

author: buttim
author_rank: Contributor
timestamp: August 30, 2023, 03:29:32 pm
content: Quote from: DavidAlfa on August 30, 2023, 01:42:03 pmCan't find any reference to such a thing in the datasheet

author: abyrvalg
author_rank: Frequent Contributor
timestamp: August 30, 2023, 05:47:47 pm
content: From that translated fragment it looks more like some BootROM activated at each reset unconditionally (not requiring any pin pulled), waiting for some specific byte from the ISP tool within a short time window, then jumping to flash.

author: buttim
author_rank: Contributor
timestamp: August 30, 2023, 07:09:49 pm
content: Quote from: abyrvalg on August 30, 2023, 05:47:47 pmTrue. What worries me is that the reset pin can be multiplexed to a GPIO.What would happen in that case? I'm asking because I actually found an ISP programming tool but I'm not having any success with it...

author: IOsetting
author_rank: Regular Contributor
timestamp: August 31, 2023, 03:00:59 am
content: Quote from: buttim on August 30, 2023, 07:09:49 pmYou don't actually need the RESET pin. Power it off -> on will do it. ISP tool and HcUnlock tool can be downloaded from the link I posted. (I attached the screenshot of the download page)It's not recommended to re-program the module, unless you have the source code, otherwise you will easily brick it. HC32L110 is M0/M0+ based but the SDK is quite different from those of standard SPL/HAL/LL.Quote from: buttim on August 30, 2023, 12:43:09 pmE-Byte uses HC32 chips quite a lot in their products. They mainly use STM8L before, but about 2 or 3 years ago, they switched to HC32. I got to know HC32 series only because I bought their test-kit of nRF24L01 module.

author: buttim
author_rank: Contributor
timestamp: August 31, 2023, 10:40:10 am
content: Quote from: IOsetting on August 31, 2023, 03:00:59 amThanks a lot. I downloaded the unblock tool but when I launch it, it presents me a window like this, no idea what I should do

author: IOsetting
author_rank: Regular Contributor
timestamp: August 31, 2023, 11:56:51 am
content: There is a PDF in the zip file, these are the content of this PDF translated by machineQuoteIt seems this unlock tool works only on fixed portCOM4. The port number can be changed in Windows Device Manager (there are screenshots in the PDF).For the RESET part, if the RESET pin is not available, you can connect TX, RX and GND only, then run this tool and quickly connect the VCC. HC32L110 is 5V compatible but I would suggest to try 3.3V first.

author: buttim
author_rank: Contributor
timestamp: August 31, 2023, 12:38:15 pm
content: QuoteI renamed the port to COM4 and rebooted. Absolutely nothing happens when I launch the unlocker. The LEDs on the FT232 module never turn on so apparantly it is not trying to access the serial. I tried to access the port with a different program (Putty) at the same time and it works, so the com port is actually not in use it seems

author: IOsetting
author_rank: Regular Contributor
timestamp: September 01, 2023, 12:49:38 am
content: I'll see if I can do a test in the weekend.

author: IOsetting
author_rank: Regular Contributor
timestamp: September 02, 2023, 04:08:30 pm
content: Quote from: buttim on August 31, 2023, 12:38:15 pmConfirmed: the unlock tool doesn't work.I use a CH340 dongle and change the port to COM4, run the tool, nothing happens. It seems it didn't recognize the port, just kept reminding me to change the port to COM4.

author: IOsetting
author_rank: Regular Contributor
timestamp: September 02, 2023, 05:04:16 pm
content: The good news is the ISP tool works.The HC32L110 board I am usingWiring:* RTS -> P00* RX -> P31* TX -> P27* GND -> GND* 3.3V -> VCC1. Switch the language to English.2. Target MCU: HC32L110x4xx3. Com Baud: 115200 (691200 always fails on my CH340)4. Hex File: you need provide some dummy hex file, it's required but you can choose to erase without uploading5. COM Setting: the port used by USB2TTL6. Check Erase + Blank Check, leave Program,Verify,Encrypt unchecked. If you just want to test the communication without erase, uncheck them all.7. Click ExecuteThen it will reset the chip, do the erase and blank check. The output log tells the result of each step, 成功 means success.The tests without connecting RTS to P001. Using reset buttonIf I click Execute and press RESET at the same time, at a 20% success rate it successfully connected to the board and did the erase.2. Disconnect/Connect VCC manuallyI tried to reconnect VCC and click Execute button at the same time, I tried many times with no luck. In theory there is a possibility but the time window may be too short.

author: IOsetting
author_rank: Regular Contributor
timestamp: September 02, 2023, 05:29:02 pm
content: This can be achieved by circuit. I once made an auto-download circuit for STC8x 8-bit chipsUsing this dongle I can erase HC32L110 without connecting RESET pin

author: buttim
author_rank: Contributor
timestamp: September 02, 2023, 10:35:46 pm
content: Quote from: IOsetting on September 02, 2023, 05:04:16 pmMany many thanks for the very detailed explanation. Tomorrow I will read all that again and see if I can solve my problem.Just remember to reboot after you change name to a COM port otherwise the change will not have any effect.