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.

[FAQ] MCU-PLUS-SDK-AM263PX: AM263P4: SBL Fails when using sbl ospi and error while using ospi examples

Part Number: AM263P4
Other Parts Discussed in Thread: MCU-PLUS-SDK-AM263PX, SYSCONFIG

Tool/software: MCU-PLUS-SDK-AM263PX

Following examples are failing in SDK 10.01.00 version in am263px-cc PROC159A board:

  • sbl ospi
  • ospi examples
  • mcan_external_read_write / canfd_external_read_write
  • resolver examples

Error observed while running ospi examples:

  • This issue is happening due to board version mismatch as the new revision boards (PROC159A) have a flash reset mechanism similar to am263px-lp. The ospi flash reset signal is directly coming from the SOC and not via IO expander, which was the case in previous revisions E1/E2.

      1. For MCAN/Resolver examples: 

    • In mcan_transceiver.c file replace the mcanEnableTransceiver() function with this code:

    void mcanEnableTransceiver()
    {
        int32_t status = SystemP_SUCCESS;
        uint8_t boardVer[2] = "";
    
        Board_eepromOpen();
    
        status = EEPROM_read(gEepromHandle[CONFIG_EEPROM0], EEPROM_OFFSET_READ_PCB_REV, boardVer, EEPROM_READ_PCB_REV_DATA_LEN);
        if(status == SystemP_SUCCESS)
        {
            if(boardVer[0] == 'A' && boardVer[1] == '\0')
            {
                /* boardVer is REV A */
                status = TCA6424_Mcan_Transceiver();
            }
            else if(boardVer[1] == '2' && boardVer[0] == 'E')
            {
                /* boardVer is E2 */
                status = TCA6424_Mcan_Transceiver();
            }
            else if(boardVer[1] == '1' && boardVer[0] == 'E')
            {
                /* boardVer is E1 */
                /* MCAN Transceiver is enabled by default in E1*/
            }
            else
            {
                /* boardVer is not valid */
                /* Do nothing */        
            }
        }
    
        DebugP_assert(status == SystemP_SUCCESS);
        Board_eepromClose();
    }

    • In board.c file for resolver examples, replace the i2c_io_expander_resolver_adc() function with:

    void i2c_io_expander_resolver_adc(void)
    {
        int32_t status = SystemP_SUCCESS;
        uint32_t boardVer_offset = 0x1AU;
        uint32_t boardVer_length = 0x2U; // 2 char
    
        uint8_t boardVer[2] = "";
        status = EEPROM_read(gEepromHandle[CONFIG_EEPROM0], boardVer_offset, boardVer, boardVer_length);
        if(status == SystemP_SUCCESS)
        {
            /* read successful */
            if(boardVer[0] == 'A' && boardVer[1] == '\0')
            {
                /* boardVer is REV A */
                DebugP_log("Detected CC version is REV A. Calling TCA6424 Drivers for io expander configurations\r\n");
                i2c_io_expander_resolver_adc_gTCA6424();
            }
            else if(boardVer[1] == '1' && boardVer[0] == 'E')
            {
                /* boardVer is E1 */
                DebugP_log("Detected CC version is E1. Calling TCA6416 Drivers for io expander configurations\r\n");
                i2c_io_expander_resolver_adc_gTCA6416();
            }
            else if(boardVer[1] == '2' && boardVer[0] == 'E')
            {
                /* boardVer is E2 */
                DebugP_log("Detected CC version is E2. Calling TCA6424 Drivers for io expander configurations\r\n");
                i2c_io_expander_resolver_adc_gTCA6424();
            }
            else
            {
                /* boardVer is invalid */
                /* Do nothing */
            }
        }
        else
        {
            DebugP_log("EEPROM read failed. aborting\r\n");
            DebugP_assert(0);
        }
    }

    • Rebuild the example

    
    

      2. For SBL OSPI/OSPI examples

    a. Sysconfig update:

    •   Go to source/sysconfig/drivers/.meta/ospi/v0/ospi_v0.syscfg.js and replace the syscfg.js file with the updated file attached ospi_v0.syscfg.js.zip.

    •    It exposes the OSPI_RESET_OUT0 signal to sysconfig.

    b. Source driver update:

    •    Go to source/drivers/ospi/v0 and paste the contents of the source_ospi_v0_files.zip. Click merge folder and replace files whenever prompted by the system. 

    c. SBL OSPI update:

    •    Go to examples/drivers/boot/sbl_ospi/am263px-cc/r5fss0-0_nortos and paste the contents of sbl_ospi_files.zipClick merge folder and replace files whenever prompted by the system.

    d. OSPI examples update: (eg: ospi_flash_io project)

    •    Go to examples/drivers/ospi/ospi_flash_io and paste the contents of ospi_flash_io_files.zipClick merge folder and replace files whenever prompted.

    •    Make similar changes to the other required ospi examples.

    e. Rebuild libraries

    f. Rebuild sbl, example project

    ospi_v0.syscfg.zip

    source_ospi_v0_files.zip

    sbl_ospi_files.zip

    ospi_flash_io_files.zip