Author Topic: Reading firmware out of a mask ROM microcontroller  (Read 19571 times)

0 Members and 1 Guest are viewing this topic.

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Reading firmware out of a mask ROM microcontroller
« on: January 29, 2021, 09:31:29 pm »
Hey everyone,

I have a Renesas M306H5MC microcontroller on a logic board for a Hitachi plasma TV I am working on.  The microcontroller only seems to control a few functions but is not outputting an enable signal when I feel it should be.  I was hoping to dump the firmware and take a look at it since the datasheet is available and I should be able to decode some of the instructions.  However, this is a mask ROM chip which I've read is not able to be dumped.

The microcontroller has different modes that are set by the state of the CNVss pin.  The snippet I have attached from the datasheet says that the ROM is unable to be read out if the CNVss pin is high on reset.  This seems to imply to me that it should be possible to read out the ROM if the CNVss pin is low on reset.

Is it actually possible to dump the firmware from this chip or is the manual just referring to the chip being able to access its own ROM?
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21651
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Reading firmware out of a mask ROM microcontroller
« Reply #1 on: January 29, 2021, 10:35:41 pm »
A few options:

0. Semiconductors rarely fail on their own.  It's probably not the issue, something else is.

0a. But yeah, if something caused it to fail (surge, ESD, crossed wiring, etc.), it can be toast.  In which case both the underlying cause, and the chip, need to be replaced.  Find a replacement board and, well, replace the board, no need to transfer just the chip at that point, huh?.. ::)

1. Sometimes, firmware functions include limited inspection or debugging or modification (code execution) operations.  You'll have to poke extensively at the chip.  A logic analyzer and generator -- often an FPGA or MCU board -- can be used to fuzz the inputs, and discover potentially useful internal state.

The actual hacking process is lengthy, requires careful observation and insight, and commitment -- likely, millions of input combinations will fail before finding interesting ones.

