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.

MCU-PLUS-SDK-AM243X: MCU-PLUS-SDK-AM243X: AM64x boot RTOS application from eMMC or QSPI

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH

Hi,

I want to store an application persistently. I can save my application in eMMC or OSPI when I use the AM64x Evaluation Module. 

Now I want to save my application on costamer board. There we use a QSPI  (MX25U51245GXDI00  from Macronix). When I follow the instruction for save application in QSPI or eMMC it doesn't work (https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/08_02_00_31/exports/docs/api_guide_am64x/TOOLS_FLASH.html)

This error message is displayed:

  

I think the problem is that the sbl uart unflash writes data to the OSPI flash whether the application is supposed to write to QSPI or eMMC. Writing to the OSPI flash doesn't work because we are using the QSPI flash.

I also tried to save the application to SD card but you can only save the application up to 380 kBytes and my application is bigger.

Can you help me to save my application persistently?

Best regards

Michael Bernhardt

  • Hi Michael Bernhardt,

    I think the problem is that the sbl uart unflash writes data to the OSPI flash whether the application is supposed to write to QSPI or eMMC. Writing to the OSPI flash doesn't work because we are using the QSPI flash.

    This is not the correct understanding. The OSPI is the driver provided OOB by TI for AM243x-EVM which is for different vendor.

    You can choose to use the MX25U51245GXDI00  from Macronix device with AM243x device as well.

    You need to implement the custom flash driver for this part. TI has a very interactive tool which can help you achieve the same. It is delivered as a part of sysconfig file of latest MCU_PLUS_SDK releases. 

    Here is the link to the documentation of the same - https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_05_00_24/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html

    After you have successfully integrated the support, and also tested the same with flash diagnostics test. You can choose to use UART_UNIFLASH to flash the same on the device.

    Unfortunately, MCU_PLUS_SDK does not support eMMC as an boot option (in SBL). Although the limitations with SD will still be valid for eMMC due to same physical layer and hardware.

    Best Regards,
    Aakash

  • Hi Aakash,

    thanks for your antwer. I can read the Information from the flash with the ospi_flash_diagnose and copy the information in to a jason file, But when I load the file in to the sysconfig the CCS gives me an error. 

    "java.io.IOException: Cannot run program "copy" (in directory "C:\Projekte\TQMaX4XxL\Software\TQMaX4XxL_WS\adc_singleshot_am64x-evm_r5fss0-0_freertos_ti-arm-clang\Debug"): CreateProcess error=2, The system cannot find the file"

    WaCan you help me?

    Tthanks for your help.

    Best regards 

    Michael Bernhardt

  • Hi ,

    We have an open issue for the same in the 08.05 release of MCU_PLUS_SDK. It is already tracked internally. We are working on a workaround, let me come back to you on this by EOD.

    In the meanwhile you can enter the values from the *.json file manually. That will still work.

    Best Regards,
    Aakash

  • HI Aakash,

    to check if I can read write into the flash I used the OSPI Flash IO example. But the driver isn't working. I got the Error message 

    or the driver can't initialized.

    What can I do?

    Best Regards,

    Michael

  • Hi ,

    The driver seems to be initialized but seems like the some extra parameters failed to work. Which mode are you trying at the moment ? The flash supports the following -

    1-1-2
    1-4-4
    1-1-4

    Can you check the following section on this page - https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_05_00_24/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html#autotoc_md360

    It has some Miscellaneous Debugging Tips and Tricks that will be very helpful.

    Best Regards,
    Aakash

  • Hi Aakash,

    I have tried 1-1-1 and 1-1-2,  both don't work. Your link shows the AM234x MCU, but I'm using AM64x MCU. Is there a difference between the two MCUs that doesn't work?

    Best Regards,

    Michael

  • Hi ,

    Did you try the OSPI Flash Diagnostics ?

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_05_00_24/exports/docs/api_guide_am243x/EXAMPLES_DRIVERS_OSPI_FLASH_DIAG.html

    This runs on 1-1-1 mode. Can you confirm if this works for you or not ?

    Best Regards,
    Aakash

  • Hi Aakash,

    yes, I used the OSPI Flash Diagnostics to find out the flash settings. 

    This is the output:

    [MAIN_Cortex_R5_0_0] [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0xC2
    [OSPI Flash Diagnostic Test] Flash Device ID : 0x253A
    [OSPI Flash Diagnostic Test] Executing Flash Erase on first block...
    [OSPI Flash Diagnostic Test] Done !!!
    [OSPI Flash Diagnostic Test] Performing Write-Read Test...
    [OSPI Flash Diagnostic Test] Write-Read Test Passed!
    [QSPI Flash Diagnostic Test] SFDP Information :
    ================================================
    SFDP
    ================================================
    SFDP Major Revision : 0x1
    SFDP Minor Revision : 0x6
    Number of Parameter Headers in this Table : 3

    Types of Additional Parameter Tables in this flash
    ---------------------------------------------------
    Unsupported Parameter Table type!!! - 0xFFC2
    4 BYTE ADDRESSING MODE INSTRUCTIONS TABLE

    JSON Data for the flash :

    {

    "flashSize": 67108864,
    "flashPageSize": 256,
    "flashManfId": "0xC2",
    "flashDeviceId": "0x253A",
    "flashBlockSize": 65536,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 0,
    "enableType": "0",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p112": {
    "isDtr": false,
    "cmdRd": "0x3C",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 8,
    "enableType": "0",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p114": {
    "isDtr": false,
    "cmdRd": "0x6C",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 8,
    "enableType": "2",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p118": {
    "isDtr": false,
    "cmdRd": "0x7C",
    "cmdWr": "0x84",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 0,
    "enableType": "255",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p444s": {
    "isDtr": false,
    "cmdRd": "0xEB",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 2,
    "dummyClksCmd": 0,
    "dummyClksRd": 4,
    "enableType": "2",
    "enableSeq": "0x04",
    "dummyCfg": {
    "isAddrReg": false,
    "cmdRegRd":"0x00",
    "cmdRegWr":"0x00",
    "cfgReg":"0x00000000",
    "shift":0,
    "mask":"0x00",
    "bitP":0
    },
    "protoCfg": {
    "isAddrReg": false,
    "cmdRegRd": "0x00",
    "cmdRegWr": "0x00",
    "cfgReg": "0x00000000",
    "shift": 0,
    "mask": "0x00",
    "bitP": 0
    },
    "strDtrCfg": {
    "isAddrReg": false,
    "cmdRegRd": "0x00",
    "cmdRegWr": "0x00",
    "cfgReg": "0x00000000",
    "shift": 0,
    "mask": "0x00",
    "bitP": 0
    }
    },
    "p444d": {
    "isDtr": false,
    "cmdRd": "0xEB",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 2,
    "dummyClksCmd": 0,
    "dummyClksRd": 4,
    "enableType": "2",
    "enableSeq": "0x04",
    "dummyCfg": {
    "isAddrReg": false,
    "cmdRegRd":"0x00",
    "cmdRegWr":"0x00",
    "cfgReg":"0x00000000",
    "shift":0,
    "mask":"0x00",
    "bitP":0
    },
    "protoCfg": {
    "isAddrReg": false,
    "cmdRegRd": "0x00",
    "cmdRegWr": "0x00",
    "cfgReg": "0x00000000",
    "shift": 0,
    "mask": "0x00",
    "bitP": 0
    },
    "strDtrCfg": {
    "isAddrReg": false,
    "cmdRegRd": "0x00",
    "cmdRegWr": "0x00",
    "cfgReg": "0x00000000",
    "shift": 0,
    "mask": "0x00",
    "bitP": 0
    }
    },
    "p888s": null,
    "p888d": null,
    "pCustom": {
    "fxn": null
    }
    },
    "addrByteSupport": "1",
    "fourByteAddrEnSeq": "0x85",
    "cmdExtType": "NONE",
    "resetType": "0x10",
    "deviceBusyType": "1",
    "cmdWren": "0x06",
    "cmdRdsr": "0x05",
    "srWip": 0,
    "srWel": 1,
    "cmdChipErase": "0xC7",
    "rdIdSettings": {
    "cmd": "0x9F",
    "numBytes": 5,
    "dummy4": 0,
    "dummy8": 0
    },
    "xspiWipRdCmd": "0x00",
    "xspiWipReg": "0x00000000",
    "xspiWipBit": 0,
    "flashDeviceBusyTimeout": 256000000,
    "flashPageProgTimeout": 256
    }

    All tests have passed!!

    Best Regards,

    Michael

  • Hi Michael,

    The problem here is the SFDP information in the flash.

    The SDK supports the following JEDEC standard -

    where as the JEDEC standard supported in the flash is not the same.

    Also this diagnostics has failed because I see the data in 118 mode however the flash does not support more than x4.

    Best Regards,
    Aakash

  • Hi Aakash,

    yes we use a quad SPI flash. But why I geting wrong data from the OSPI Flash Diagnostics? The tool doesn't run when I set the OSPI driver to 4 data lines. What can I do?

    The flash support the SFDP table JESD216B.

    Best Regards,

    Michael

  • Hi Michael,

    Unfortunately, the only option is to fill the details in the syscfg manually. I would also go through the data sheet and try to fill the *json file based on the data in the datasheet. Let me come back to you with this by 26th Jan 2023.

    Best Regards,
    Aakash

  • Hi ,

    Can you try this /cfs-file/__key/communityserver-discussions-components-files/908/MX25U51245GXDI00.json file.

    In this the commands are sent via 3B addressing. If this works, then we can update this for 4B addressing as well.

    Do let me know if this works for you or not ?

    Best Regards,
    Aakash

  • Hi Aakash,

    I tried the configuration (importing the JSON file doesn't work). But the same error comes up. 

    Am I doing something wrong?

    Best Regards,

    Michael

  • Hi Michael,

    Give me a day to review these settings. Apologies because importing *.json file crashes for you repeatedly.

    Best Regards,
    Aakash

  • Hi Aakash,

    I heard about an error. Is it possible that this is our problem?

    Report:

    There is a possibility of certain units exhibiting a lock up failure during UART Uniflash or UART boot.

    • On failing devices, UART image load hangs in between flashing.
    • This is a result of an ISR lockup root caused to a software interaction with an erroneous set of the UART timeout interrupt documented in published errata i2310.
    • Current testing indicates that devices that are sensitive to this issue will consistently exhibit this failure and will not be able to successfully boot on retry.
    • It is not certain that devices that do not exhibit this failure will never exhibit this failure as there is a sensitivity to PVT.

    Best Regards,

    Michael

  • Hi ,

    To rule out this angle, my suggestion would be to use dev-boot mode and testing the Flash Diagonstics and Flash IO example. Make sure to use release mode of the example. We found some issue in the same in our current release with Debug builds.

    I suggest you to migrate to sbl_uart_uniflash only after you have a working flash code.

    Best Regards,
    Aakash

  • Hi,

    Can you share more information on these configurations ?

    This is how it is demonstrated in MCU_PLUS_SDK.

    How does this data look for your flash configuration ?

    Best Regards,
    Aakash

  • Hi Aakash,

    see the settings below 

    I also tried your posted settings. Both settings don't work for me.

    Best Regards,

    Michael

  • Hi ,

    1. Can you disable the Enable 4 Byte Addressing and try again ?

    2. If you intend to keep it enabled then it should look like this. My suggestion would be to try it with both of them -

    If this does not work with either of them then we might need to discuss this over a call.

    Also, you can move to 1-1-1 mode to confirm that D1 line is not the problem here.

    Best Regards,
    Aakash

  • Hi Aakash,

    Ok, with the settings below, the OSPI Flash IO example returns "All tests have passed!!" It seenm to work. 

    Protocol 1-1-1

    What is the next step, rebuild the sbl_uart_uniflash with these settings?

    Best Regards,

    Michael

  • Hi ,

    Glad to hear that 1-1-1 works for you. Can you try 1-1-2 and then 1-1-4 respectively ?

    If this works, then you can confirm that hardware is completely okay. Then you can switch to 4s-4s-4s and 4d-4d-4d respectively.

    After that you can port the same for SBL_OSPI/SBL_UART_UNIFLASH and all the flash related applications.

    Best Regards,
    Aakash

  • Hi

    sorry for the late reply, I had other things to do. For 1-1-2, 1-1-4 and 4-4-4s / 4-4-4d settings do not work. 

    I get the following error message:

    These are my settings:

    Best Regards,

    Michael

  • Hi ,

    Let's get on a call and debug this together (02/03/2023). Please send me an invite at a-kedia@ti.com.
    I will invite more experts on the same.

    Thanks and Regards,
    Aakash