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.

AM2732: correct way to setting QSPI Boot in custom board with S25FL128SAGNFI000

Part Number: AM2732
Other Parts Discussed in Thread: TMDS273EVM, UNIFLASH, SYSCONFIG,

Tool/software:

Hello.

I'm trying QSPI Boot in custom board which has flash memory: S25FL128SAGNFI000.

I have another board: TMDS273EVM.

Custom board fails QSPI boot.

- I would like to get advise for I makes it correct.
- Are there configuration against RBL / ROM Bootloader on CCS theia or hardware pins ?
    - If there are it, I want how to do that .

My researched details are written below.

---

## Researched
### Summary
- Custom board cannot boot SBL.
- TMDS273EVM can boot SBL right.
- QSPICLK/CS waveforms by RBL / ROM bootloader is shown.
    - Its not equal between Custom board's and TMDS273EVM's
    - TMDS273EVM's is twice and 4byte CS low.
    - Custom board's is only once and 1byte CS low.

### Custom board
- Import projects from example of SDK
    - sbl_qspi_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - sbl_null_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - sbl_jtag_uniflash_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - empty_am273x-evm_system_freertos
- Apply flash setting from S25FL128SA.json from ti\mcu_plus_sdk_am273x_09_02_00_60\source\board\.meta\flash
- Building: OK.

#### sbl_jtag_uniflash
- Writing: OK.
    - wrote sbl_qspi in 0x00000 and empty in 0xA0000 via sbl_jtag_uniflash.
- Dumping: OK
    - make another project.
    - read binary from flash and dump it to file.
    - read binary is equal to wrote binary.

#### booting sbl_qspi
- booting sbl_qspi: NG
    - debug UART log is not shown.

#### booting sbl_null
- booting sbl_qspi: NG
    - debug UART log is not shown.

#### test app: empty via debugger
- debug UART log is shown.
    - UART port is available.

### TMDS273EVM

- Import projects from example of SDK
    - sbl_qspi_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - sbl_null_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - sbl_jtag_uniflash_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - empty_am273x-evm_system_freertos
- Building: OK.

#### sbl_qspi
- Writing: OK.
    - wrote sbl_qspi in 0x00000 and empty in 0xA0000 via sbl_jtag_uniflash.

- booting sbl_qspi: OK
    - debug UART log is shown.
- booting app: OK
    - debug UART log is shown.

#### sbl_null
- Writing: OK.
    - wrote sbl_null in 0x00000 and empty in 0xA0000 via sbl_jtag_uniflash.
- booting sbl_null: OK
    - debug UART log is shown.

### Waveforms when nReset is pos-edge.
I took waveforms images with way of below.
- clear flash both board.
- both boards is made QSPI boot mode by SOP switch.
- probes attached.
- push button for nReset pin.

My Oscilloscope is low-grade.

50MHz waveforms may be shown with distorted.

#### QSPICLK/CS

##### Timing
###### Custom board

- small chunk
- only once


###### TMDS273EVM

- large chunk
- twice


##### hole of it
###### Custom board

###### TMDS273EVM


##### zoom(1)
###### Custom board

###### TMDS273EVM


##### zoom(2)
###### Custom board

###### TMDS273EVM

---

