logo elektroda
logo elektroda
X
logo elektroda

F133 SPI Flash ROM Boot, CH341A Read/Write, Factory Firmware Storage

User question

I have a question. When we boot, the software written to this ROM is around 16 MB. If the original program is still on it, where does it copy to? If I buy a CH431 flash ROM, will the program still be on it when I read the ROM? If we are reading from the ROM, how does the program we are installing write to the ROM? Where is the factory program installed? Can you help me?

Artificial Intelligence Response

Direct answer to the question

Yes. I can help, and the main idea is this:

  • The 16 MB firmware image usually stays in the external flash chip; it is not removed from it during boot.
  • During boot, the SoC first runs its tiny internal Boot ROM (BROM), then loads the next boot stage from the selected boot medium. On the F133, the boot medium can be SPI NOR flash, SPI NAND flash, eMMC, or SD card, and the chip also has 64 MB DDR2 available for later boot stages and software execution. (bbs.aw-ol.com)
  • If you use a CH341A programmer to read the flash chip, reading is non-destructive; you will get a dump of what is already stored there. If you buy a new flash memory chip, it is normally blank unless the seller explicitly pre-programmed it. The CH341A itself is only the programmer, not the memory chip. (flashrom.org)
  • Writing to flash works because the code doing the update is typically running from RAM, from a dedicated bootloader region, or from a ROM-based recovery mode such as the F133’s FEL mechanism. The F133 documentation explicitly says the BROM includes FEL for writing external data to local nonvolatile memory. (bbs.aw-ol.com)
  • The “factory program” is normally stored in the board’s external boot flash or other selected boot medium, not in the tiny immutable Boot ROM inside the SoC. The internal BROM is only the first-stage loader/recovery logic. (bbs.aw-ol.com)

Detailed problem analysis

Your question mixes three different memories, so the first important step is to separate them clearly:

Memory What it is Volatile? Typical role
BROM / Boot ROM Very small ROM inside the SoC No First code executed after power-on
SPI NOR flash External nonvolatile storage chip, often 8/16/32 MB No Stores bootloader, kernel, rootfs, app
RAM / DDR Working memory Yes Where code executes fast and where data lives while system is running

On the F133, Allwinner documents an on-chip BROM and support for booting from SPI NOR, SPI NAND, eMMC, or SD. The F133 product brief also shows 64 MB DDR2 in the package. (bbs.aw-ol.com)

What really happens at boot

A practical boot flow is usually:

  1. Power on
  2. CPU starts executing from internal BROM
  3. BROM looks for a valid boot source
  4. BROM loads a small next-stage boot image from flash
  5. That boot stage initializes clocks and RAM
  6. Larger software components are loaded into RAM and execution continues there

That means the external 16 MB flash is primarily storage, while RAM is the workspace for execution. However, one correction is important: you should not assume the system always copies the entire 16 MB image into RAM in one shot. Often only the needed boot stages, kernel, and selected data are loaded; some content may remain stored in flash and be read later as needed. The key point is that the original firmware image remains on flash unless something erases or overwrites it. This is consistent with the F133 boot model and with standard flash-based embedded boot design. (bbs.aw-ol.com)

A useful mental model is:

Internal BROM -> finds boot medium
External SPI flash -> stores firmware permanently
RAM/DDR -> temporary execution space after boot starts

So when you ask, “If the original program is still on it, where does it copy to?”, the answer is:

  • Small early boot code: typically into internal SRAM / tightly coupled RAM areas first
  • Main firmware / OS / application: typically into DDR RAM
  • Original master copy: still on the external flash chip unless reprogrammed

This is why power can be removed and the device still boots again later: the permanent image is in the flash, not in RAM. (bbs.aw-ol.com)

If you read the ROM with a CH341A, what happens?

I assume you meant CH341A, not CH431. Flashrom’s official documentation lists ch341a_spi as a supported programmer for SPI flash ROMs. Its manual states that:

  • -r reads flash contents into a file,
  • -w writes a file into flash,
  • writing automatically performs erase/write operations,
  • and verification reads the chip back and compares it with the intended image. (flashrom.org)

So if the board’s flash currently contains the factory firmware, and you connect a CH341A and perform a read, you should obtain that firmware image as a binary dump. A read operation does not inherently erase the chip. In normal engineering practice, reading is used specifically to make a backup before any modification. (flashrom.org)

There are two different purchase cases:

  1. You buy a CH341A programmer

    • It contains no copy of your board’s firmware.
    • It is just the USB-to-SPI programming tool. (flashrom.org)
  2. You buy a new replacement flash chip

    • It will normally be blank unless sold as “pre-programmed.”
    • Your original firmware exists only on the original chip until you copy it out and write it to the new one.
    • Therefore, always back up the old chip first. (flashrom.org)

