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.

LP-AM261: AM261x LaunchPad: Changing OSPI from Octal to Single/Quad Mode

Part Number: LP-AM261
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH

Hello,

I am working with the following environment:

  • Device: AM261x LaunchPad
  • SDK: motor_control_sdk_am261x_10_02_00_07
  • IDE: CCS 12.8.1

My goal is to run the SBL on a custom board that uses a QSPI Flash device.
To achieve this, I am following the steps below:

1. Verify that the OSPI Flash can be accessed in Single (1S-1S-1S) or Quad (1S-1S-4S) mode on the LaunchPad.
2. Verify the same on the custom board.
3. Apply the working configuration to the SBL and run it on the custom board.

As the first step, I tested flash operation using the following example project:
  ospi_flash_dma_am261x-lp_r5fss0-0_nortos_ti-arm-clang

Questions
1. Does this example work only in Octal mode?

I changed the SysConfig OSPI Flash settings to Single (1S-1S-1S) mode.
However, when I run the example, I get the following error:

[Cortex_R5_0] ERROR: Flash_norOspiOpen:1316: Flash_norOspiOpen : PHY enabling failed!!! Continuing without PHY...
ERROR: Board_flashOpen:196: FLASH open failed for instance 0 !!!

I can avoid this error by disabling “Enable PHY mode” in the OSPI settings,
but then Flash read/write operations do not work.

The same behavior occurs in Quad mode (1S-1S-4S).

Could you advise how to properly run the example in Single or Quad mode?

2. Can “Enable PHY Mode” be disabled?

When I run the example in Octal mode with PHY mode disabled,
Flash operations do not work correctly.

For example:

  • Writing seems to succeed
  • But reading back the stored data shows different values

Is this issue related to why Single mode and Quad mode also fail?
Does the Flash device or OSPI controller require PHY mode even in Single/Quad operation?

