Author Topic: cheapest way to program the Nations N32G455 512KB  (Read 1409 times)

0 Members and 1 Guest are viewing this topic.

Offline NikanTopic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: de
cheapest way to program the Nations N32G455 512KB
« on: May 24, 2024, 06:36:22 am »
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!
« Last Edit: May 24, 2024, 06:39:39 am by Nikan »
living without a multimeter is possible but not worth it
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3306
  • Country: gb
Re: cheapest way to program the Nations N32G455 512KB
« Reply #1 on: May 24, 2024, 09:25:27 am »
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.
 

Offline NikanTopic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: de
Re: cheapest way to program the Nations N32G455 512KB
« Reply #2 on: May 24, 2024, 07:08:40 pm »
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.
living without a multimeter is possible but not worth it
 

Offline __george__

  • Newbie
  • Posts: 8
  • Country: no
Re: cheapest way to program the Nations N32G455 512KB
« Reply #3 on: May 24, 2024, 08:51:48 pm »
J-Link has this chip in their supported list:
https://www.segger.com/supported-devices/nations/n32g4xx

So 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/20

But from what you are saying you seem to be using the debugger on the nulceo board to do this?
 
The following users thanked this post: Nikan

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6982
  • Country: ca
  • Non-expert
Re: cheapest way to program the Nations N32G455 512KB
« Reply #4 on: May 24, 2024, 09:26:28 pm »
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 that https://black-magic.org/hacking/target-mm32.html
Other option is buy a jlink edu or a jlink clone.

J-Link has this chip in their supported list:
https://www.segger.com/supported-devices/nations/n32g4xx

So you should be able to choose the exact chip that you have and maybe have better luck?

Can't, as mentioned above, j-link nucleo only allows ST devices.

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.

The bootloader mikerj is talking about is in hardware, assuming it exists, it can't be corrupted.
« Last Edit: May 24, 2024, 09:29:36 pm by thm_w »
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 
The following users thanked this post: Nikan

Offline NikanTopic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: de
Re: cheapest way to program the Nations N32G455 512KB
« Reply #5 on: June 07, 2024, 02:08:24 am »
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!
living without a multimeter is possible but not worth it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf