cheapest way to program the Nations N32G455 512KB - Page 1
Forum section: electronics / general

author: Nikan
author_rank: Regular Contributor
timestamp: May 24, 2024, 06:36:22 am
content: Greetings and salutations!I have a device that uses an N32G455. Unfortunately, its flash got corrupted. I have dumped the flash of a working chip.What would be the cheapest way to program the N32G455's flash without touching the RAM, registers etc.? (SWD would be very nice)I have flashed a Nucleo board with an ST-Link to a J-Link just to find out that the ST-J-Link only supports ST chips.Programming the N32G455 without buying additional hardware would be wonderful.Any advice is welcome!Thanks in advance and Best Regards!

author: mikerj
author_rank: Super Contributor
timestamp: May 24, 2024, 09:25:27 am
content: The N32G455 is an STM32 clone and as such includes a UART and USB bootloader to allow uploading code via a simple serial link. Unless there is already a USB interface present on your device the UART bootloader would be much simpler to use, but does depend on the UART and BOOT0/BOOT1 pins being accessible and not connected to circuitry that will interfere with their use.

author: Nikan
author_rank: Regular Contributor
timestamp: May 24, 2024, 07:08:40 pm
content: Exactly. By choosing the STM32G431RB MCU in J-Flash, I was able to dump the entire 512KB of flash from the working and not-working Nations chip. Unfortunately, it is not possible to flash the chip that way; an error always occurs, but it does not specifically indicate the type of error. It is unclear if this is due to the difference in internal flash sizes of the chips or if there is an ID mismatch, etc.By comparing the dumped files of the good and bad chips, it is clear in the hex editor that the bootloader is partially corrupted as well.

author: __george__
author_rank: Contributor
timestamp: May 24, 2024, 08:51:48 pm
content: J-Link has this chip in their supported list:https://www.segger.com/supported-devices/nations/n32g4xxSo you should be able to choose the exact chip that you have and maybe have better luck?openocd has a PR that adds support for this which you can try as well:https://github.com/openocd-org/openocd/pull/20But from what you are saying you seem to be using the debugger on the nulceo board to do this?

author: thm_w
author_rank: Super Contributor
timestamp: May 24, 2024, 09:26:28 pm
content: Someone here hacked the stlink to function as a full unrestricted jlink, but I don't know if the instructions were clear enough to easily reproduce.Blackmagic probe might work, but usually bluepill board is used for thathttps://black-magic.org/hacking/target-mm32.htmlOther option is buy a jlink edu or a jlink clone.Quote from: __george__ on May 24, 2024, 08:51:48 pmCan't, as mentioned above, j-link nucleo only allows ST devices.Quote from: Nikan on May 24, 2024, 07:08:40 pmThe bootloader mikerj is talking about is in hardware, assuming it exists, it can't be corrupted.

author: Nikan
author_rank: Regular Contributor
timestamp: June 07, 2024, 02:08:24 am
content: Sorry for the delayed reply.I tried the N32G455 files, but unfortunately it had lots of errors the compiler did not like. Once I get it running, I will repost that.But for now I just ordered an edu version as I was told that J-link commander is able to detect some fakes making those ones useless.Thanks again!

author: w.v.s.
author_rank: Frequent Contributor
timestamp: March 30, 2025, 03:23:19 pm
content: Quote from: Nikan on June 07, 2024, 02:08:24 amHello Nikan, did you succeed with the J-link edu?