Thank you for your support.
Best regards,

  • Hello,

    Thank you for reaching out with your detailed questions about OSPI flash configuration on the AM261x LaunchPad. Before we dive into troubleshooting the PHY mode and Single/Quad mode issues you're experiencing, I need to gather some essential information about your setup to provide you with accurate guidance.

    First, can you please confirm which specific flash part number you're using on your custom board? 

    Second, did you update your syscfg for the respective flash part and the mode configuration?

    Best regards,
    Mayank Shadwani

  • Hello Mayank,

    Thank you for your response.

    Here is the information you requested:

    1. Flash device part number

    • On the AM261x LaunchPad: MX25UW064 (the actual OSPI flash mounted on the board)
    • On my custom board: ISSI IS25LP128F

    If needed, I can provide the full datasheet or relevant timing parameters.

    2. SysConfig updates
    Yes, I updated the SysConfig settings to match the flash device and the desired mode (Single / Quad).
    Specifically:

    • Set the OSPI protocol to 1S-1S-1S (or 1S-1S-4S when testing Quad).
    • Disabled PHY mode when testing Single/Quad.
    • Adjusted device-specific parameters such as page size, block size, dummy cycles, JEDEC ID, etc., as applicable.

    If there are additional SysConfig fields that must be modified for Single/Quad operation on the AM261x, I would appreciate your guidance.

    Best regards,
    Akira Higuchi

  • Hello, 

    Can you use the example with 1s-1s-1s mode enabled in the protocols section and then in four byte addressing mode enable sequency keep it as 0x21

    Regards,

    Aswin

  • Hi,

    Thank you for the advice.
    As you suggested, after setting the 4-Byte Addressing Enable Sequence to 0x21, I was able to confirm that read and write operations work correctly in 1S-1S-1S mode.
    It looks like I can now proceed to the next verification step.

    Thanks again for your support.

    Best regards,
    Higuchi

  • Sure, for the next step we can run the ospi diagnostic example and use the output json file to populate the parameters. First we can try 1s-1s-1s mode and then move quad spi mode.

  • Hi,

    Thank you for the guidance.
    Using a custom board, I have already obtained the JSON file generated by the OSPI diagnostic example.
    If needed, I can attach the JSON file here for your reference.

    When running QSPI on the EVM, besides setting the 4-Byte Addressing Enable Sequence to 0x21, are there any other settings that need to be configured?

    Thanks again for your support.

  • Hi,

    Thank you for the guidance.
    Using a custom board, I have already obtained the JSON file generated by the OSPI diagnostic example.
    If needed, I can attach the JSON file here for your reference.

    When running QSPI on the EVM, besides setting the 4-Byte Addressing Enable Sequence to 0x21, are there any other settings that need to be configured?

    Thanks again for your support.

  • When running QSPI on the EVM, besides setting the 4-Byte Addressing Enable Sequence to 0x21, are there any other settings that need to be configured?

    May I know how QSPI protocol is running on the EVM, the EVM has a macronix flash which does not have QSPI support.

    When running on custom board, you would need to change the boot mode and then align the flash configurations by uploading the JSON file

    besides setting the 4-Byte Addressing Enable Sequence to 0x21

    This is done is 4 byte addressing is required or is supported by the flash. 

    Regards,

    Aswin

  • Hi Aswin,

    Thank you very much for the clarification.
    I understand that the EVM does not support QSPI due to the Macronix flash device.

    Just for verification, I tried applying the Single-mode settings we discussed to the SBL project on the EVM.
    However, the SBL did not run correctly after applying these changes.

    Could you please confirm whether the SBL supports Single mode operation in the first place?
    I would like to understand if the issue is due to my configuration or if SBL inherently does not support this mode.

    Thanks again for your support.

    Best regards,
    Higuchi

  • Hello,

    The SBL and Application are using the same ospi and flash driver. SBL can also work in 1s-1s-1s mode. There is no restrictons. The only thing that can be different is the flash confogurations in sysconfig. Can you please check the flash confogurations between the SBL and the working application side by side and check if those are same.

    Regards,

    Aswin

  • Hello Aswin,

    I compared the flash configurations between the SBL and the application, and they appear to be identical.

    While debugging, I found that when running the SBL in 1s-1s-1s mode, the following issue occurs:

    Inside the SBL, the function below is called:

    status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);


    Within this function, the magic number is checked here:

    status = config->fxns->imgReadFxn(&mHdrStr, sizeof(Bootloader_MetaHeaderStart), config->args);
    
    if (mHdrStr.magicStr != BOOTLOADER_META_HDR_MAGIC_STR)
    {
    status = SystemP_FAILURE;
    }


    The expected value of mHdrStr.magicStr is 0x5254534D, but the actual value being read is 0x54524D53, which results in a failure.

    This seems to indicate that the data read from flash is being shifted or interpreted incorrectly only in 1s-1s-1s mode.

    Do you have any suggestions on what might cause this behavior?

    Regards,
    Higuchi

  • Hello,

    Let me try this on my side.

    Regards,

    Aswin

  • Thank you, Aswin.
    Please let me know if I can provide any further details.
    I appreciate your support.

    Regards,
    Higuchi

  • Hello, 

    I was able to observe the issue. The ELF header is being read incorrectly during the image parsing procedure. Let me try to resolve and issue and get back to you as soon as possible.

    Regards,

    Aswin

  • Hello Aswin,

    The issue has been resolved.
    As a result, we are now able to boot the SBL in QSPI mode on our custom board and successfully launch the application.

    Thank you very much for your kind support and cooperation.

    Best regards,
    Higuchi

  • Hi,

    Glad to hear that. Closing the e2e.

    Regards,

    Aswin

  • Hello, 

    Why SBL is not working in 1s-1s-1s mode is because,

    The macronix flash which is on LP has a property that, when writing in 8D-8D-8D mode, it swaps the bytes and will write it. Basically the write does not happen the same way in 1s-1s-1s mode and 8d-8d-8d mode. So when we are flashing, the data is written in 8d-8d-8d mode and the SBL tries to read in 1s-1s-1s mode. So for SBL to work in 1s-1s-1s mode with the macronix flash which is on LP, the flasher used in uniflash also should be in 1s-1s-1s mode.

    Regards,

    Aswin

  • Hello, 

    Why SBL is not working in 1s-1s-1s mode is because,

    The macronix flash which is on LP has a property that, when writing in 8D-8D-8D mode, it swaps the bytes and will write it. Basically the write does not happen the same way in 1s-1s-1s mode and 8d-8d-8d mode. So when we are flashing, the data is written in 8d-8d-8d mode and the SBL tries to read in 1s-1s-1s mode. So for SBL to work in 1s-1s-1s mode with the macronix flash which is on LP, the flasher used in uniflash also should be in 1s-1s-1s mode.

    Regards,

    Aswin