How can software write to flash if the system boots from flash?

This is the part that confuses many people, but it is straightforward once memory roles are separated.

There are several valid mechanisms:

A. Bootloader / updater running from RAM
A bootloader can load itself or its flash-writing routine into RAM, then erase and program the external flash. Microchip’s official documentation on self-programming explains the same general principle: a bootloader section can perform flash updates, and when execution is from RAM, the CPU can continue while flash programming proceeds. (ww1.microchip.com)

B. ROM recovery mode
The F133 BROM includes a FEL module, and Allwinner’s documentation says FEL is responsible for writing external data to local NVM. That means the chip has a built-in recovery/download path independent of the normal application firmware. (bbs.aw-ol.com)

C. External programmer
A CH341A writes the flash directly over SPI while you treat the flash chip as a raw memory device. Flashrom’s manual describes the write flow as erase → write → verify. (flashrom.org)

So the short answer is: the device is not simultaneously depending on the same flash bytes for instruction fetch while those exact bytes are being erased/programmed. The update logic is normally executing from another place: RAM, ROM, or another protected region. (bbs.aw-ol.com)

Where is the factory program installed?

For an F133 system configured to boot from SPI NOR flash, the factory firmware is typically stored in that external SPI NOR flash device. The on-chip BROM is far too small and is intended only for bootstrapping and recovery; Allwinner explicitly describes it as the primary loader that selects media and handles FEL/medium boot. (bbs.aw-ol.com)

Therefore:

  • Internal BROM = permanent silicon boot code from Allwinner
  • External flash = the factory bootloader, kernel, filesystem, app, settings, etc.
  • RAM = temporary runtime location after boot begins (bbs.aw-ol.com)

If you replace the external flash with a blank chip, the SoC still has its internal BROM, but it may fail normal boot because there is no valid external boot image. Depending on board configuration, it may then require recovery/programming via FEL or another supported boot source. (bbs.aw-ol.com)


Current information and trends

From current official flashrom documentation, CH341A remains a supported SPI flash programmer, and flashrom continues to document direct commands for read and write using ch341a_spi. The same documentation also still warns about the electrical issues of some common CH341A board variants, especially voltage handling on older black boards. (flashrom.org)

For the F133 specifically, currently available Allwinner documentation still describes:

  • integrated Boot ROM (BROM),
  • support for SPI NOR/NAND, eMMC, and SD boot media,
  • and 64 MB DDR2 in package. (bbs.aw-ol.com)

A current engineering trend in embedded products is to keep:

  • a tiny immutable ROM loader in silicon,
  • a field-updatable external flash image,
  • and a recovery path such as USB download / FEL / ISP for factory and service use. The F133 architecture matches this model closely. (bbs.aw-ol.com)

Supporting explanations and details

Think of the system like this:

  • Flash = warehouse
  • RAM = workbench
  • BROM = supervisor who unlocks the warehouse and tells workers what to bring to the bench

The warehouse keeps the original goods. The workbench is where actual work happens. If you update the warehouse inventory, you do it while the workers are already operating from the bench or from a separate supervisor-controlled procedure. (bbs.aw-ol.com)

Another useful point: in casual conversation many people say “ROM,” but on modern boards this is often actually flash memory, which is electrically rewritable. That is why you can both read it and reprogram it. Flashrom’s own naming reflects this historical convention by using the phrase “flash ROM.” (flashrom.org)


Ethical and legal aspects

  • If the firmware belongs to a commercial product, make sure you have the right to dump, modify, or redistribute it. Firmware may contain licensed code, calibration data, keys, MAC addresses, or other device-unique information. (flashrom.org)
  • If secure boot, signature checks, or protected regions are used, writing arbitrary images may render the device unbootable even if the electrical write succeeds. That is a system-design and security-policy issue, not just a flash-memory issue. (bbs.aw-ol.com)
  • Electrically, the biggest safety issue is voltage. Flashrom’s CH341A documentation notes that some black CH341A boards can expose the target device to nearly 5 V, which can damage many 3.3 V flash chips. (flashrom.org)

Practical guidelines

If your goal is to inspect or preserve the factory firmware, do this:

  1. Identify the actual flash chip part number on the board.
  2. Use a 3.3 V-safe programmer setup. Flashrom’s CH341A documentation explicitly discusses board voltage selection and the known problem with some black CH341A boards. (flashrom.org)
  3. Read the chip at least twice and compare the dumps.
  4. Save the original dump in multiple places before attempting any write.
  5. Only then try erase/write/verify. Flashrom’s official write flow includes automatic erase and read-back verification. (flashrom.org)

