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.

AM6442: UART_UNIFLASH FAIL: CUSTOM BOARD

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH

Hello all, 

picking up on the related post:

Now that I know that configuring the DDR to MSRAM works on the EVM and I am able to flash an application in the EVM I now switched to the custom board.

On the custom board I have following configurations: I have a quad-SPI nor-flash chip (MX25U51245G). Like in the last post I adapted the linker to use the MSRAM instead of the DDR, following this guide, so I removed the DDR-Ram from the SysConfig. I also set the MMCSD-device type to NO_DEVICE.

I also patched the `flash-ospi` src under `\source\board\flash\ospi` following this guideline:

```

- Copy the [QSPI patch](./templates/qspi_sdk_file/source) into the SDK installation path.
  - __NOTE__: Necessary for using qspi_nor_flash.
- Rebuild the library following these [instructions](software-dl.ti.com/.../MAKEFILE_BUILD_PAGE.html).
  - __Note__: Adjust the `imports.mak` file as necessary if your `CCS` version differs or if you've installed the
    in a different location. This file is located in the `<SDK installation path>`.
```

I configured on my custom board UART mode and tried pushing the GP image(because my custom board uses a chip with GP architecture). 

The programm seems to get stuck when trying to load sbl_null:

```

C:\ti\mcu_plus_sdk_am64x_08_06_00_45\tools\boot>python uart_uniflash.py -p COM16 --cfg sbl_prebuilt/am64x-evm/default_sbl_null_tq.cfg

Parsing config file ...
Parsing config file ... SUCCESS. Found 2 command(s) !!!

Executing command 1 of 2 ...
Found flash writer ... sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash_tq.tiimage
Sent flashwriter sbl_prebuilt/am64x-evm/sbl_uart_uniflash_tq.tiimage of size 314270 bytes in 29.39s.

Executing command 2 of 2 ...
Command arguments : --file=sbl_prebuilt/am64x-evm/sbl_null.release.tiimage --operation=flash --flash-offset=0x0
Sending sbl_prebuilt/am64x-evm/sbl_null.release.tiimage: 0%| | 0/271879 [00:00<?, ?bytes/s]

```

Does someone have maybe any idea of what is wrong?

I doublechecked the flash sysconfig to see if it is running. We already have an application(which I run through JTAG loading it into the MSRAM thorugh the load_dsmc.js script using CCS), which uses the same flash sysconfig and patch for the  `\source\board\flash\ospi\flash_ospi.c` file. There the QSPI Test seems to work. Both configs (for the sbl and for the app that I tested the qspi) are uploaded with this issue. The one called TQMa64XxL_ALV.sysconfig is the config for the application that was tested.

Btw the test script we use is also included.

Thanks for every hint or help!!!

Isaac L. L. Yuki

/*
 *  Copyright (C) 2021 Texas Instruments Incorporated
 *
 *  Copyright (c) 2022 TQ-Systems GmbH <license@tq-group.com>, D-82229 Seefeld, Germany.
 *  Author Michael Bernhardt
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <kernel/dpl/DebugP.h>
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"

#define APP_OSPI_FLASH_OFFSET_BASE  (0x200000U)

#define APP_OSPI_DATA_SIZE (2048)
uint8_t gOspiTxBuf[APP_OSPI_DATA_SIZE];
/* read buffer MUST be cache line aligned when using DMA, we aligned to 128B though 32B is enough */
uint8_t gOspiRxBuf[APP_OSPI_DATA_SIZE] __attribute__((aligned(128U)));

void ospi_flash_io_fill_buffers(void);
int32_t ospi_flash_io_compare_buffers(void);

#define OSPI_RD_DATA_CAPTURE_REG_ADD  (0x0FC40010)

