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.

AM2434: Secondary bootloader with custom flash

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

Hello TI,

I have two questions relating the custom flash driver topic.

I have managed to make custom flash driver work in 114 mode. And  run the OSPI flash_io example from SDK
Now as mentioned in the related thread. I am trying to use jtag_uniflash program example to flash:

sbl_null_am243x-lp_r5fss0-0_nortos_ti-arm-clang.tiimage at offset 0x0

and 

<myApplication>.appimage at offset 0x80000

It seems like I can program the flash just fine.However the program appImage still doesnt seem to start when switching to OSPI
and power cycling
So my first question is:

A) Is it necessary to activate the 444 mode to run bootloader etc. Or is it just for performance improvement?

SDK "Writing custom flash driver" mentions: 

  • Step 4 "Update the example.syscfg of the ospi_flash_io example OSPI Flash IO using SysConfig GUI to select the new flash device you have added."
  • Step 5 "Similar to the ospi_flash_io example, update the example.syscfg for OSPI bootloader (sbl_ospiSBL OSPI and flash write"r

B) Is there any other action necessary then switching the flash in the sysconfig and rebuilding the JTAG_UNIFLASH and SBL_OSPI?

Thank you for your time and have a great day,

Dominik

  • Hi Dominic,

    First of all, if you want to boot appImage from the OSPI/QSPI flash, then you have to use the sbl_ospi or sbl_qspi (instead of sbl_null). The bsl_null will not load and run appImage. It is for setting up the EVM for software development and debugging using CCS.

    A) You do not have to enable the 444 mode to run bootloader, it is just for faster boot.

    B) Since you are using your own customized flash driver, the SysConfig is only used to SELECT(pick) the correct flash driver and rebuild the examples which depends on the flash driver, like sbl_jtag_uniflash or sbl_ospi etc.

    Best regards,

    Ming

  • Hey Ming, 

    Thank you for answering my questions. Great help as always! 

    I have switched to the SBL_OSPI. And also have managed to solder cables to UART0 to use uart_uniflash. But this still didnt
    resolve my Issue. The flashing process seems to be fine. However the application still doesnt run after power cycling and
    switching to Q/OSPI bootmode.I have updated all the applications that use flash with new flash driver. (SBL_OSPI, UART/JTAG uniflash etc.)

    When I try to load SBL_OSPI after initializing with load_dmsc.js It enters the Bootloader_socWaitForFWBoot() function
    and gets stuck on: 

    line 626 in file: sciclient.c:

    while ((CSL_REG32_RD(Sciclient_secProxyThreadStatusReg(rxThread)) &
    CSL_SEC_PROXY_RT_THREAD_STATUS_CUR_CNT_MASK) == 0U) {;}

    Do you know why this could be happening?/What does this register do ?

    Does it have anything to do with incorrect resource allocation ?

    Thank you for your answer and have a great day!

    Dominik

  • Hi Dominik,

    The OSPI/QSPI boot has two stages: first The ROM bootloader loads and runs the sbl_ospi/qspi, then the sbl_ospi/qspi loads and runs the appImage. Can you verify which stage does not work. The UART should display some thing during the boot procedure.

    Best regards,

    Ming 

  • Hello Ming, 

    so I have tested the output of UART0 in QSPI, UART and NOBOOT MODE.

    NOBOOT as expected didn´t output anything to UART0.Also strange thing is, that I cannot initialize device in NOBOOT mode 
    with load_dmsc.js this only works in UART mode. Do you think this is related to the OSPI boot Issue ?

    UART output was this string:


    01000000011a0000616d36347800000000000000475020200000010000000100


    I have parsed the output with the  SoC ID parser Python Script:

    SoC ID Header Info:
    -----------------------
    ('NumBlocks :', [1])
    -----------------------
    SoC ID Public ROM Info:
    -----------------------
    ('SubBlockId :', 1)
    ('SubBlockSize :', 26)
    ('DeviceName :', 'am64x\x00\x00\x00\x00\x00\x00')
    ('DeviceType :', 'GP ')
    ('DMSC ROM Version :', [0, 1, 0, 0])
    ('R5 ROM Version :', [0, 1, 0, 0])
    -----------------------
    SoC ID Secure ROM Info:
    -----------------------


    I had to make some changes to the script to run it so I am not 100% sure the parsing is correct

    QSPI/OSPI did not output anything.

    Thank you for any of your tips and best regards.

    Dominik

  • Hi Dominik,

    I just noticed you are using the AM243x LP. In that case the UART display is on the 2nd UART.

    Best regards,

    Ming

  • Hello Ming,

    I am not sure I 100% understand. I thought this was the output of the ROM bootloader, is it not ?

    UART output was this string:


    01000000011a0000616d36347800000000000000475020200000010000000100

    And I am also when using LaunchPad this is the output from UART0

    I currently cannot acces UART2 but I thought it would not be necessary for the output. Also what should the output of the ROM bootloader be in QSPI mode ?
    I cannot find anything about this in SDK.

    Thank you for your answers and effort 

    Dominik

  • Hi Dominik,

    Looks like you are using the UART boot mode when you see the UART display the following: 01000000011a0000616d36347800000000000000475020200000010000000100CCCCCC.

    If you have flashed the sbl_qspi and the appImage into the flash by using the sbl_jtag_uniflash, then you want try the boot from OSPI. Let me know what is displayed in the UART. It should look like the AM243x MCU+ SDK: Flash a Hello World example (ti.com)

    If you want to try the sbl_uart_unflash, then you will have to try the following process:

     AM243x MCU+ SDK: Flash a Hello World example (ti.com)

    The load_dmsc.js with no boot mode is not recommended anymore, unless neither sbl_uart_unflash nor the sbl_jtag_uniflash is working.

    Best regards,

    Ming

  • Hello Ming,
    so I may have partially solved this Issue. I have gotten an information, that there are more bootmodes then described in SDK such as UART and QSPI.
    And switching the pin 1 and pin 2 boots in SPI  (not QSPI) bootmode. Meaning the ROM bootloader reads the flash
    on single data line. Is this information true?

    Booting with first and second pin on, I can see the bootloader output and the application is running fine.
    However the standart QSPI bootmode still doesnt work. So from what I understood, that ROM bootloader couldn´t read the SBL from flash, because it had no access to the flash driver for quad mode read and had no way of reading the data of SBL.

    If my assumption true. Is there a way to go around this, so the boottime of the application is faster ?

    Thank you for your help and have nice day.

    Dominik

  • Hi Dominik,

    You are correct about the SPI boot mode. The AM243x actually supports OSPI (8 data lines), QSPI (4 data lines) and XSPI (1 data line). With XSPI working for you, it means the 1 data line is working for ROM bootloader, so the sbl_qspi can be loaded and executed. You can make the sbl_qspi work in 4 data line to speed up the appImage loading process. In order to do this, you may want make sure your own QSPI driver working for the sbl_jtag_uniflash with 4 data lines, so you know for sure your QSPI flash driver is working. This will be the only way to speed up your whole bootloading process, because you have prove that the 4 data line does not work for ROM bootloader (to load the sbl_qspi).

    Best regards,

    Ming