Hello,
The failure to recover bricked LS1043A boards without encryption support (non-secure SoC) often stems from the inability of the JTAG debugger to initialize the QSPI flash/IFC controller when the RCW is entirely missing, even when
USE_SAFE_RCW is set to
True. Because non-secure SoCs may behave differently than secure ones regarding RCW loading, you may need to explicitly configure the initialization script to handle the blank state.
Here is a guide to testing modifications in your initialization script and verifying the RCW override.
1. Test Modifications in the Initialization Script
When the NOR is erased, the board cannot boot. The CodeWarrior USE_SAFE_RCW aims to supply a temporary RCW via JTAG, but it might not be configuring the memory interface correctly for your board.
- Set
BOOT_CHIP_SELECT to 2: In the initialization script (.py), set BOOT_CHIP_SELECT = 2. This tells the CodeWarrior script to use the hard-coded RCW (via RCW override) rather than expecting the board to read one from a flash bank.
- Set
QSPI_BOOT = 1 or 0: If you are using QSPI (common in modern custom boards), ensure QSPI_BOOT is set correctly. Note that some forum posts suggest that if QSPI is too fast, the connection fails. You may need to enable a "Half Speed" option in the QSPI initialization section of the script.
- Set
BOARD_REV_PD = True: This setting is sometimes required to ensure the correct memory controller parameters are used during the recovery process.
- DDR Initialization: Ensure you have deleted any DDR initialization code in your custom initialization script. The flash programmer must run using on-chip RAM (OCRAM) because the DDR is not initialized when the board is in a "broken" state.
- Validate JTAG Chain: Ensure the LS1043A is the first device in the JTAG chain. If an FPGA or CPLD is first, the RCW override (which communicates directly with the SoC) might fail.
2. How to Verify RCW Override is Working
To confirm that the USE_SAFE_RCW = True is actually working, you can try the following:
- Check the "Core not responding" error: If you still see "Failed to write memory at address..." or "Core not responding" after enabling
USE_SAFE_RCW, it means the RCW override failed.
- Verify using "Write Reset Configuration Word" task: In CodeWarrior, try executing the specific "Write Reset Configuration Word" debug task rather than the full Flash Programmer. If this task passes, it indicates the JTAG probe is successfully writing the override.
- Check
ccs::config_chain: Use ccs::config_chain{ ls1043a dap sap2} in the script to confirm the debugger is communicating with the SoC properly.
3. Alternative Recovery Approach
If USE_SAFE_RCW still fails, you can try to force the board into a hard-coded RCW mode via physical switches, which might provide a more stable JTAG connection for flashing:
- Configure the DIP switches on your board to boot from a "Hard-coded RCW" source (typically
cfg_rcw_src to 0 or another hard-coded value, check your schematic for cfg_rcw_src pins). This allows the board to boot without a valid flash image.
- Once in this mode, try connecting and flashing using the "RAM Boot" method (loading a small PBL into RAM and then flashing).
4. Special Case: QSPI Speed
If your board is using QSPI, the issue could be that the default speed configured by the script is too fast for a "cold" chip. Modifying QuadSPI_SMPR (0x1550108h) to enable "Half Speed serial flash clock" can resolve this issue.
# Within Target Initialization File (inside Init_QSPI() function)
# SMPR, enable "Half Speed serial flash clock"
CCSR_BE_M(0x1550108, 0x00000001)
Regards