int32_t ospi_flash_io_main(void *args)
{
    int32_t status = SystemP_SUCCESS;
    uint32_t offset;
    uint32_t sector, blk, page;
    Flash_Attrs *flashAttrs;

    /* Open Flash drivers with OSPI instance as input */
    if(gFlashHandle[CONFIG_FLASH0] == NULL)
    {
        Drivers_ospiOpen();
        status = Board_flashOpen();
    }

    /* DELAY_FD = 2 and BYASS_FLD = enable
     * The default DELAY_FD = 4 does not work with QSPI flash, so DELAY_FD = 2 must be used.
     * In addition, the "board.am64x.r5f.ti-arm-clang.debug.lib" must be rebuilt with the new "flash_nor_ospi.c" file.
     * Please see README.md*/
    *(uint32_t*) OSPI_RD_DATA_CAPTURE_REG_ADD = 0x05;

    flashAttrs = Flash_getAttrs(CONFIG_FLASH0);

    /* Fill buffers with known data,
     * find block number from offset,
     * erase block, write the data, read back from a specific offset
     * and finally compare the results.
     */

    offset = APP_OSPI_FLASH_OFFSET_BASE;
    ospi_flash_io_fill_buffers();
    Flash_offsetToBlkPage(gFlashHandle[CONFIG_FLASH0], offset, &blk, &page);
    status = Flash_eraseBlk(gFlashHandle[CONFIG_FLASH0], blk);
    if(status != SystemP_SUCCESS)
    {
        DebugP_log("Block Erase Failed at 0x%X offset !!!", offset);
    }
    if(SystemP_SUCCESS == status)
    {
        status = Flash_write(gFlashHandle[CONFIG_FLASH0], offset, gOspiTxBuf, APP_OSPI_DATA_SIZE);
    }
    else
    {
        DebugP_log("Flash Write of %d bytes failed at 0x%X offset !!!", APP_OSPI_DATA_SIZE, offset);
    }
    if(SystemP_SUCCESS == status)
    {
        status = Flash_read(gFlashHandle[CONFIG_FLASH0], offset, gOspiRxBuf, APP_OSPI_DATA_SIZE);
    }
    if(SystemP_SUCCESS == status)
    {
        status |= ospi_flash_io_compare_buffers();
    }

    offset = APP_OSPI_FLASH_OFFSET_BASE + (flashAttrs->pageSize*16);
    ospi_flash_io_fill_buffers();
    Flash_offsetToSectorPage(gFlashHandle[CONFIG_FLASH0], offset, &sector, &page);
    status = Flash_eraseSector(gFlashHandle[CONFIG_FLASH0], sector);
    if(status != SystemP_SUCCESS)
    {
        DebugP_log("Sector Erase Failed at 0x%X offset !!!", offset);
    }
    if(SystemP_SUCCESS == status)
    {
        status = Flash_write(gFlashHandle[CONFIG_FLASH0], offset, gOspiTxBuf, APP_OSPI_DATA_SIZE);
    }
    else
    {
        DebugP_log("Flash Write of %d bytes failed at 0x%X offset !!!", APP_OSPI_DATA_SIZE, offset);
    }
    if(SystemP_SUCCESS == status)
    {
        status = Flash_read(gFlashHandle[CONFIG_FLASH0], offset, gOspiRxBuf, APP_OSPI_DATA_SIZE);
    }
    if(SystemP_SUCCESS == status)
    {
        status |= ospi_flash_io_compare_buffers();
    }

    if(SystemP_SUCCESS == status)
    {
        DebugP_log("All tests have passed!!\r\n");
    }
    else
    {
        DebugP_log("Some tests have failed!!\r\n");
    }

    return status;
}

void ospi_flash_io_fill_buffers(void)
{
    uint32_t i;

    for(i = 0U; i < APP_OSPI_DATA_SIZE; i++)
    {
        gOspiTxBuf[i] = i % 256;
        gOspiRxBuf[i] = 0U;
    }
}