Once you find a foot in the door, you can leverage memory data or pointers to modify or read out some things.  For example, writes to the stack (assuming it's not a dedicated hardware stack) can be used to generate arbitrary return jumps (ROP, return oriented programming).  Blindly discovering function pointers in this way, isn't very attractive (probably it'll lead to a lot of crashes, hangups or resets -- automatic power cycling is often a necessary part of the setup..), but it's at least... plausible.  Eventually, you can build up a kit of "gadgets" that seem to do useful things without disturbing overall state (crashing), and potentially read out the program memory for complete disassembly.

Also, this assumes the chip is okay, or a replacement can be found.

1a. Even if its exact functions cannot be read out, in the process you may simply end up measuring the totality of its external function -- as a black box.  In which case you can simply write your own state machine and drop in any new MCU that is capable (via pin converter PCB, most likely).

2. Especially if it's dead-dead -- you can decap it and read it out directly.  Decapping typically isn't hard: the risky way is to simply heat the chip until its plastic softens (something like 300-400°C), and gently twisting it so that the plastic peels away from the die, without bending the die.  Typically the die is soldered or epoxied to a metal tab, and it can be gently pried or slid out of the remaining package.  See: https://youtu.be/ZQeHHYJYWXo

You do, of course, need a microscope to image the ROM.  If it truly is the mask ROM version, it should be pretty obvious, given adequate magnification.  Downside: if it happens to be a fine-pitch device, it might end up needing an electron microscope instead...

The safer method is boiling in acid, dissolving the plastic chemically.  This requires some dangerous materials not usually available to the public -- fortunately there are more than a few people, so equipped, on the internet, who can perform this service for a modest fee or donation (sometimes just the die itself, I think?).

And if an electron microscope is still required, all hope is not lost; there are commercial decapping and inspection services, of course the bill goes up considerably at this point; but if you were concerned about sheer possibility over economics, yes, it certainly is...

...But more available perhaps, there are a few netizens also with such microscopes, who you might be able to schmooze some machine time with.  Or probably more local, many universities are so equipped -- ask around, faculty are happy to respond and may be able to offer you some time on their machine, school year allowing.  Typical uses include, well, the same exact thing, micro-fabrication; as well as geology, metallurgy, chemical analysis, physics...  So, just because a university doesn't have a specialty like IC fabrication, doesn't mean they won't have one.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #2 on: January 30, 2021, 03:18:47 am »
Thanks for the in depth response!

Sorry, I should've been more clear in my original post.  I don't think the microcontroller itself is faulty.  Like you said, it is unlikely for them to just die for no reason.  I think it is most likely seeing something on one of its other inputs that it does not like and is not sending out my enable signal.  If I were able to dissasemble some of the code and see what the requirements were to enable that signal, it would point me in the right direction.

I just also found out that the micro has a rs232 port directly connected to it for service of the TV.  I hooked up a serial cable and terminal program but there is no activity from it at any time.  Perhaps I need to enable some special mode for it to become active?

And yes I saw some articles about decapping a chip and reading the ROM manually.  Even though this is a last resort and I could probably get access to a microscope, I do not think it is an option as there are no replacement chips available even if I was able to get the ROM and at that point it would be dead.

Any ideas on how to get the rs232 serial port to do anything?
« Last Edit: January 30, 2021, 09:01:25 am by canadaboy25 »
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21651
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Reading firmware out of a mask ROM microcontroller
« Reply #3 on: January 30, 2021, 03:40:35 am »
Ooh, nice.  Could be that it needs an enable pin, probably a nearby testpoint or connector; maybe more likely, it only responds to properly formed requests, in which case you need to guess baud rate first, and then message format if any?  Any hints you can find from nearby stuff (crystal? other onboard comm channels?) or service tools (find a manual? sometimes the actual service program itself is floating around?) would greatly speed that up.

Also, literal RS-232, or just async serial (logic level)?  Seems like the former would be unlikely for just a service port.  (It matters: logic level is inverted!)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #4 on: January 30, 2021, 04:26:32 am »
This TV is a Hitachi P42H4011.  The service manual for a Hitachi L37X01E plasma has the entire schematic for the main board in it.  It seems the same main board was used for both TVs.

It appears to be a proper RS232 port as it has a dedicated driver chip interfacing the port with the micro.

Also, I somehow managed to miss the fact there is a 3.5mm audio jack right beside the RS232 jack.  It is labelled "Service use only" on the back panel of the TV.  This obviously has something to do with it.  I will take a look in the schematic for the other TV and see if it has the same jack.
« Last Edit: January 30, 2021, 04:55:53 am by canadaboy25 »
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21651
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Reading firmware out of a mask ROM microcontroller
« Reply #5 on: January 30, 2021, 04:32:44 am »
Neat, most likely real 232 then.  Should be measuring something like -3 to -12V from TX at line-idle?

Hah, y'know, serial has been put into those jacks before.  I have... no idea if anyone's used that since the 70s or 80s, but, three wires is all you need...

I don't know anything about Hitachi TVs, but if you can find service info for any of them, it may be it's compatible.  Would be a shame to have a service tool specific to one model or line, eh?

(I have however done this with the Trinitron monitor I used to have; but in that case, Sony's service program is available on the internets. Easy.)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #6 on: January 30, 2021, 04:44:52 am »
After a bit more poking it seems the audio connector is likely not related to the RS232 port as there is an audio jack labelled IR_out on the schematic.

Yes, the TX line is steady at -10 volts and the RX line is steady at +10 volts.  There is no activity on the port looking at it with a scope.
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #7 on: January 30, 2021, 05:01:25 am »
After you mentioned the software being avaialable for some devices, I did a quick search and found a pdf detailing the communication protocol.

It seems the port is just used as a remote control pretty much.  Adjusting things like volume and picture settings.

In the pdf it shows 4 different options for cables to use for connecting to it.  I'm not sure which one is for what.
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8258
Re: Reading firmware out of a mask ROM microcontroller
« Reply #8 on: January 30, 2021, 05:31:08 am »
That MCU looks very similar to some of the early Motorola ones in basic architecture --- and if they are indeed taking inspiration from those, then one or more of the "do not use" modes are actually test modes that let you read out the memory contents.
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #9 on: January 30, 2021, 05:46:16 am »
That MCU looks very similar to some of the early Motorola ones in basic architecture --- and if they are indeed taking inspiration from those, then one or more of the "do not use" modes are actually test modes that let you read out the memory contents.

Are you referring to the modes that I referenced in the original post?
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8258
Re: Reading firmware out of a mask ROM microcontroller
« Reply #10 on: January 31, 2021, 02:37:23 am »
Yes. The HCS11/12 which was used in many automotive ECUs works that way.
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #11 on: February 01, 2021, 04:27:34 pm »
Looking around through the schematic I found another interesting interface.

There is a 3 wire synchronous I/O interface connected directly to the microcontroller.  It is labelled as flash/Jig and goes to an unused external connector which I would imagine is for factory use.  The CNVss pin for setting the processor mode is also connected to this interface along with a reset line.

This seems like a much better target for gaining access to the internal memory.

Any tips on where to start with this?
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline Kerlin

  • Regular Contributor
  • *
  • Posts: 181
  • Country: au
Re: Reading firmware out of a mask ROM microcontroller
« Reply #12 on: February 02, 2021, 10:27:02 pm »
I have a friend who says he was able to successfully read code out of a locked micro.
He told me that to allow or disallow access to the ROM the micro has to run its own internal instruction set micro code.
He found if the clock speed is run lower than the recommended speed the micro cannot run its micro code to block ROM access and he says he was able to get it.
To me this sounded a bit far fetched but he made good money cloning the device, so good he ended up in court, and was in the newspaper, so seems it did work.
« Last Edit: February 02, 2021, 10:28:55 pm by Kerlin »
Do you know what the thread is about and are Comprehending what has been said ?
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #13 on: February 03, 2021, 03:27:22 am »
The MCU belongs to M16C/60 series group.

Where did you get the usage mode from?

Anyway doesn't matter, the masked ROM can be read-out by putting it into special programming boot mode.  This makes the MCU run the special built-in boot loader program so you can send commands to it from a computer via RS232.

Cool, the flash jig seems to have all necessary pinouts, except perhaps for pin M1 (pin 36), but perhaps that doesn't matter, i.e. not needed for the masked ROM version.

I have successfully read out FLASH from a different MCU of the same series group (M16C/60):
M30624FGPGP

You will need a RS232 TTL converter, if you have Windows 10 I recommend getting a cheap ebay USB TTL one that I use, example:
https://www.ebay.co.uk/itm/310931472288

I attach picture of the standard Renesas programming boot mode wiring circuit.

Note, though the boot loader's function is protected by a password (Renesas calls this an ID), but usually most companies leave it as default, which is all 0x00 or all 0xFF.

You will also need my M16C/60 reader/flasher program (Windows console application) to communicate with it, because the official FlashStart program seems to be buggy.
I will try to upload it to github or somewhere.  Alternatively there is a German reader/flasher program that should work, but it cannot read some areas (user block A) on some MCUs (mine can read all areas):
https://m16c.mikrokopter.de/M16C-Flasher.19.0.html

Set the baud rate to:
9600, 8 bits data, no parity, 1 stop bit
« Last Edit: February 03, 2021, 03:38:14 am by tru »
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #14 on: February 03, 2021, 05:00:35 am »
The MCU belongs to M16C/60 series group.

Where did you get the usage mode from?

Anyway doesn't matter, the masked ROM can be read-out by putting it into special programming boot mode.  This makes the MCU run the special built-in boot loader program so you can send commands to it from a computer via RS232.

Cool, the flash jig seems to have all necessary pinouts, except perhaps for pin M1 (pin 36), but perhaps that doesn't matter, i.e. not needed for the masked ROM version.

I have successfully read out FLASH from a different MCU of the same series group (M16C/60):
M30624FGPGP

You will need a RS232 TTL converter, if you have Windows 10 I recommend getting a cheap ebay USB TTL one that I use, example:
https://www.ebay.co.uk/itm/310931472288

I attach picture of the standard Renesas programming boot mode wiring circuit.

Note, though the boot loader's function is protected by a password (Renesas calls this an ID), but usually most companies leave it as default, which is all 0x00 or all 0xFF.

You will also need my M16C/60 reader/flasher program (Windows console application) to communicate with it, because the official FlashStart program seems to be buggy.
I will try to upload it to github or somewhere.  Alternatively there is a German reader/flasher program that should work, but it cannot read some areas (user block A) on some MCUs (mine can read all areas):
https://m16c.mikrokopter.de/M16C-Flasher.19.0.html

Set the baud rate to:
9600, 8 bits data, no parity, 1 stop bit

Wow that is great news!  Thanks for all the info!

I got all of my information from the datasheet for the micro and the service manual for a Hitachi P50T01E.

According to the schematic, the M1 and CNVSS pins are pulled low through pulldown resistors. Pin 53 is already pulled high through a pullup resistor.  So I will just have to set the CNVSS pin high according to your schematic.

I have a usb to TTL converter already so I will try to rig it up and see what I can do with the German reader.

It would be awesome if I could get a link to yours so I could read all of the data.

Thanks again.
« Last Edit: February 03, 2021, 05:05:42 am by canadaboy25 »
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #15 on: February 03, 2021, 02:40:30 pm »
Wow that is great news!  Thanks for all the info!

I got all of my information from the datasheet for the micro and the service manual for a Hitachi P50T01E.

According to the schematic, the M1 and CNVSS pins are pulled low through pulldown resistors. Pin 53 is already pulled high through a pullup resistor.  So I will just have to set the CNVSS pin high according to your schematic.

I have a usb to TTL converter already so I will try to rig it up and see what I can do with the German reader.

It would be awesome if I could get a link to yours so I could read all of the data.

Thanks again.
Hmm, according to the official Renesas datasheet this MCU doesn't have the user block A, so the German program is all you need.  The M306H5MC datasheet can be downloaded here:
https://media.digikey.com/pdf/Data%20Sheets/Renesas/M306H5.pdf

The usage notes I think only applies when running in normal mode, it doesn't apply to the special programming bootloader mode.

Caution: don't press the Erase or Prog (program), even though your chip is masked ROM I think those functions can damage the data.

If you look at the memory map shown in the datasheet, the M306H5MC contains only 128K byte ROM:
so use read address range: 0x0E0000 to 0x0FFFFF

My application is here:
https://github.com/truhy/m16c-flasher

Try issuing the version command - this is not password protected so it must return an ASCII string if the circuit is wired up correctly and the bootloader wasn't erased (I doubt anyone would go to extreme by erasing the bootloader).

If the default passwords (all 0x00 or 0xFF) doesn't unlock the read command then there is actually a hack to determine the password:
https://hackaday.io/project/723-reverse-engineering-toshiba-r100-bios
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #16 on: February 04, 2021, 03:38:54 am »
Well I am unable to get the microcontroller to respond at all.

I wired up some mod wires to the header and connected everything up.  I was not getting any response and the German software kept failing to connect.  I took a look at the reset line with my scope and whenever I pulled CNVSS high, the reset line would continually pulse.  Looking at the schematic, I found there is a separate watchdog timer chip that can also reset the microcontroller.  The watchdog chip has an inhibit pin that is exposed on the service header so I added a wire to that too.  If I pull the inhibit pin high to disable the watchdog, I no longer get any pulsing on the reset line.

Even doing that I still get no activity on the TX line of the microcontroller.  I can see the data on the RX line of the micro, but it never responds to any messages.  Not sure what else to do at this point.  I know all my connections are good as I can see the signals at the traces on the board.
« Last Edit: September 17, 2021, 03:57:10 pm by canadaboy25 »
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8258
Re: Reading firmware out of a mask ROM microcontroller
« Reply #17 on: February 04, 2021, 04:28:44 am »
I have a friend who says he was able to successfully read code out of a locked micro.
He told me that to allow or disallow access to the ROM the micro has to run its own internal instruction set micro code.
He found if the clock speed is run lower than the recommended speed the micro cannot run its micro code to block ROM access and he says he was able to get it.
To me this sounded a bit far fetched but he made good money cloning the device, so good he ended up in court, and was in the newspaper, so seems it did work.
Yes it does - it's called clock/power glitching and usually works better on MCUs with a bootloader. https://hackaday.com/2020/07/04/the-cheap-way-to-glitch-an-stm8-microcontroller/

There are of course services for doing this in China (search for "MCU break") but they are likely too expensive for a one-off like this --- unless whatever you're trying to repair is also equally rare and expensive.
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #18 on: February 04, 2021, 06:25:57 am »
Well I am unable to get the microcontroller to respond at all.

I wired up some mod wired to the header and connected everything up.  I was not getting any response and the German software kept failing to connect.  I took a look at the reset line with my scope and whenever I pulled CNVSS high, the reset line would continually pulse.  Looking at the schematic, I found there is a separate watchdog timer chip that can also reset the microcontroller.  The watchdog chip has an inhibit pin that is exposed on the service header so I added a wire to that too.  If I pull the inhibit pin high to disable the watchdog, I no longer get any pulsing on the reset line.

Even doing that I still get no activity on the TX line of the microcontroller.  I can see the data on the RX line of the micro, but it never responds to any messages.  Not sure what else to do at this point.  I know all my connections are good as I can see the signals at the traces on the board.
The reset line should remain high because it is an active low reset.  The controller I read from also has a reset watchdog chip, Sipex SP705, I left the reset line untouched.

With my setup I have:
1. the ground of USB TTL connected to ground of the controller board, hmm there is no ground pin on the flash jig connector - perhaps this doesn't matter,
2. I have the CNVSS pin connected permanently to VCC (+5V, LM7805 on the PCB controller board) so it is pulled high before powering up the controller, hmm there is no VCC output pin on the flash jig connector
3. I have the SCLK connected to ground
« Last Edit: February 04, 2021, 06:48:56 am by tru »
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #19 on: February 04, 2021, 06:40:18 am »
The reset line should remain high because it is an active low reset.  The controller I read from also has a reset watchdog chip, Sipex SP705, I left the reset line untouched.

With my setup I have the ground of USB TTL connected to ground of the controller board, hmm there is no ground pin on the flash jig - perhaps this doesn't matter, also I have the CNVSS pin connected permanently to +5V so it is pulled high before powering up the controller.

Yes, I am leaving the reset line high and only grounding when I need to reset the micro.  The problem was that the watchdog chip monitors a clock signal that the micro outputs.  However, when I pulled the CNVSS pin high on the micro, it stopped outputting the watchdog clock which caused the watchdog to continually reset the microcontroller.  I have attached the page of the schematic showing the micro and watchdog circuit.  The watchdog is to the lower left of the micro.

My connections are as follows:
GND of my USB to TTL converter is connected to ground of the main board
Rx of my TTL converter is connected to the micro's Tx pin
Tx of my TTL converter is connected to the micro's Rx pin
CNVSS of the micro is pulled to +5V
The reset line is left high unless I pull it low momentarily to reset the chip
The watchdog inhibit line is held high to prevent it constantly resetting the micro.

Is there the possibility that there is no bootloader since it is a mask ROM chip?  Wouldn't the bootloader have to be a part of the ROM mask itself?
« Last Edit: February 04, 2021, 06:42:20 am by canadaboy25 »
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #20 on: February 04, 2021, 06:53:16 am »
The reset line should remain high because it is an active low reset.  The controller I read from also has a reset watchdog chip, Sipex SP705, I left the reset line untouched.

With my setup I have the ground of USB TTL connected to ground of the controller board, hmm there is no ground pin on the flash jig - perhaps this doesn't matter, also I have the CNVSS pin connected permanently to +5V so it is pulled high before powering up the controller.

Yes, I am leaving the reset line high and only grounding when I need to reset the micro.  The problem was that the watchdog chip monitors a clock signal that the micro outputs.  However, when I pulled the CNVSS pin high on the micro, it stopped outputting the watchdog clock which caused the watchdog to continually reset the microcontroller.  I have attached the page of the schematic showing the micro and watchdog circuit.  The watchdog is to the lower left of the micro.

My connections are as follows:
GND of my USB to TTL converter is connected to ground of the main board
Rx of my TTL converter is connected to the micro's Tx pin
Tx of my TTL converter is connected to the micro's Rx pin
CNVSS of the micro is pulled to +5V
The reset line is left high unless I pull it low momentarily to reset the chip
The watchdog inhibit line is held high to prevent it constantly resetting the micro.

Is there the possibility that there is no bootloader since it is a mask ROM chip?  Wouldn't the bootloader have to be a part of the ROM mask itself?
Looks good, and the S_SCLK on the flash/jig connector, did you connect that to ground?
The bootloader is flashed in by Renesas manufacturer, so no, it is pre-flashed and can only be erased by their special parallel programmer, but perhaps you have a good point, maybe masked ROM version doesn't have the built-in bootloader, not sure.
« Last Edit: February 04, 2021, 06:56:44 am by tru »
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #21 on: February 04, 2021, 07:00:14 am »
Looks good, and the S_SCLK on the flash/jig connector, did you connect that to ground?
The bootloader is flashed in by Renesas manufacturer, so no, it is pre-flashed and can only be erased by their special parallel programmer.

I have not done anything with the S_SCLK pin.  It is listed as an output in the schematic so I didn't want to pull it to ground if the micro was trying to pull it high.  However, the flash/jig header has a resistor between it and the MCU so I suppose I could pull it low without risking damage to the chip.

Would it matter what state the S_SCLK pin is at if it is listed as an output of the micro?  Or does the pin become an input when the micro is in bootloader mode?
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #22 on: February 04, 2021, 07:06:45 am »
Looks good, and the S_SCLK on the flash/jig connector, did you connect that to ground?
The bootloader is flashed in by Renesas manufacturer, so no, it is pre-flashed and can only be erased by their special parallel programmer.

I have not done anything with the S_SCLK pin.  It is listed as an output in the schematic so I didn't want to pull it to ground if the micro was trying to pull it high.  However, the flash/jig header has a resistor between it and the MCU so I suppose I could pull it low without risking damage to the chip.

Would it matter what state the S_SCLK pin is at if it is listed as an output of the micro?  Or does the pin become an input when the micro is in bootloader mode?
Is S_SCLK pin, pin 40 of the Renesas MCU?  If yes, it is a bidirectional pin, and yes on my MCU the SCLK must be pulled low for it to go into bootloader mode.

Just something else unrelated, I noticed the schematic shows M306H5FGFP - this is a flash memory version (256kB), I guess they've changed it on the actual PCB to a masked ROM version?
« Last Edit: February 04, 2021, 07:09:08 am by tru »
 

Offline canadaboy25Topic starter

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ca
Re: Reading firmware out of a mask ROM microcontroller
« Reply #23 on: February 04, 2021, 07:12:48 am »
Is S_SCLK pin, pin 40 of the Renesas MCU?  If yes, it is an input pin and yes on my MCU the SCLK must be pulled low for it to go into bootloader mode.

Just something else unrelated, I noticed the schematic shows M306H5FGFP - this is a flash memory version (256kB), I guess they've changed it on the actual PCB to a masked ROM version?

Oh very interesting.  Yes it is pin 40.  I will have to give it a try with pin 40 pulled low.  It is currently held high with a pullup resistor.

And yes, I noticed it has the wrong number on the micro as well.  They must've switched it to a mask ROM chip for production.  The actual chip on my board is in fact a mask ROM chip.
canadaboy25

- Sometimes the light at the end of a tunnel is an on-coming train
 

Online tru

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Reading firmware out of a mask ROM microcontroller
« Reply #24 on: February 04, 2021, 08:07:33 am »
Looks good, and the S_SCLK on the flash/jig connector, did you connect that to ground?
The bootloader is flashed in by Renesas manufacturer, so no, it is pre-flashed and can only be erased by their special parallel programmer.

I have not done anything with the S_SCLK pin.  It is listed as an output in the schematic so I didn't want to pull it to ground if the micro was trying to pull it high.  However, the flash/jig header has a resistor between it and the MCU so I suppose I could pull it low without risking damage to the chip.

Would it matter what state the S_SCLK pin is at if it is listed as an output of the micro?  Or does the pin become an input when the micro is in bootloader mode?
Just some thoughts on the S_CLK line because you mentioned it was listed as an output, the MCU can operate in 2 serial modes:
Mode 1: clock synchronous mode (not compatible with RS232), where there is a serial common clock with MCU and the programmer.  Depending on the registers the clock can be supplied by the MCU or an input clock.
Mode 2: clock asynchronous mode (UART RS232 TTL mode), serial common clock is not used, pull the SCLK1 low

If Hitachi is using mode 1 then that line will pulse, perhaps a good idea to check that.  If it pulses then there is a circuit on the PCB that is generating a serial clock, and as you said risky to pull it low.
« Last Edit: February 04, 2021, 08:15:14 am by tru »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf