This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3505 internal ROM BOOT to Nand flash ECC

Other Parts Discussed in Thread: AM3505, FLASHTOOL

AM3505内部ROM BOOT对Nand的校验是HW 校验结果存放位置如下:
OOB:
        ff e0 e0 00 1b 1b 11 67
        98 3c ed ed 11 ff ff ff
        ff ff ff ff ff ff ff ff

这与nand flash坏块标志位置有冲突,请问这个怎么解决?

  • Jun:

    Could you provide an English translation?

    From what you provided I am guessing that you used U-Boot to program NAND Flash?

    A NAND x8 device uses offsets 1-12 in OOB whereas a NAND x16 devices uses

    offsets 2-13. 

    See this post for a customer who used Flash Tool and adapted it to work with a NAND x8 device.

    http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/416/p/101430/360276.aspx#360276

    Could you provide your SDRAM and NAND part #s?

    Flash Tool is available here:

    http://focus.ti.com/docs/toolsw/folders/print/flashtool.html

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

     

     

  • Michael T:

    Thanks for your reply!

    Nand:K9K8G08U0B  8bit wide

    SDRAM:MT47H64M16HR-25

    I want to use the u-boot update the x-load.

    The Flash tool(v1.5) is used to write x-load to nand flash HWECC.,but HWECC result and bad block mark bits are stored in the same position.
    So, I use U-boot erased nand flash when the storage location X-load  hints position is bad block.

    How to solve this conflict?

  • Jun:

    Iss may be the K9K8G08U0B NAND x8 device.  Need to know the mfgr id and device id and check that

    both x-loader and u-boot nand drivers support this device and can detect that it is a x8 NAND.

    Flash Tool should be able to handle if you change NAND parameters and change GPMC_CONFIG1_0 from 0x1800 to 0x800

    as was done in the post I referenced.

     

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • Jun:

    Also, if your NAND is ONFI-compliant you can check that option in Flash Tool and NAND geometry

    parameters will be read from NAND device.  Easier that way.

    Regards,

    Michael T

  • Hi All,

    I'm using FlashTool v1.6.0.0 to flash x-loader to a AM3505 with an ST NAND08GW3B2CN6 (x8).  I have modified GPMC_CONFIG1_0 to be 0x00000800 as described.  The FlashTool programming appears to be okay; however, the device won't boot x-loader from NAND.  That is, I don't observe the "Texas Instruments X-Loader ..." banner.  Any suggestions/guidance would be appreciated.  FlashTool ouput is provided below.  Also, I have HWECC, ONFI, 1 bit ECC selected in Flashtool.

    Thanks,
    ...doug

     


    ¯     -stdout
    ¯     -omap 3
    ¯     -no_force_package_alignment
    ¯     -com 4
    ¯     -t 60
    ¯     -p EVM_MDDR_MICRON_2G_EMIF
    ¯     -2
    ¯     chip_erase NAND1BITBOOT 0
    ¯ Leaving parameter file:temp_script.txt
    ¯ @temp_script.txt
    ¯ Looking for device (omap com4)
    ¯ Please turn off device, then turn it on again
    ¯ Awaiting ASIC id
    ¯ AsicId items 04
    ¯ AsicId id            01 05  01  34 30 07 58
    ¯ AsicId secure_mode    13 02  01  00
    ¯ AsicId public_id     12 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ AsicId root_key_hash    14 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ Searching 2nd for: EVM_MDDR_MICRON_2G_EMIF 343007 58 GP
    ¯ Loading second file Targets\2nd-Downloaders\dnld_startup_omap3_gp_2g.2nd
    ¯ Entering parameter file:omapflash2nd.txt at line: 15
    ¯     -pheriphalboot_reopen
    ¯ Reading board configuration file Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Reading definition file .\targets\definitions\definitions_omap3.txt
    ¯     -board_config Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Leaving parameter file:omapflash2nd.txt
    ¯ Sending size of second file (0x00006804 bytes)
    ¯ Transferring second file to target (0x6804 bytes)
    ¯ Closing boot connection
    ¯ Found device (omap com4)
    ¯ Waiting for 2nd
    ¯ Found 2nd
    ¯ Looking for a driver for 'NAND1BITBOOT'
    ¯ chip_driver NAND1BITBOOT Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 eccoffset 2
    ¯ Downloading driver
    ¯ Downloading 'Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin'

    ¯ Sending data (41008 bytes) :::::::::::::::..... [32764]
    ¯ Sending data (41008 bytes) :::::::::::::::::::: [41008]
    ¯ Sending data (41008 bytes) :::::::::::::::::::: [41008]
          Interface 'OMAPFLASH DRIVER v5'
          Driver 'NAND ONFI 16/8 BIT'
          Driver configuration: gpmc = 0x6E000000
          Driver configuration: cs = 0x00000000
          Driver configuration: address = 0x30000000
          Driver configuration: bberase = 0x00000000
          Driver configuration: eccoffset = 0x00000002
          NAND HW ECC
          NAND BCH Mode = 0
          NAND HWECC offset = 1, size = 12
          NAND ONFIv2 VENDOR 0x20 ST         
          NAND 8 BIT DEVICE 0xD3 NAND08GW3B2CN6     
          NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)
          NAND 2048 BYTES/PAGE (SPARE 64)
          NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)
          NAND 4096 BLOCKS/UNIT (536870912 BYTES/UNIT)
          NAND DRIVER ONLY SUPPORTS 1 OF 2 UNITS
          NAND 1 BIT(S) ECC REQUIRED
          NAND 1024 MB TOTAL SIZE
          NAND ONFI DRIVER INIT COMPLETE
    ¯ Downloading complete
    ¯ Elapsed time: 0:04.872 (10252 bytes/s)
    ¯ End loading driver
    ¯ Erasing
          Erasing to end of device starting at 0x30000000

          Erase progress .................... [131072]
          Erase progress .................... [10878976]
          Erase progress .................... [21626880]
          Erase progress :................... [32374784]
          Erase progress :................... [43122688]
          Erase progress ::.................. [53870592]
          Erase progress ::.................. [64618496]
          Erase progress ::.................. [75366400]
          Erase progress :::................. [86114304]
          Erase progress :::................. [96862208]
          Erase progress ::::................ [107610112]
          Erase progress ::::................ [118358016]
          Erase progress ::::................ [129105920]
          Erase progress :::::............... [139853824]
          Erase progress :::::............... [150601728]
          Erase progress ::::::.............. [161349632]
          Erase progress ::::::.............. [172097536]
          Erase progress ::::::.............. [182845440]
          Erase progress :::::::............. [193593344]
          Erase progress :::::::............. [204341248]
          Erase progress ::::::::............ [215089152]
          Erase progress ::::::::............ [225837056]
          Erase progress ::::::::............ [236584960]
          Erase progress :::::::::........... [247332864]
          NAND BAD BLOCK AT ADDRESS 0x0ED00000
          NAND drv_dnld_erase: SKIPPING BAD BLOCK AT 0x0ED00000

          Erase progress :::::::::........... [258080768]
          Erase progress ::::::::::.......... [268828672]
          Erase progress ::::::::::.......... [279576576]
          Erase progress ::::::::::.......... [290324480]
          Erase progress :::::::::::......... [301072384]
          Erase progress :::::::::::......... [311820288]
          Erase progress ::::::::::::........ [322568192]
          Erase progress ::::::::::::........ [333316096]
          Erase progress ::::::::::::........ [344064000]
          Erase progress :::::::::::::....... [354811904]
          Erase progress :::::::::::::....... [365559808]
          Erase progress ::::::::::::::...... [376307712]
          Erase progress ::::::::::::::...... [387055616]
          Erase progress ::::::::::::::...... [397803520]
          Erase progress :::::::::::::::..... [408551424]
          Erase progress :::::::::::::::..... [419299328]
          Erase progress ::::::::::::::::.... [430047232]
          Erase progress ::::::::::::::::.... [440795136]
          Erase progress ::::::::::::::::.... [451543040]
          Erase progress :::::::::::::::::... [462290944]
          Erase progress :::::::::::::::::... [473038848]
          Erase progress ::::::::::::::::::.. [483786752]
          Erase progress ::::::::::::::::::.. [494534656]
          Erase progress ::::::::::::::::::.. [505282560]
          Erase progress :::::::::::::::::::. [516030464]
          Erase progress :::::::::::::::::::. [526778368]
          Erase progress :::::::::::::::::::: [536870912]
          NAND ERASED 536739840 BYTES FROM ADDRESS 0x30000000 (1 BAD BLOCKS)
    ¯ Elapsed time: 0:00.000

    Console program success, exit code: 0





    ¯     -stdout
    ¯     -omap 3
    ¯     -no_force_package_alignment
    ¯     -com 4
    ¯     -t 60
    ¯     -p EVM_MDDR_MICRON_2G_EMIF
    ¯     -2
    ¯     chip_download NAND1BITBOOT E:\current\u\src-git\build.d\0001-0001\images\x-load.bin.ift
    ¯ Leaving parameter file:temp_script.txt
    ¯ @temp_script.txt
    ¯ Looking for device (omap com4)
    ¯ Please turn off device, then turn it on again
    ¯ Awaiting ASIC id
    ¯ AsicId items 04
    ¯ AsicId id            01 05  01  34 30 07 58
    ¯ AsicId secure_mode    13 02  01  00
    ¯ AsicId public_id     12 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ AsicId root_key_hash    14 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ Searching 2nd for: EVM_MDDR_MICRON_2G_EMIF 343007 58 GP
    ¯ Loading second file Targets\2nd-Downloaders\dnld_startup_omap3_gp_2g.2nd
    ¯ Entering parameter file:omapflash2nd.txt at line: 15
    ¯     -pheriphalboot_reopen
    ¯ Reading board configuration file Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Reading definition file .\targets\definitions\definitions_omap3.txt
    ¯     -board_config Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Leaving parameter file:omapflash2nd.txt
    ¯ Sending size of second file (0x00006804 bytes)
    ¯ Transferring second file to target (0x6804 bytes)
    ¯ Closing boot connection
    ¯ Found device (omap com4)
    ¯ Waiting for 2nd
    ¯ Found 2nd
    ¯ Looking for a driver for 'NAND1BITBOOT'
    ¯ chip_driver NAND1BITBOOT Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 eccoffset 2
    ¯ Downloading driver
    ¯ Downloading 'Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin'

    ¯ Sending data (41008 bytes) :::::::::::::::..... [32764]
    ¯ Sending data (41008 bytes) :::::::::::::::::::: [41008]
    ¯ Sending data (41008 bytes) :::::::::::::::::::: [41008]
          Interface 'OMAPFLASH DRIVER v5'
          Driver 'NAND ONFI 16/8 BIT'
          Driver configuration: gpmc = 0x6E000000
          Driver configuration: cs = 0x00000000
          Driver configuration: address = 0x30000000
          Driver configuration: bberase = 0x00000000
          Driver configuration: eccoffset = 0x00000002
          NAND HW ECC
          NAND BCH Mode = 0
          NAND HWECC offset = 1, size = 12
          NAND ONFIv2 VENDOR 0x20 ST         
          NAND 8 BIT DEVICE 0xD3 NAND08GW3B2CN6     
          NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)
          NAND 2048 BYTES/PAGE (SPARE 64)
          NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)
          NAND 4096 BLOCKS/UNIT (536870912 BYTES/UNIT)
          NAND DRIVER ONLY SUPPORTS 1 OF 2 UNITS
          NAND 1 BIT(S) ECC REQUIRED
          NAND 1024 MB TOTAL SIZE
          NAND ONFI DRIVER INIT COMPLETE
    ¯ Downloading complete
    ¯ Elapsed time: 0:04.306 (10252 bytes/s)
    ¯ End loading driver
    ¯ Downloading
    ¯ Downloading 'E:\current\u\src-git\build.d\0001-0001\images\x-load.bin.ift'

    ¯ Sending data (16640 bytes) :::::::::::::::::::: [16640]
    ¯ Sending data (16640 bytes) :::::::::::::::::::: [16640]
    ¯ Downloading complete
    ¯ Elapsed time: 0:01.683 (16640 bytes/s)
    ¯ Elapsed time: 0:00.000

    Console program success, exit code: 0

  • Doug:

    Looks like you made the required changes.  Your device is ONFI compliant so Flash Tool was able to read NAND params from device.

    It wrote x-loader placing the ECC parity data at offset 2 in spare area.   It should have worked.   Are you sure that the x-loader code itself

    does not need to be modified to support your NAND device?

    Regards,

    Michael T

  • Hi Michael,

    I don't think so; but, I'm not 100% sure either.  I look in to this.  However, I thought the boot ROM copied x-loader to RAM and executed it from there.  Is this not correct?  If the boot ROM copies x-loader to RAM, I'll look to see if there is a problem with RAM.  If the boot ROM executes x-loader from flash, then x-loader may need to be modified for the flash part.

    In Flashtool, if I select 'Download and Execute' of x-loader, should I be able to see the x-loader banner in the Flashtool output area when it is executed?  Since 'Download and Execute' downloads to RAM, I was wondering if this would be an easy way to validate that RAM is working properly?  Flashtool output with 'Download and Execute' is provided below.

    Thanks,
    ...doug


    ¯     -stdout
    ¯     -omap 3
    ¯     -no_force_package_alignment
    ¯     -com 4
    ¯     -t 60
    ¯     -p EVM_MDDR_MICRON_2G_EMIF
    ¯     -2
    ¯     chip_download SDRAM E:\current\u\src-git\build.d\0001-0001\images\x-load.bin.ift
    ¯     command branch SDRAM 0x8000
    ¯ Leaving parameter file:temp_script.txt
    ¯ @temp_script.txt
    ¯ Looking for device (omap com4)
    ¯ Please turn off device, then turn it on again
    ¯ Awaiting ASIC id
    ¯ AsicId items 04
    ¯ AsicId id            01 05  01  34 30 07 58
    ¯ AsicId secure_mode    13 02  01  00
    ¯ AsicId public_id     12 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ AsicId root_key_hash    14 15  01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ¯ Searching 2nd for: EVM_MDDR_MICRON_2G_EMIF 343007 58 GP
    ¯ Loading second file Targets\2nd-Downloaders\dnld_startup_omap3_gp_2g.2nd
    ¯ Entering parameter file:omapflash2nd.txt at line: 15
    ¯     -pheriphalboot_reopen
    ¯ Reading board configuration file Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Reading definition file .\targets\definitions\definitions_omap3.txt
    ¯     -board_config Targets\Configurations\configuration_am35xxevm_micron_2g.txt
    ¯ Leaving parameter file:omapflash2nd.txt
    ¯ Sending size of second file (0x00006804 bytes)
    ¯ Transferring second file to target (0x6804 bytes)
    ¯ Closing boot connection
    ¯ Found device (omap com4)
    ¯ Waiting for 2nd
    ¯ Found 2nd
    ¯ Looking for a driver for 'SDRAM'
    ¯ No driver required for 'SDRAM'
    ¯ Downloading
    ¯ Downloading 'E:\current\u\src-git\build.d\0001-0001\images\x-load.bin.ift'

    ¯ Sending data (16640 bytes) :::::::::::::::::::: [16640]
    ¯ Sending data (16640 bytes) :::::::::::::::::::: [16640]
    ¯ Downloading complete
    ¯ Elapsed time: 0:01.632 (16640 bytes/s)
    ¯ branch SDRAM 0x8000
    ¯ Elapsed time: 0:00.000

    Console program success, exit code: 0

  • Doug:

    Download and Execute is not really very useful because it requires that the code to be executed be Thumb mode code, which is not the case

    for x-loader.   X-loader gets copied from NAND to On Chip SRAM and executes there.    X-loader copies u-boot from NAND to SDRAM and jumps to it.

    Looks like the initial copy of x-loader from NAND to internal SRAM is not working.  What do you change SYSBOOT pins to after using Flash Tool?

    Regards,

    Michael T

     

  • Hi Michael,

    x-loader does need modifying.  I found that NAND_16BIT is defined.  I commented out the define to compile-in the 8-bit code.  After doing this, I still observe the same behaviour.

    SYSBOOT[7..0] after using Flash Tool is: 00001111.  If I'm reading the manual correctly, this configures memory boot and NAND, USB, UART, MMC1.

    Thanks for your assistance,
    ...doug

  • Hi Michael,

    I apologise, I gave you the incorrect SYSBOOT information.  The correct strapping is:

    SYSBOOT[8..0] 001001111

    Regards.
    ...doug

  • Doug:

    Since SYS_BOOT6 == 1, you have an external osc for sys_xtalin.  What is the frequency of this osc?

    Regards,

    Michael T

  • Hi Michael,

    We are using a 26MHz +-10ppm osc.

    Thanks,
    ...doug

  • Hi Michael,

    Reading the boot ROM Trace data from internal SRAM I get:
    0x4020FFB0: 0x0000081B
    0x4020FFB4: 0x001E0004
    0x4020FFBC: 0x0007387F
    0x4020FFC0: 0x001E0044
    Hopefully, I have the emulator and CCS setup correctly for reading internal SRAM.  If I do, this information looks correct; but I’m not 100% sure.

    Thanks,
    ...doug