int32_t ospi_flash_io_compare_buffers(void)
{
    int32_t status = SystemP_SUCCESS;
    uint32_t i;

    for(i = 0U; i < APP_OSPI_DATA_SIZE; i++)
    {
        if(gOspiTxBuf[i] != gOspiRxBuf[i])
        {
            status = SystemP_FAILURE;
            DebugP_logError("OSPI read data mismatch !!!\r\n");
            break;
        }
    }
    return status;
}

  • /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM64x_beta" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM64x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const eeprom     = scripting.addModule("/board/eeprom/eeprom", {}, false);
    const eeprom1    = eeprom.addInstance();
    const flash      = scripting.addModule("/board/flash/flash", {}, false);
    const flash1     = flash.addInstance();
    const adc        = scripting.addModule("/drivers/adc/adc", {}, false);
    const adc1       = adc.addInstance();
    const gpio       = scripting.addModule("/drivers/gpio/gpio", {}, false);
    const gpio1      = gpio.addInstance();
    const gpio2      = gpio.addInstance();
    const gpio3      = gpio.addInstance();
    const gpio4      = gpio.addInstance();
    const gpio5      = gpio.addInstance();
    const gpio6      = gpio.addInstance();
    const gpio7      = gpio.addInstance();
    const gpio8      = gpio.addInstance();
    const gpio9      = gpio.addInstance();
    const gpio10     = gpio.addInstance();
    const gpio11     = gpio.addInstance();
    const gpio12     = gpio.addInstance();
    const gpio13     = gpio.addInstance();
    const gpio14     = gpio.addInstance();
    const gpio15     = gpio.addInstance();
    const gpio16     = gpio.addInstance();
    const gpio17     = gpio.addInstance();
    const i2c        = scripting.addModule("/drivers/i2c/i2c", {}, false);
    const i2c1       = i2c.addInstance();
    const i2c2       = i2c.addInstance();
    const mcan       = scripting.addModule("/drivers/mcan/mcan", {}, false);
    const mcan1      = mcan.addInstance();
    const mcan2      = mcan.addInstance();
    const mcspi      = scripting.addModule("/drivers/mcspi/mcspi", {}, false);
    const mcspi1     = mcspi.addInstance();
    const mmcsd      = scripting.addModule("/drivers/mmcsd/mmcsd", {}, false);
    const mmcsd1     = mmcsd.addInstance();
    const uart       = scripting.addModule("/drivers/uart/uart", {}, false);
    const uart1      = uart.addInstance();
    const uart2      = uart.addInstance();
    const udma       = scripting.addModule("/drivers/udma/udma", {}, false);
    const udma1      = udma.addInstance();
    const clock      = scripting.addModule("/kernel/dpl/clock");
    const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71 = mpu_armv7.addInstance();
    const mpu_armv72 = mpu_armv7.addInstance();
    const mpu_armv73 = mpu_armv7.addInstance();
    const mpu_armv74 = mpu_armv7.addInstance();
    const mpu_armv75 = mpu_armv7.addInstance();
    const mpu_armv76 = mpu_armv7.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    eeprom1.$name      = "CONFIG_EEPROM0";
    eeprom1.i2cAddress = 0x54;
    
    flash1.$name                         = "CONFIG_FLASH0";
    flash1.flashBlockSize                = 65536;
    flash1.cmdBlockErase3B               = "0xD8";
    flash1.cmdWr                         = "0x02";
    flash1.proto_isAddrReg               = false;
    flash1.xspiWipRdCmd                  = "0x00";
    flash1.xspiWipReg                    = "0x00000000";
    flash1.quirks                        = "NULL";
    flash1.dummyClksCmd                  = 0;
    flash1.cmdSectorErase4B              = "0xDC";
    flash1.cmdSectorErase3B              = "0xD8";
    flash1.device                        = "CUSTOM_FLASH";
    flash1.fname                         = "TQFLASH";
    flash1.enable4BAddr                  = false;
    flash1.dummy_cmdRegRd                = "0x15";
    flash1.dummy_cmdRegWr                = "0x01";
    flash1.dummy_isAddrReg               = false;
    flash1.flashManfId                   = "0xC2";
    flash1.flashDeviceId                 = "0x253A";
    flash1.dummyClksRd                   = 10;
    flash1.dummy_bitP                    = 192;
    flash1.dummy_mask                    = "0xC0";
    flash1.flashQeType                   = "2";
    flash1.flash444Seq                   = "0x04";
    flash1.protocol                      = "4s_4d_4d";
    flash1.cmdRd                         = "0xED";
    flash1.strDtr_isAddrReg              = false;
    flash1.peripheralDriver.$name        = "CONFIG_OSPI0";
    flash1.peripheralDriver.baudRateDiv  = 8;
    flash1.peripheralDriver.inputClkFreq = 200000000;
    
    adc1.$name                  = "CONFIG_ADC0";
    adc1.ADC.EXT_TRIGGER0.$used = false;
    adc1.ADC.EXT_TRIGGER1.$used = false;
    
    gpio1.$name                    = "GPIO_USER_LED_1";
    gpio1.pinDir                   = "OUTPUT";
    gpio1.useMcuDomainPeripherals  = true;
    gpio1.MCU_GPIO.gpioPin.$assign = "ball.C7";
    
    gpio2.$name                    = "GPIO_USER_LED_2";
    gpio2.pinDir                   = "OUTPUT";
    gpio2.useMcuDomainPeripherals  = true;
    gpio2.MCU_GPIO.gpioPin.$assign = "ball.C8";
    
    gpio3.$name                = "DIG_IN_1";
    gpio3.trigType             = "BOTH_EDGE";
    gpio3.GPIO.gpioPin.$assign = "ball.T21";
    
    gpio4.$name                = "DIG_IN_2";
    gpio4.trigType             = "BOTH_EDGE";
    gpio4.GPIO.gpioPin.$assign = "ball.N17";
    
    gpio5.$name                = "DIG_IN_3";
    gpio5.trigType             = "BOTH_EDGE";
    gpio5.GPIO.gpioPin.$assign = "ball.R19";
    
    gpio6.$name                = "DIG_IN_4";
    gpio6.trigType             = "BOTH_EDGE";
    gpio6.GPIO.gpioPin.$assign = "ball.R20";
    
    gpio7.$name                = "EN_DIG_OUT_1";
    gpio7.pinDir               = "OUTPUT";
    gpio7.GPIO.gpioPin.$assign = "ball.W20";
    
    gpio8.$name                = "STATUS_OUT_1";
    gpio8.GPIO.gpioPin.$assign = "ball.W21";
    
    gpio9.$name                = "EN_DIG_OUT_2";
    gpio9.pinDir               = "OUTPUT";
    gpio9.GPIO.gpioPin.$assign = "ball.V18";
    
    gpio10.$name                = "STATUS_OUT_2";
    gpio10.GPIO.gpioPin.$assign = "ball.Y21";
    
    gpio11.$name                = "EN_DIG_OUT_3";
    gpio11.pinDir               = "OUTPUT";
    gpio11.GPIO.gpioPin.$assign = "ball.Y20";
    
    gpio12.$name                = "STATUS_OUT_3";
    gpio12.GPIO.gpioPin.$assign = "ball.N16";
    
    gpio13.$name                = "EN_DIG_OUT_4";
    gpio13.pinDir               = "OUTPUT";
    gpio13.GPIO.gpioPin.$assign = "ball.P17";
    
    gpio14.$name                = "STATUS_OUT_4";
    gpio14.GPIO.gpioPin.$assign = "ball.Y18";
    
    gpio15.$name                    = "USER_BUTTON";
    gpio15.trigType                 = "RISE_EDGE";
    gpio15.useMcuDomainPeripherals  = true;
    gpio15.MCU_GPIO.gpioPin.$assign = "ball.A7";
    
    gpio16.$name                = "RS485_RTS";
    gpio16.pinDir               = "OUTPUT";
    gpio16.GPIO.gpioPin.$assign = "ball.T18";
    
    gpio17.$name                = "ADC_RST";
    gpio17.pinDir               = "OUTPUT";
    gpio17.GPIO.gpioPin.$assign = "ball.D16";
    
    i2c1.$name               = "CONFIG_I2C0";
    eeprom1.peripheralDriver = i2c1;
    i2c1.I2C.$assign         = "I2C0";
    
    i2c2.$name = "CONFIG_I2C1";
    
    mcan1.$name = "CONFIG_MCAN0";
    
    mcan2.$name        = "CONFIG_MCAN1";
    mcan2.MCAN.$assign = "MCAN1";
    
    mcspi1.$name                       = "CONFIG_MCSPI0";
    mcspi1.SPI.$assign                 = "SPI0";
    mcspi1.SPI.CLK.$assign             = "ball.D13";
    mcspi1.SPI.D0.$assign              = "ball.A13";
    mcspi1.SPI.D1.$assign              = "ball.A14";
    mcspi1.mcspiChannel[0].$name       = "CONFIG_MCSPI_CH0";
    mcspi1.mcspiChannel[0].advanced    = true;
    mcspi1.mcspiChannel[0].frameFormat = "POL0_PHA1";
    mcspi1.mcspiChannel[0].bitRate     = 24000000;
    mcspi1.mcspiChannel[0].CSn.$assign = "ball.D12";
    
    mmcsd1.$name        = "CONFIG_MMCSD0";
    mmcsd1.moduleSelect = "MMC0";
    
    uart1.$name            = "RS485";
    uart1.inputClkFreq     = 96000000;
    uart1.readMode         = "CALLBACK";
    uart1.readCallbackFxn  = "uart_echo_read_callback";
    uart1.writeMode        = "CALLBACK";
    uart1.writeCallbackFxn = "uart_echo_write_callback";
    uart1.UART.$assign     = "USART2";
    
    uart2.$name           = "CONFIG_USART0";
    uart2.readMode        = "CALLBACK";
    uart2.readCallbackFxn = "uartCallback";
    
    udma1.instance = "PKTDMA_0";
    udma1.$name    = "CONFIG_UDMA_PKTDMA_0";
    
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    mpu_armv71.$name             = "R5_0_REGION";
    
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv72.$name             = "R5_0_TCMA";
    
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv73.$name             = "R5_0_TCMB";
    
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv74.$name             = "R5_0_MSRAM";
    
    mpu_armv75.size       = 31;
    mpu_armv75.baseAddr   = 0x80000000;
    mpu_armv75.$name      = "R5_0_xDDR";
    mpu_armv75.attributes = "Cached+Sharable";
    
    mpu_armv76.$name        = "R5_0_FLASH";
    mpu_armv76.baseAddr     = 0x60000000;
    mpu_armv76.size         = 26;
    mpu_armv76.allowExecute = false;
    mpu_armv76.attributes   = "NonCached";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    flash1.peripheralDriver.OSPI.DQS.$suggestSolution  = "ball.N19";
    flash1.peripheralDriver.OSPI.D7.$suggestSolution   = "ball.M17";
    flash1.peripheralDriver.OSPI.D6.$suggestSolution   = "ball.N18";
    flash1.peripheralDriver.OSPI.D5.$suggestSolution   = "ball.P20";
    flash1.peripheralDriver.OSPI.D4.$suggestSolution   = "ball.P21";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    adc1.ADC.$suggestSolution                          = "ADC0";
    adc1.ADC.AIN0.$suggestSolution                     = "ball.G20";
    adc1.ADC.AIN1.$suggestSolution                     = "ball.F20";
    adc1.ADC.AIN2.$suggestSolution                     = "ball.E21";
    adc1.ADC.AIN3.$suggestSolution                     = "ball.D20";
    adc1.ADC.AIN4.$suggestSolution                     = "ball.G21";
    adc1.ADC.AIN5.$suggestSolution                     = "ball.F21";
    adc1.ADC.AIN6.$suggestSolution                     = "ball.F19";
    adc1.ADC.AIN7.$suggestSolution                     = "ball.E20";
    gpio1.MCU_GPIO.$suggestSolution                    = "MCU_GPIO0";
    gpio2.MCU_GPIO.$suggestSolution                    = "MCU_GPIO0";
    gpio3.GPIO.$suggestSolution                        = "GPIO0";
    gpio4.GPIO.$suggestSolution                        = "GPIO0";
    gpio5.GPIO.$suggestSolution                        = "GPIO0";
    gpio6.GPIO.$suggestSolution                        = "GPIO0";
    gpio7.GPIO.$suggestSolution                        = "GPIO0";
    gpio8.GPIO.$suggestSolution                        = "GPIO0";
    gpio9.GPIO.$suggestSolution                        = "GPIO0";
    gpio10.GPIO.$suggestSolution                       = "GPIO0";
    gpio11.GPIO.$suggestSolution                       = "GPIO0";
    gpio12.GPIO.$suggestSolution                       = "GPIO0";
    gpio13.GPIO.$suggestSolution                       = "GPIO0";
    gpio14.GPIO.$suggestSolution                       = "GPIO0";
    gpio15.MCU_GPIO.$suggestSolution                   = "MCU_GPIO0";
    gpio16.GPIO.$suggestSolution                       = "GPIO0";
    gpio17.GPIO.$suggestSolution                       = "GPIO1";
    i2c1.I2C.SCL.$suggestSolution                      = "ball.A18";
    i2c1.I2C.SDA.$suggestSolution                      = "ball.B18";
    i2c2.I2C.$suggestSolution                          = "I2C1";
    i2c2.I2C.SCL.$suggestSolution                      = "ball.C18";
    i2c2.I2C.SDA.$suggestSolution                      = "ball.B19";
    mcan1.MCAN.$suggestSolution                        = "MCAN0";
    mcan1.MCAN.RX.$suggestSolution                     = "ball.B17";
    mcan1.MCAN.TX.$suggestSolution                     = "ball.A17";
    mcan2.MCAN.RX.$suggestSolution                     = "ball.D17";
    mcan2.MCAN.TX.$suggestSolution                     = "ball.C17";
    mmcsd1.MMC0.$suggestSolution                       = "MMC0";
    uart1.UART.RXD.$suggestSolution                    = "ball.T20";
    uart1.UART.TXD.$suggestSolution                    = "ball.U21";
    uart2.UART.$suggestSolution                        = "USART0";
    uart2.UART.RXD.$suggestSolution                    = "ball.D15";
    uart2.UART.TXD.$suggestSolution                    = "ball.C16";
    
    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM64x_beta" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM64x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const flash       = scripting.addModule("/board/flash/flash", {}, false);
    const flash1      = flash.addInstance();
    const bootloader  = scripting.addModule("/drivers/bootloader/bootloader", {}, false);
    const bootloader1 = bootloader.addInstance();
    const mmcsd       = scripting.addModule("/drivers/mmcsd/mmcsd", {}, false);
    const mmcsd1      = mmcsd.addInstance();
    const uart        = scripting.addModule("/drivers/uart/uart", {}, false);
    const uart1       = uart.addInstance();
    const debug_log   = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7   = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71  = mpu_armv7.addInstance();
    const mpu_armv72  = mpu_armv7.addInstance();
    const mpu_armv73  = mpu_armv7.addInstance();
    const mpu_armv74  = mpu_armv7.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    flash1.$name                         = "CONFIG_FLASH0";
    flash1.flashBlockSize                = 65536;
    flash1.cmdBlockErase3B               = "0xD8";
    flash1.cmdWr                         = "0x02";
    flash1.proto_isAddrReg               = false;
    flash1.xspiWipRdCmd                  = "0x00";
    flash1.xspiWipReg                    = "0x00000000";
    flash1.quirks                        = "NULL";
    flash1.dummyClksCmd                  = 0;
    flash1.cmdSectorErase4B              = "0xDC";
    flash1.cmdSectorErase3B              = "0xD8";
    flash1.device                        = "CUSTOM_FLASH";
    flash1.fname                         = "TQFLASH";
    flash1.enable4BAddr                  = false;
    flash1.dummy_cmdRegRd                = "0x15";
    flash1.dummy_cmdRegWr                = "0x01";
    flash1.dummy_isAddrReg               = false;
    flash1.flashManfId                   = "0xC2";
    flash1.flashDeviceId                 = "0x253A";
    flash1.dummyClksRd                   = 10;
    flash1.dummy_bitP                    = 192;
    flash1.dummy_mask                    = "0xC0";
    flash1.flashQeType                   = "2";
    flash1.flash444Seq                   = "0x04";
    flash1.protocol                      = "4s_4d_4d";
    flash1.cmdRd                         = "0xED";
    flash1.strDtr_isAddrReg              = false;
    flash1.peripheralDriver.$name        = "CONFIG_OSPI0";
    flash1.peripheralDriver.baudRateDiv  = 8;
    flash1.peripheralDriver.inputClkFreq = 200000000;
    
    bootloader1.$name            = "CONFIG_BOOTLOADER_MEM";
    bootloader1.bootMedia        = "MEM";
    bootloader1.isAppimageSigned = false;
    
    mmcsd1.$name    = "CONFIG_MMCSD0";
    mmcsd1.cardType = "NO_DEVICE";
    
    uart1.$name        = "CONFIG_UART0";
    uart1.intrEnable   = "DISABLE";
    uart1.UART.$assign = "USART2";
    
    debug_log.enableCssLog      = false;
    debug_log.enableLogZoneInfo = true;
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    flash1.peripheralDriver.OSPI.DQS.$suggestSolution  = "ball.N19";
    flash1.peripheralDriver.OSPI.D7.$suggestSolution   = "ball.M17";
    flash1.peripheralDriver.OSPI.D6.$suggestSolution   = "ball.N18";
    flash1.peripheralDriver.OSPI.D5.$suggestSolution   = "ball.P20";
    flash1.peripheralDriver.OSPI.D4.$suggestSolution   = "ball.P21";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    mmcsd1.MMC1.$suggestSolution                       = "MMC1";
    mmcsd1.MMC1.CLK.$suggestSolution                   = "ball.L20";
    mmcsd1.MMC1.CLKLB.$suggestSolution                 = "MMC1_CLKLB";
    mmcsd1.MMC1.CMD.$suggestSolution                   = "ball.J19";
    mmcsd1.MMC1.DAT0.$suggestSolution                  = "ball.K21";
    mmcsd1.MMC1.DAT1.$suggestSolution                  = "ball.L21";
    mmcsd1.MMC1.DAT2.$suggestSolution                  = "ball.K19";
    mmcsd1.MMC1.DAT3.$suggestSolution                  = "ball.K18";
    mmcsd1.MMC1.SDCD.$suggestSolution                  = "ball.D19";
    uart1.UART.RXD.$suggestSolution                    = "ball.T20";
    uart1.UART.TXD.$suggestSolution                    = "ball.U21";
    

  • Hello Isaac,

    I see you have already removed the DDR and set the Card Type in eMMC module to NO_DEVICE in Sysconfig of SBL_UART_UNIFLASH. So, the only module remaining that might be creating the issue is the Flash module in the Sysconfig.

    Before proceeding any further, could you go through the following guide just in case you missed something

    AM64x MCU+ SDK: Adding Support For a Custom Flash Device (ti.com)

    Regards,

    Prashant

  • HI  ,

    The SPI test seems to work.. Does it mean that the sysconfig is fail? Could it be that the Flashwriter isn't working because of authentification problems like before:

    [MAIN_Cortex_R5_0_0] Test initialized...
    [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!!
    

  • It also seems, that I can't load the .json file I made to the autoconfiguration:

    ```

    ReferenceError: __dirname is not defined
    Hide Details...

    at Object.rootDir (webpack:///src/pinmux/services/paths.ts:8:25) at func (webpack:///src/pinmux/services/utils.ts:582:35) at Object.getNodePath (webpack:///src/pinmux/services/pathsVisibility.ts:22:10) at Object.getNodePath (C:\ti\mcu_plus_sdk_am64x_08_06_00_45\source\.meta\common.syscfg.js:39:19) at Object.onLaunch (C:\ti\mcu_plus_sdk_am64x_08_06_00_45\source\board\.meta\flash\v0\flash_v0.syscfg.js:822:44) at cb (webpack:///src/pinmux/services/objectManagers/configurables/externalExecutableConfigurableMgr.ts:30:20) at Object.withDeprecatedAccess (webpack:///src/pinmux/services/deprecatedAccessGuard.ts:14:10) at Object.disableScriptingForCallback (webpack:///src/pinmux/services/scripting/scriptingGuard.ts:14:10) at func (webpack:///src/pinmux/services/objectManagers/configurables/externalExecutableConfigurableMgr.ts:29:50) at Object.t.allowPathVisibility (webpack:///src/pinmux/services/pathsVisibility.ts:11:10)

    ```

  • Hello Isaac,

    So, you have successfully run the OSPI_FLASH_DIAG and now have the correct flash configurations as JSON data but getting error while trying to use the "Load from JSON" feature to automatically fill the required fields in the Flash module of Sysconfig.

    Please see the following thread for the error you see

    AM6442: mcu_plus_sdk_am64x_08_06_00_43 GET RM DATA - Processors forum - Processors - TI E2E support forums

    Could it be that the Flashwriter isn't working because of authentification problems like before:

    This is not the case with sbl_uart_uniflash. Its only primary job is to flash whatever image is received over UART to the flash media. So, there are no authentication checks here.

    Regards,

    Prashant

  • Hello Prashant,

    well now we're at the problem of the beginning. It seems that the program does execute, after I configured the flash thorugh the .json file:

    ```

    C:\ti\mcu_plus_sdk_am64x_08_06_00_45\tools\boot>python uart_uniflash.py -p COM16 --cfg sbl_prebuilt/am64x-evm/default_sbl_null_tq.cfg

    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!

    Executing command 1 of 2 ...
    Found flash writer ... sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash_tq.tiimage
    Sent flashwriter sbl_prebuilt/am64x-evm/sbl_uart_uniflash_tq.tiimage of size 314414 bytes in 30.25s.

    Executing command 2 of 2 ...
    Command arguments : --file=sbl_prebuilt/am64x-evm/sbl_null.release.tiimage --operation=flash --flash-offset=0x0
    Sent sbl_prebuilt/am64x-evm/sbl_null.release.tiimage of size 271847 bytes in 25.56s.
    [STATUS] ERROR: Flash verify failed !!!

    All commands from config file are executed !!!

    ```

    Still not working..

    Regards,

    Isaac

  • Hello Isaac,

    I think the flash configurations are mostly set correctly as the SBL NULL is getting sent successfully unlike before.

    The failure however I guess is due to the custom changes you might have in the flash driver. Can you revert any changes & try the default drivers once?

    Regards,

    Prashant

  • Hi ,

    you mean the sbl_uniflash uart? or you mean the src code with the libs?

  • Hi Isaac,

    I mean the later. You might have some changes in the source folder affecting the libs. If you have changes, can you revert them and rebuild the libs with the default sources.

    Regards,

    Prashant

  • Ok I will try with the vanilla version

  • Hi Prashant with the vanilla SDK (or the unchanged SDK) it seems to get stucked.

    While with the driver-src-code update it seems to load untill it fails at the end. So it seems that the driver does actually work?

  • vanilla SDK (or the unchanged SDK) it seems to get stucked.

    For this, did you modify the Sysconfig of the sbl_uart_uniflash to remove DDR, set NO_DEVICE and update flash configurations using Load from JSON? What I want you to do is do these changes only in the sbl_uart_uniflash & keep everything else in the SDK untouched. Does the flashing succeed then?

  • Yes I did exactly what yu said. 

  • Could it be, that my MPU regions are wrongly cofigured?

  • I don't think the MPU could be causing an issue here.

    Can you run the OSPI_FLASH_IO example after doing the flash configuration modification in its sysconfig. Usually we would want to have this example working with custom flash before trying out the flashing procedure.

    AM64x MCU+ SDK: OSPI Flash IO (ti.com)

  • Result:

    ```
    ERROR: Flash_norOspiOpen:1216: Flash_norOspiOpen : PHY enabling failed!!! Continuing without PHY...
    ERROR: ospi_flash_io_compare_buffers:152: OSPI read data mismatch !!!
    ERROR: ospi_flash_io_compare_buffers:152: OSPI read data mismatch !!!
    Some tests have failed!!

    ```

    I want to refer this Thread also to the Thread of my collegue, so you know where I've got all the information about the driver and the flash config:

    "">e2e.ti.com/.../4494163

  • Btw. the test fails at the "Board_driversOpen()" function.

  • Hello ,

    I made following tests: 

    Using the our https://github.com/tq-systems/TQMaX4XxL.SW.MCU.BSP sysconfig-file I could make successfull tests with the qspi application on the BSP. 

    I tried setting the configurations I got from the ospi_flash_dia example via json autoconfigure in the BSP's sysconfig. There I got the same errors as in the attempts before:

    ERROR: ospi_flash_io_compare_buffers:163: OSPI read data mismatch !!!
    ERROR: ospi_flash_io_compare_buffers:163: OSPI read data mismatch !!!
    Some tests have failed!!

    Furthermore changing the ospi_flash_io sysconfig to the configurations from the BSP leads to the same error? What could be leading to this problem? Or is the BSP giving me a false positive?

    All projects have the same SDK, sysconfig version, sysconfig configurations(I removed unnecessary peripherals from the sysconfig for the ospi_flash_example, e.g adc).

    Regards,

    Isaac

  • Hello Isaac,

    Using the our https://github.com/tq-systems/TQMaX4XxL.SW.MCU.BSP sysconfig-file I could make successfull tests with the qspi application on the BSP. 

    If this is ineed the case then this should really be working. I believe you tested the BSP on top of MCU+ SDK v8.6 you are using. This shouldn't be a false positive.

    In any case, if you do the same changes as BSP then the result should replicate with `ospi_flash_io` even if a false positive.

    Furthermore changing the ospi_flash_io sysconfig to the configurations from the BSP leads to the same error? What could be leading to this problem? Or is the BSP giving me a false positive?

    I think let's work on this. If the BSP is working then do every changes to `ospi_flash_io` as done by BSP and then test. So, can you share the changes done by you in `ospi_flash_io`? I will once quickly run through them to see if they are the exact as BSP.

    Regards,

    Prashant

  • Hello Prashant, I did find the the problem. It was indeed a change inside the 'ospi_flash_io' regarding a register of the ospi controller. I will post the change on monday.

    Thank you for your help!

  • Sure, Isaac. Let's catch up on Monday. Have a good weekend!!

  • Hello Prashant,

    so the soultion was these 2 lines of code:

    ```

    #define OSPI_RD_DATA_CAPTURE_REG_ADD  (0x0FC40010)

    /*...*/

    /* DELAY_FD = 2 and BYASS_FLD = enable
    * The default DELAY_FD = 4 does not work with QSPI flash, so DELAY_FD = 2 must be used.
    * In addition, the "board.am64x.r5f.ti-arm-clang.debug.lib" must be rebuilt with the new "flash_nor_ospi.c" file.
    * Please see README.md*/
    *(uint32_t*) OSPI_RD_DATA_CAPTURE_REG_ADD = 0x05;

    ```

    In my understanding this has to be implemented after OSPI driver Initialization and most importantly while OSPI is in idle state.

    After that I could boot for both HS_FS and GP-Images.

    The related register is decribed in the technical manual:

    Still I do not really understand why the delay has to be changed.. is there some technical explanation known to you?

    Regards,

    Isaac 

  • Hello Isaac,

    For technical understanding, you may refer the TRM section 12.3.2.4.2.1 Read Data Capture.

    I was also looking at the source driver code and see that the DELAY_FD value is not hardcoded to 4. It's evaluated according to a certain logic starting with the DELAY_FD value of 4 and decrementing it until the logic returns success. This is shown below

    ~/ti/mcu_plus_sdk/am64x/08_06_00_45
    ❯ grep -n -A10 "Set RD Capture Delay by reading ID" -- source/board/flash/ospi/flash_nor_ospi.c
    1170:        /* Set RD Capture Delay by reading ID */
    1171-        uint32_t readDataCapDelay = 4U;
    1172-        OSPI_setRdDataCaptureDelay(obj->ospiHandle, readDataCapDelay);
    1173-        status = Flash_norOspiReadId(config);
    1174-
    1175-        while((status != SystemP_SUCCESS) && (readDataCapDelay > 0U))
    1176-        {
    1177-            readDataCapDelay--;
    1178-            OSPI_setRdDataCaptureDelay(obj->ospiHandle, readDataCapDelay);
    1179-            status = Flash_norOspiReadId(config);
    1180-        }
    

    On running the `ospi_flash_io` and printing the value of OSPI_RD_DATA_CAPTURE_REG_ADD, I do see the DELAY_FD (bit 4:1) value is set 0x1 instead of 0x4.

    DMSC Firmware Version 8.6.4--v08.06.04 (Chill Capybar
    DMSC Firmware revision 0x8
    DMSC ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : NOR SPI FLASH
    [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz
    [BOOTLOADER_PROFILE] Boot Image Size  : 58 KB
    [BOOTLOADER_PROFILE] Cores present    :
    r5f0-0
    [BOOTLOADER PROFILE] SYSFW init                       :      12004us
    [BOOTLOADER PROFILE] System_init                      :     419936us
    [BOOTLOADER PROFILE] Drivers_open                     :        300us
    [BOOTLOADER PROFILE] Board_driversOpen                :      23399us
    [BOOTLOADER PROFILE] Sciclient Get Version            :      10114us
    [BOOTLOADER PROFILE] CPU Load                         :      96116us
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :     561877us
    
    Image loading done, switching to application ...
    Value at 0xfc40010: 0x123
    All tests have passed!!

    So, the question now is why didn't the driver pick the right value of 0x2 for your custom flash. Maybe you can try printing the value of OSPI_RD_DATA_CAPTURE_REG_ADD before manually setting it to see what is the value set by the driver.

    Regards,

    Prashant