This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trying to unbrick my APX120

I am using the instructions to unbrick my APX120 from this post, but I have run into issues below:

community.sophos.com/.../unbrick-apx120-break-bootdelay-0-recover-apx120

I can't seem to save the environment variables. When I run the "saveenv"

It says:

Saving Environment to NAND...
Erasing Nand...
Attempt to erase non page aligned data



This thread was automatically locked due to age.
Parents
  • I have exactly the same error

    (APX120) # saveenv
    Saving Environment to NAND...
    Erasing Nand...
    Attempt to erase non page aligned data
    

    This is the system initialization prompts (short U26 pin 8)

    U-Boot 2012.07 [Chaos Calmer unknown,unknown] (Nov 02 2018 - 08:13:09)
    
    smem ram ptable found: ver: 1 len: 3
    DRAM:  256 MiB
    @machid : 0x8010100
    NAND:  SF NAND unsupported id:0:0:0:0SF NAND unsupported id:0:0:0:0SF: Unsupported manufacturer 00
    spi_nand: Id could not be mapped
    SF NAND unsupported id:0:0:0:0SF NAND unsupported id:0:0:0:0SF: Unsupported manufacturer 00
    ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
    0 MiB
    MMC:
    *** Warning - readenv() failed, using default environment
    
    In:    serial
    Out:   serial
    Err:   serial
    machid: 8010100
    flash_type: 0
    Hit any key to stop autoboot:  0
    No such device
    nand - NAND sub-system
    
    
    (APX120) # printenv
    baudrate=115200
    bootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait
    bootcmd=bootipq
    bootdelay=2
    fdt_high=0x87000000
    flash_type=0
    fsbootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs
    ipaddr=192.168.1.11
    machid=8010100
    stderr=serial
    stdin=serial
    stdout=serial
    

    Bricked version of system initialization:

    Format: Log Type - Time(microsec) - Message - Optional Info
    Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
    S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.1-00120
    S - IMAGE_VARIANT_STRING=DAABANAZA
    S - OEM_IMAGE_VERSION_STRING=CRM
    S - Boot Config, 0x00000021
    S - Reset status Config, 0x00000010
    S - Core 0 Frequency, 0 MHz
    B -       261 - PBL, Start
    B -      1338 - bootable_media_detect_entry, Start
    B -      1678 - bootable_media_detect_success, Start
    B -      1692 - elf_loader_entry, Start
    B -      5068 - auth_hash_seg_entry, Start
    B -      7210 - auth_hash_seg_exit, Start
    B -    577089 - elf_segs_hash_verify_entry, Start
    B -    694418 - PBL, End
    B -    694442 - SBL1, Start
    B -    785453 - pm_device_init, Start
    D -         7 - pm_device_init, Delta
    B -    786898 - boot_flash_init, Start
    D -     52811 - boot_flash_init, Delta
    B -    843849 - boot_config_data_table_init, Start
    D -      3838 - boot_config_data_table_init, Delta - (419 Bytes)
    B -    851055 - clock_init, Start
    D -      7569 - clock_init, Delta
    B -    863098 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:1,Subtype:0
    B -    866511 - sbl1_ddr_set_params, Start
    B -    871608 - cpr_init, Start
    D -         2 - cpr_init, Delta
    B -    875989 - Pre_DDR_clock_init, Start
    D -         4 - Pre_DDR_clock_init, Delta
    D -     13174 - sbl1_ddr_set_params, Delta
    B -    889728 - pm_driver_init, Start
    D -         2 - pm_driver_init, Delta
    B -    959701 - sbl1_wait_for_ddr_training, Start
    D -        27 - sbl1_wait_for_ddr_training, Delta
    B -    975303 - Image Load, Start
    D -    152200 - QSEE Image Loaded, Delta - (297752 Bytes)
    B -   1127929 - Image Load, Start
    D -      1444 - SEC Image Loaded, Delta - (2048 Bytes)
    B -   1138329 - Image Load, Start
    D -    223905 - APPSBL Image Loaded, Delta - (458523 Bytes)
    B -   1362631 - QSEE Execution, Start
    D -        60 - QSEE Execution, Delta
    B -   1368853 - SBL1, End
    D -    676517 - SBL1, Delta
    S - Flash Throughput, 2010 KB/s  (758742 Bytes,  377357 us)
    S - DDR Frequency, 537 MHz
    
    
    U-Boot 2012.07 [Chaos Calmer unknown,unknown] (Nov 02 2018 - 08:13:09)
    
    smem ram ptable found: ver: 1 len: 3
    DRAM:  256 MiB
    @machid : 0x8010100
    NAND:  spi_nand: spi_nand_flash_probe SF NAND ID 0:ef:ab:21
    SF: Detected W25M02GV with page size 2 KiB, total 256 MiB
    SF: Detected MX25L1605D with page size 4 KiB, total 2 MiB
    ipq_spi: page_size: 0x100, sector_size: 0x1000, size: 0x200000
    258 MiB
    MMC:
    In:    serial
    Out:   serial
    Err:   serial
    machid: 8010100
    flash_type: 0
    Hit any key to stop autoboot:  0
    Creating 1 MTD partitions on "nand1":
    0x000000000000-0x000010000000 : "mtd=0"
    UBI: attaching mtd2 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    126976 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: VID header offset:          2048 (aligned 2048)
    UBI: data offset:                4096
    UBI error: ubi_read_volume_table: the layout volume was not found
    UBI error: ubi_init: cannot attach mtd2
    UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
    UBI init error 22
    Error, no UBI device/partition selected!
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    Creating 1 MTD partitions on "nand1":
    0x000000000000-0x000010000000 : "mtd=0"
    UBI: attaching mtd2 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    126976 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: VID header offset:          2048 (aligned 2048)
    UBI: data offset:                4096
    UBI error: ubi_read_volume_table: the layout volume was not found
    UBI error: ubi_init: cannot attach mtd2
    UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
    UBI init error 22
    Error, no UBI device/partition selected!
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    resetting ...

  • You need to retry to break autoboot.
    sometimes you need a few attemps.

    i prefer to read the nor with in circuit flash.

    if you can save the environment you must rebuild all env vars before loading the image file.

  • Hello Juergen,


    Can you post all the env variables that need to be set? I think I made some mistake there...

  • Hi,

    this is the fw_printenv from OpenWRT (root shell from APX120).

    setenv BASEMAC 7C:5A:1C:XX:XX:XX
    setenv SID P3200XXXXXXXXXX
    setenv baudrate 115200
    setenv bootargs mtdparts=spi0.1:0x8000000(rootfs) ubi.mtd=rootfs loglevel=1
    setenv bootcmd apx_check_reset_button\;run ubiboot\;run ubiboot_backup\;reset
    setenv bootdelay 10
    setenv ethact eth0
    setenv flash_type 0
    setenv ipaddr192.168.1.1
    setenv machid 8010100
    setenv mtddevname rootfs
    setenv mtddevnum 0
    setenv mtdids nand1=nand1
    setenv mtdparts mtdparts=nand1:0x10000000(rootfs)
    setenv partition nand1,0
    setenv radio0_select_5g 0
    setenv serverip 192.168.1.254
    setenv stderr serial
    setenv stdin serial
    setenv stdout serial
    setenv store_crashdump setenv crashdump_fix 1
    setenv ubiboot ubi part rootfs\;ubi read 0x84000000 image\;bootm 0x84000000#config@4
    setenv ubiboot_backup ubi part rootfs\;ubi read 0x84000000 image_backup\;setenv bootargs mtdparts spi0.1:0x8000000(rootfs) ubi.mtd rootfs OLD_IMAGE_BOOTED\;bootm 0x84000000#config@4
    setenv wipe_config ubi part rootfs\;ubi remove config\;ubi remove dyn_cfg\;ubi remove dyn_cfg_backup

  • Thanks!! Managed to fix one APX, now lets try with the second one!

  •  

    Hi,
    can you tell me where to get the APX.v11.0.019-2.uimage ? All pattern files I found only include the newest version 11.0.021...
    Thanks Jan

  • Hi Jan,

    You can find it on my OneDrive:

    1drv[dot]ms/u/s!Am04YvcSa_CLjLJKKMgj3n9zEQyrUQ?e=4SE2bh

  •   

    Hi,

    how did you manage to get keyboard inputs in putty ? are there any options needed ? I tried different settings in putty, but I am not able to input any text, after I successfully breaked autoboot.

    Thanks Jan

  • You need a good USB<->RS232 Adapter with 3.3V and need a few attempts to get in to uBoot CLI.

    I had some trouble with a USB Hub.
    The RS232 Adapter should be plugged into the backside of a PC or directly in your Notebook.

  • Hi,

    I am already in the uBoot CLI, but I cannot input any kind of text in Putty.

    I am using the red USB RS232 Adapter with 3,3V (the one, which work for other users), directly plugged into the notebook.
    Are there any Putty options, which I need to set ?

  • No (115200,8N1)

    Only use pin 2,3,4 (TX,GND,RX, may be switch TX/RX).

Reply Children