Typical commands with flashrom and a CH341A are documented as:

flashrom -p ch341a_spi -r backup.bin
flashrom -p ch341a_spi -w newimage.bin

Those example commands are shown in flashrom’s CH341A documentation. (flashrom.org)

Potential challenges:

  • wrong voltage,
  • wrong chip orientation,
  • poor SOIC-clip contact,
  • board circuitry interfering with in-circuit reads,
  • locked or protected sectors,
  • writing an image that does not match your exact board revision. (flashrom.org)

Possible disclaimers or additional notes

  • I am answering this in the context of a typical F133 + external SPI flash boot design. If your board actually boots from eMMC, SD, or SPI NAND instead of SPI NOR, the same logic applies but the physical storage location changes. Allwinner’s BROM supports several media types. (bbs.aw-ol.com)
  • Not every system copies the whole firmware image into RAM. Some designs load only boot-critical pieces first. So do not interpret “boot from flash” as “the whole 16 MB is copied immediately.” (bbs.aw-ol.com)
  • “Factory program” can include device-specific data such as serial numbers, MAC addresses, calibration constants, or region data. A full-chip clone may copy those too, which is sometimes desirable and sometimes not. (flashrom.org)

Suggestions for further research

If you want to go deeper, the next useful technical topics are:

  • F133 boot header / BOOT0 format
  • F133 FEL recovery mode
  • exact SPI NOR part number on your board
  • flash chip write protection bits/status registers
  • whether your root filesystem is loaded into RAM or mounted from flash
  • how to verify dumps with checksum / hash before rewriting (bbs.aw-ol.com)

A very practical next step is to identify your flash device marking, for example a Winbond or Macronix part number, because that determines voltage, capacity, erase size, and protection behavior. (flashrom.org)


Brief summary

In simple terms:

  • The chip starts from internal Boot ROM.
  • The real factory firmware is usually on external flash.
  • Boot code then loads what it needs into RAM and runs from there.
  • A CH341A can read that flash without deleting it.
  • A new flash chip is usually blank unless pre-programmed.
  • Writing works because the updater runs from RAM, ROM recovery mode, or an external programmer path, not from the exact flash region being erased at that moment. (bbs.aw-ol.com)

If you want, I can next give you a very practical step-by-step procedure for:

  1. identifying the flash chip,
  2. wiring a CH341A safely, and
  3. making a verified backup before you write anything.

User question

Now, if I get this CH431B programmer and use it, will I be able to flash my device's factory firmware, or will the factory firmware be erased during the update?

Artificial Intelligence Response

Direct answer to the question

Yes — you can use that programmer to flash the factory firmware back onto the device, but only if you first have a valid copy of that factory firmware image. Simply reading the flash chip does not erase anything. However, when you perform a write/program operation, the programmer software will typically erase the target chip or the sectors being updated, then write the new image. In other words: read = non-destructive; write = destructive to the old contents being replaced. (flashrom.org)

So the safe workflow is:

  1. identify the chip,
  2. read and save a backup of the existing contents,
  3. verify the backup is good,
  4. only then write the replacement firmware.
    That backup is what lets you restore the original factory state later. (flashrom.org)

Detailed problem analysis

A USB SPI programmer in the CH341A/B family is just an external interface to the flash memory. Flashrom explicitly supports CH341A/B programmers, and its documented operations are probe, read, write, verify, and erase. (flashrom.org)

The critical distinction is between these operations:

Operation What it does Does it erase existing firmware?
Detect / probe Identifies the flash chip No
Read (-r) Copies chip contents to a file No
Verify (-v) Compares chip contents to a file No
Erase (-E) Blanks the flash Yes
Write (-w) Programs a file to flash; flashrom documents that it first automatically erases, then writes, then verifies Yes

This behavior is described directly in the flashrom manual: -r reads the ROM contents into a file, while -w writes a file and first automatically erases the chip before programming it. (flashrom.org)

So, if your question is:

  • “Can I preserve the factory firmware?”
    Yes — by doing a read backup first. That operation is non-destructive. (flashrom.org)

  • “Will the factory firmware remain on the chip after I flash a new image?”
    Generally no — the old contents in the area being written will be erased/overwritten during the write process. (flashrom.org)

  • “Can I later restore the original factory firmware?”
    Yes — if you saved a good dump of the original contents, you can write that dump back later. (docs.mrchromebox.tech)

A further nuance: not every update has to overwrite the entire chip. Flashrom supports layout- or region-based operations, such as writing only selected regions in some firmware layouts. In those cases, only the addressed region is modified, not necessarily the full device image. (flashrom.org)


Current information and trends