Best regards.

  • Tanaka-san,

    RBL is non-modifiable. Can you please share the schematic portion with the flash connections? 

    Best,

    Daniel

  • Hi, Daniel.

    ① The schematic portion with the flash connections are shown below.



    ② Meaning of "RBL is non-modifiable".

    Is it correct that "RBL is non-modifiable" means below?
    - RBL has no software config like SysConfig.
    - RBL has no register config before booting.
    - RBL has hardware config is only boot mode changing by SOP pins.

    Best regards.

  • Tanaka-san,

    The schematic looks ok.

    Earlier you mentioned that you modified ti\mcu_plus_sdk_am273x_09_02_00_60\source\board\.meta\flash, correct? This is not necessary and actually unadvised. To add support for a different flash device to the project it is necessary to modify SysConfig for the project instead. The instructions on how to do this are located in AM273x MCU+ SDK: Adding Support For a Custom Flash Device. You need to make sure to modify the sysconfig for the sbl project and rebuild it, as well as the flash writer project. You can verify functionality after adding the support by running a simple read/write example from the SDK.

    Just for confirmation, which sdk version are you using? 


    Is it correct that "RBL is non-modifiable" means below?
    - RBL has no software config like SysConfig.
    - RBL has no register config before booting.
    - RBL has hardware config is only boot mode changing by SOP pins.

    As for your previous points, RBL is non user-modifiable, so no way exists on configuring anything about it. You are correct in your assumptions, but RBL does not need modifications to work with another flash but instead it's the user's due diligence to make sure the flash is compatible with our device as per the points highlighted in the following document: AM273x QSPI Flash Selection Guide.

    I've gone over the points for you particular flash and it looks like there are no reason that would prevent this flash from working with AM273x, but please go over the document as well to reach the conclusion

    Best,

    Daniel

  • Hi, Daniel.

    Thanks for reply.

    > Earlier you mentioned that you modified ti\mcu_plus_sdk_am273x_09_02_00_60\source\board\.meta\flash, correct?

    It is not correct.
    I used S25FL128SA.json in the directory.
    It was applied by "LOAD FROM JSON" on SysConfig in CCS.

    > You can verify functionality after adding the support by running a simple read/write example from the SDK.
    It has been success after "LOAD FROM JSON".
    Also, Writing and reading has been success via flash API in SDK for SBL (0x00000) and app (0xA0000).

    > Just for confirmation, which sdk version are you using?
    Dependencies are below.
    - MCU+ SDK for AM273X 9.2.0.60
    - SysConfig 1.20.0





    > As for your previous points, RBL is non user-modifiable, so no way exists on configuring anything about it. You are correct in your assumptions, but RBL does not need modifications to work with another flash but instead it's the user's due diligence to make sure the flash is compatible with our device as per the points highlighted in the following document: AM273x QSPI Flash Selection Guide.

    I had been checked "AM273x QSPI Flash Selection Guide".
    S25FL128SAGNFI000 is checked that satisfies "ROM Boot Requirements" from its datasheet.
    And its family is mentioned in "Compatible Flash Devices".






    > I've gone over the points for you particular flash and it looks like there are no reason that would prevent this flash from working with AM273x, but please go over the document as well to reach the conclusion

    Sorry. I should mention my context.
    I get confirmed that there is no config for RBL.
    The reason is below.
    - Some other devices seems like that has setting for RBL.
    - I read "TRM 5.2 Boot Process" and "Application Note
    Flash Variants Supported by the mmWave Sensor" which mentioned that.
         - There were no description of RBL setting.
    - I checked registers by TRM. There was no register for RBL.
    - I wanted dual check these.

    Best regards.

  • Tanaka-san

    It is not correct.
    I used S25FL128SA.json in the directory.
    It was applied by "LOAD FROM JSON" on SysConfig in CCS.

    I understand now, but in which project are you doing this? this should be done for both Uniflash and SBL projects that you want to use

    In the past I have also noticed problem with the LOAD FROM JSON option so please verify as well that all expected values from the datasheet are present in your sysconfig file

    Also keep in mind this is a 16MB flash, all read operations past 0x80_0000 will fail as per errata i2364 AM273x Sitara Microcontrollers Silicon Revision 1.0 (Rev. B)

    Best,

    Daniel 

  • Hi, Daniel.

    Thanks for reply.

    > I understand now, but in which project are you doing this? this should be done for both Uniflash and SBL projects that you want to use

    These are 3 json applied projects.
    - Import projects from example of SDK
        - sbl_qspi_am273x-evm_r5fss0-0_nortos_ti-arm-clang
        - sbl_jtag_uniflash_am273x-evm_r5fss0-0_nortos_ti-arm-clang
    - a flash dumper project

    The flash dumper is simple dumper to check correct wrote.
    Next is main script in flash dumper.

    fp_bl = fopen(filename_bl, "wb");
    fp_fw = fopen(filename_fw, "wb");
    Flash_read(gFlashHandle[CONFIG_FLASH0], QSPI_FLASH_OFFSET_BL, gFileBuf.files.bootloader, FILE_SIZE_BL);
    Flash_read(gFlashHandle[CONFIG_FLASH0], QSPI_FLASH_OFFSET_FW, gFileBuf.files.fw, FILE_SIZE_FW);
    
    fwrite(gFileBuf.files.bootloader, FILE_SIZE_BL, 1, fp_bl);
    fwrite(gFileBuf.files.fw, FILE_SIZE_FW, 1, fp_fw);
    fclose(fp_bl);
    fclose(fp_fw);

    I checked that Its output equal to file which write via uniflash.



    > In the past I have also noticed problem with the LOAD FROM JSON option so please verify as well that all expected values from the datasheet are present in your sysconfig file

    I compared SysConfig setting and contents in S25FL128SA.json.
    It seems like that has been applied correct.

    I compared SysConfig setting and datasheet of S25FL128SAGNFI000.
    It seems like correct.
    - device / manufacture ID are correct.
    - There is Quad Enable in bit1 of 0x35 command.
    - Read / Write command are correct.


    > Also keep in mind this is a 16MB flash, all read operations past 0x80_0000 will fail as per errata i2364 AM273x Sitara Microcontrollers Silicon Revision 1.0 (Rev. B)

    I checked writing / reading over 0x80_0000 address.
    - write via jtag_uniflash.
    - read by below script.

    fp_bl = fopen("dump_bl_800000.bin", "wb");
    fp_fw = fopen("dump_fw_8a0000.bin", "wb");
    Flash_read(gFlashHandle[CONFIG_FLASH0], 0x800000, gFileBuf.files.bootloader, FILE_SIZE_BL);
    Flash_read(gFlashHandle[CONFIG_FLASH0], 0x8a0000, gFileBuf.files.fw, FILE_SIZE_FW);
    
    fwrite(gFileBuf.files.bootloader, FILE_SIZE_BL, 1, fp_bl);
    fwrite(gFileBuf.files.fw, FILE_SIZE_FW, 1, fp_fw);
    
    fclose(fp_bl);
    fclose(fp_fw);


    Read binary file is equal to wrote file.
    It may works correct even over 0x80_0000...

    Best regards.

  • Tanaka-san,

    could you please:

    1. provide the example.syscfg file that you are using in your projects

    2. try running the qspi_flash_diag example under C:\ti\mcu_plus_sdk_am273x_09_02_00_60\examples\drivers\qspi and provide a copy of the console log that you get 

    Best,

    Daniel

  • Hi, Daniel.

    Thanks for reply.

    1. provide the example.syscfg file that you are using in your projects

    This is .syscfg in each project of custom board.
    It was renamed to each project name.

    20250313-provide-sysconfig.zip

    2. try running the qspi_flash_diag example

    (2-a). qspi_flash_diag_test_compare_buffers() failed on state that just import and build.

    I checked that first byte is not correct by dumping rx/tx buffer.

    Tx:
    00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff
    Rx:
    ff 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff


     It was fixed to insert dummy read.

    (void) QSPI_norFlashWrite(qspiHandle, offset, gQspiTxBuf, APP_QSPI_DATA_SIZE);
    
    // for custom board, 1byte dummy read.
    (void) QSPI_norFlashRead(qspiHandle, offset, gQspiRxBuf, 1);
    
    (void) QSPI_norFlashRead(qspiHandle, offset, gQspiRxBuf, APP_QSPI_DATA_SIZE);
    status += qspi_flash_diag_test_compare_buffers();

    The result is below.
    S25FL128SAGNFI000 do not support SFDP.
    There are no 0x5A command and description of SFDP in its datasheet.

    [QSPI Flash Diagnostic Test] Starting ...
    [QSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x1
    [QSPI Flash Diagnostic Test] Flash Device ID       : 0x2018
    [QSPI Flash Diagnostic Test] Executing Flash Erase on first block...
    [QSPI Flash Diagnostic Test] Done !!!
    [QSPI Flash Diagnostic Test] Performing Write-Read Test...
    [QSPI Flash Diagnostic Test] Write-Read Test Passed!
    [QSPI Flash Diagnostic Test] Error in reading SFDP Table or SFDP not supported by Flash !!!
    All tests have passed!!


    Best regards.

  • Hi, Daniel.

    I checked all binary in SI/SO.
    Result is shown below.

    ## Custom board
    
    | SI     | SO     | CMD       |
    | ------ | ------ | --------- |
    | FF     | FF     |           |
    | FF     | FF     |           |
    | 55     | FF     |           |
    | 99     | FF     |           |
    | 05     | FF     |           |
    | 00     | 00     |           |
    | 9F     | FF     |           |
    | 00     | 01     |           |
    | 00     | 20     |           |
    | 00     | 28     |           |
    | 5A     | FF     | Read SFDP |
    | 000000 | FFFFFF |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 00     | FF     |           |
    | 05     | FF     |           |
    | 00     | 00     |           |
    
    ## TMDS273EVM
    
    | SI       | SO       | CMD                        |
    | -------- | -------- | -------------------------- |
    | 9F       | FF       |                            |
    | 00       | 88       |                            |
    | 00       | 40       |                            |
    | 00       | 17       |                            |
    | 5A       | FF       | Read SFDP                  |
    | 000000   | FFFFFF   | datasheet p40              |
    | 00       | FF       |                            |
    | 00       | 53       |                            |
    | 00       | 46       |                            |
    | 00       | 44       |                            |
    | 00       | 50       |                            |
    | 00       | 00       |                            |
    | 00       | 01       |                            |
    | 00       | 01       |                            |
    | 00       | FF       |                            |
    | 05       | FF       | Read Status Register 0     |
    | 00       | 00       | datasheet p11              |
    | 5A       | FF       | Read SFDP                  |
    | 000008   | FFFFFF   | datasheet p40              |
    | 00       | FF       |                            |
    | 00       | 00       |                            |
    | 00       | 00       |                            |
    | 00       | 01       |                            |
    | 00       | 09       |                            |
    | 00       | 30       |                            |
    | 00       | 00       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 05       | FF       | Read Status Register 0     |
    | 00       | 00       |                            |
    | 5A       | FF       | Read SFDP                  |
    | 000010   | FFFFFF   | datasheet p40              |
    | 00       | FF       |                            |
    | 00       | C8       |                            |
    | 00       | 00       |                            |
    | 00       | 01       |                            |
    | 00       | 03       |                            |
    | 00       | 60       |                            |
    | 00       | 00       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 05       | FF       | Read Status Register 0     |
    | 00       | 00       |                            |
    | 5A       | FF       | Read SFDP                  |
    | 000008   | FFFFFF   | datasheet p40              |
    | 00       | FF       |                            |
    | 00       | 00       |                            |
    | 00       | 00       |                            |
    | 00       | 01       |                            |
    | 00       | 09       |                            |
    | 00       | 30       |                            |
    | 00       | 00       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 05       | FF       |                            |
    | 00       | 00       |                            |
    | 5A       | FF       | Read SFDP                  |
    | 000030   | FFFFFF   | datasheet p40              |
    | 00       | FF       |                            |
    | 00       | E5       |                            |
    | 00       | 20       |                            |
    | 00       | F1       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | 03       |                            |
    | 00       | 44       |                            |
    | 00       | EB       |                            |
    | 00       | 08       |                            |
    | 00       | 6B       |                            |
    | 00       | 08       |                            |
    | 00       | 3B       |                            |
    | 00       | 42       |                            |
    | 00       | BB       |                            |
    | 00       | EE       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | FF       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 00       | FC       |                            |
    | 00       | 20       |                            |
    | 00       | 0F       |                            |
    | 00       | 52       |                            |
    | 00       | 10       |                            |
    | 00       | D8       |                            |
    | 00       | 00       |                            |
    | 00       | FF       |                            |
    | 05       | FF       | Read Status Register 0     |
    | 00       | 00       |                            |
    | 6B000000 | 00000000 | p20: Quad Output Fast Read |
    | FF       | FF       |                            |
    


    It seems like RBL needs SFDP support.

    ① I think that AM2732's RBL needs SFDP. It is correct?

    ② Where is there description of that in any documents?

    It feels that I missed description of requirements.

    I found one.
    But it seems not mention to AM2732.

    Found one is below.
    TRM p34 has link to application note.



    It links to "Application Note
    Flash Variants Supported by the mmWave Sensor".

    There is a description: "The commands used are as published by the SFDP response." in p4.

    Reasons I didn't use this document is below.
    ②-a. But this document seems not support AM2732.
    This is snip from p3.


    ②-b SOP4 is used to config XTAL in AM2732.
    And there is not SOP5 in AM2732.

    ②-c "AM273x QSPI Flash Selection Guide"  has
    "ROM Boot Requirements".
    SFDP is not mentioned in here.

    Best regards.

  • Hi Tanaka-san,

    It seems like RBL needs SFDP support.

    I will need a couple of days to confim this, please give me until monday so I can hear back from the expert.

    Best,

    Daniel

  • Hi, Daniel.

    Thanks for reply.

    I am awaiting the result.

    Best regards.

  • Tanaka-san,

    I got word back from more experts. It looks like for this device the SFDP is required as the RBL expects the flash to support it. I don't believe this is able to be modified so I'd suggest using a different flash device for your evaluation. I'll go ahead and file a ticket to update the flash compatibility document to reflect this issue. 

    Please do not hesitate to ask more questions if you need more help

    Best,

    Daniel

  • Hi, Daniel.

    Thanks for reply.

    I changed flash to GD25B64ESIGR which support SFDP.
    It works correct.

    As result of this thread, I understand that RBL/ROM Bootloader of AM2732 needs flash which support SFDP.

    I'm glad to contribute.

    I mind the problem of flash reading 0x80_0000.
    It was mentioned like below.

    >> Also keep in mind this is a 16MB flash, all read operations past 0x80_0000 will fail as per errata i2364 AM273x Sitara Microcontrollers Silicon Revision 1.0 (Rev. B)

    > I checked writing / reading over 0x80_0000 address.
    > - write via jtag_uniflash.
    > - read by below script.


    >

    fp_bl = fopen("dump_bl_800000.bin", "wb");
    fp_fw = fopen("dump_fw_8a0000.bin", "wb");
    Flash_read(gFlashHandle[CONFIG_FLASH0], 0x800000, gFileBuf.files.bootloader, FILE_SIZE_BL);
    Flash_read(gFlashHandle[CONFIG_FLASH0], 0x8a0000, gFileBuf.files.fw, FILE_SIZE_FW);
    
    fwrite(gFileBuf.files.bootloader, FILE_SIZE_BL, 1, fp_bl);
    fwrite(gFileBuf.files.fw, FILE_SIZE_FW, 1, fp_fw);
    
    fclose(fp_bl);
    fclose(fp_fw);

    > Read binary file is equal to wrote file.
    > It may works correct even over 0x80_0000...

    It looks like read correct over 0x80_0000.

    Did "all read operations past 0x80_0000 will fail" means other anything of
    "Flash_read(gFlashHandle[CONFIG_FLASH0], 0x8a0000, gFileBuf.files.fw, FILE_SIZE_FW);" ?

    Best regards.