Current flashrom documentation still lists CH341A/B among supported programmers, which is relevant because many low-cost USB SPI tools sold today are based on that family. (flashrom.org)

A current practical concern is voltage compatibility. Flashrom’s own CH341A/B documentation warns that some common black CH341A boards are wired in a way that can put nearly 5 V on signals going to EEPROM/flash devices, which is unsafe for many 3.3 V parts. The same documentation notes that many flash chips are normally 3.3 V, and some devices require 1.8 V adapters. (flashrom.org)

Industry practice has also shifted toward preserving device-specific data when reflashing. Recent unbricking/manual-flashing guides emphasize that a backup is critical, and that items such as VPD/HWID or other board-specific data may need to be preserved when replacing firmware images. (docs.mrchromebox.tech)


Supporting explanations and details

Think of the flash chip as a rewritable storage medium:

  • Read is like copying a file off a USB drive.
  • Write is like re-imaging the USB drive with a new system image.
  • The programmer does not “spontaneously” erase the device just because it is connected. Erasure happens only when you command an erase/write operation. (flashrom.org)

Also note that many tools do not simply “paste over” old data. Flash memory technology normally requires erase-before-write behavior. Flashrom explicitly documents that its write flow includes reading the old contents, erasing, writing, and then verifying. (flashrom.org)

If your goal is to restore the exact factory state, the best source is usually:

  1. your own backup from that exact device, or
  2. an official full image from the manufacturer, if one exists and is appropriate.

Your own dump is preferable because it may contain device-unique information not present in a generic downloaded image. Recent firmware guides explicitly call out preservation of device-specific data for successful recovery. (docs.mrchromebox.tech)


Ethical and legal aspects

From a legal and support standpoint, reflashing firmware can void warranties or conflict with vendor support procedures, depending on the product. From a privacy/security standpoint, a full flash dump may contain device-specific identifiers or configuration data, so treat backups as sensitive files and do not share them casually. The preservation of unique board/device data is a real technical concern in current firmware workflows. (docs.mrchromebox.tech)

Safety-wise, the main hardware risk is using the wrong voltage or wrong pin orientation. Flashrom’s CH341A/B documentation explicitly warns about problematic board variants and instructs users to check the flash chip datasheet for the correct voltage. (flashrom.org)


Practical guidelines

Recommended procedure:

  1. Confirm the flash chip part number.
    Check whether it is a 3.3 V or 1.8 V device before connecting power from the programmer. (flashrom.org)

  2. Use the programmer only to detect/read first.
    With flashrom, probing and reading are separate from erase/write operations. (flashrom.org)

  3. Make a backup before any write.
    This is strongly recommended in both flashrom documentation and current external-flashing guides. (flashrom.org)

  4. Prefer two reads and compare them.
    This is good engineering practice to catch poor clip contact or in-circuit bus interference.

  5. Only then perform the write.
    Expect the old contents in the programmed region to be erased and replaced. (flashrom.org)

  6. Verify after writing.
    Flashrom normally verifies after a write unless verification is disabled. (flashrom.org)


Possible disclaimers or additional notes

  • If by “factory firmware” you mean a file downloaded from the manufacturer, make sure it is actually a full flash image and not just a partial update package.
  • If your device stores serial numbers, calibration constants, MAC addresses, or other unique data inside the flash, a generic image may boot but still leave the device improperly configured. Current firmware guides explicitly warn about preserving such data. (docs.mrchromebox.tech)
  • If your programmer listing says CH431B, but the tool/software ecosystem identifies it as a CH341A/B-type SPI programmer, the operational logic above still applies. Flashrom’s current documentation explicitly covers CH341A/B devices. (flashrom.org)

Suggestions for further research

Before you proceed, the most useful next checks are:

  • the exact flash chip marking,
  • the device’s required flash voltage,
  • whether the replacement image is a full dump or only a partial update,
  • whether your device has board-specific data that must be retained.

If you want, I can help you determine that from:

  • the flash chip part number,
  • a photo of the board/chip,
  • or the firmware file size and filename.

Brief summary

Short version:

  • Reading the chip will not erase the factory firmware. (flashrom.org)
  • Writing a new image will erase/overwrite the old firmware in the programmed area. (flashrom.org)
  • Therefore, back up the chip first if you want the option to restore the factory firmware later. (flashrom.org)

If you send me the exact programmer listing and the flash chip model, I can tell you whether you need a 1.8 V adapter, what software to use, and the safest exact backup/flash sequence.

Ask additional question

Wait...(2min)
Disclaimer: The responses provided by artificial intelligence (language model) may be inaccurate and misleading. Elektroda is not responsible for the accuracy, reliability, or completeness of the presented information. All responses should be verified by the user.