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.

PROCESSOR-SDK-AM64X: my hello world is not able to boot from fsbl.

Part Number: PROCESSOR-SDK-AM64X
Other Parts Discussed in Thread: TMDS64EVM, SYSCONFIG

Tool/software:

Hi, 

I am using standard  TMDS64EVM dev board.

After build Ti image, eg: hello world and load to the flash, I can correctly boot from ospi boot. 


Now, I switch to ada core compiler, I create adacore image  .elf.   my elf can succesfully boot, by using sbl_null, 

<code>


with Ada.Text_IO;


procedure HelloMain is


begin
   while True loop
      Ada.Text_IO.Put_Line("Hello, World from Hellomain\n");

   end loop;
end HelloMain;

</code>

Then, I want to add my .elf to rom code. 

here is my procedure, 


C:/ti/sysconfig_1.20.0/nodejs/node ../../Common/firmware/tools/boot/out2rprc/elf2rprc.js obj/hellomain >> temp_stdout_debug.txt

C:/ti/ccs1270/ccs/utils/cygwin/cp hellomain.rprc obj/hellomain.rprc_tmp
C:/ti/ccs1270/ccs/utils/cygwin/rm -f hellomain.rprc
"../../Common/firmware/tools/boot/xipGen/xipGen.exe" -i obj/hellomain.rprc_tmp -o obj/hellomain.rprc -x hellomain.rprc_xip --flash-start-addr 0x60000000 -v > temp_stdout_debug.txt
C:/ti/sysconfig_1.20.0/nodejs/node ../../Common/firmware/tools/boot/multicoreImageGen/multicoreImageGen.js --devID 55 --out obj/hellomain.appimage obj/hellomain.rprc@4 >> temp_stdout_debug.txt

python ../../Common/firmware/tools/boot/signing/appimage_x509_cert_gen.py --bin obj/hellomain.appimage --authtype 1 --key ../../Common/firmware/tools/boot/signing/rom_degenerateKey.pem --output obj/hellomain.appimage.hs_fs


eventually, I got my hellomain.appimage.hs_fs

However, after succesfully reading from ospi, I am not able to boot. 





 which mistake Do I make when I convert the Image. 


from the debug,   authentication passed,  image is read, however it failed at this  Sciclient_procBootSetProcessorCfg code. 

<code>


int32_t Bootloader_socCpuSetEntryPoint_copy(uint32_t cpuId, uintptr_t entryPoint)
{
    int32_t status = SystemP_SUCCESS;

    uint32_t sciclientCpuProcId = Bootloader_socGetSciclientCpuProcId_copy(cpuId);

    struct tisci_msg_proc_set_config_req  proc_set_config;

    /* set entry point for core0 */
    proc_set_config.processor_id = sciclientCpuProcId;
    proc_set_config.bootvector_lo = entryPoint;
    proc_set_config.bootvector_hi = 0;
    proc_set_config.config_flags_1_set = 0;
    proc_set_config.config_flags_1_clear = 0;
    proc_set_config.config_flags_1_set |= TISCI_MSG_VAL_PROC_BOOT_CFG_FLAG_R5_ATCM_EN;
    proc_set_config.config_flags_1_set |= (TISCI_MSG_VAL_PROC_BOOT_CFG_FLAG_R5_BTCM_EN |
                                                TISCI_MSG_VAL_PROC_BOOT_CFG_FLAG_R5_TCM_RSTBASE);

    if(Bootloader_socIsR5FSSDual_copy(BOOTLOADER_R5FSS0) == FALSE)
    {
        proc_set_config.config_flags_1_set |= TISCI_MSG_VAL_PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE;
    }

    status = Sciclient_procBootSetProcessorCfg(&proc_set_config, SystemP_WAIT_FOREVER);
    if(status != SystemP_SUCCESS)
    {
        DebugP_logError("CPU set config failed for %s\r\n", Bootloader_socGetCoreName_copy(cpuId));
    }

    return status;
}



<code>


How to debug the issue.

Thanks

do you need binary of   hellomain.debug.out    and hellomain.appimage.hs_fs?  

Thanks, I am using lauterbach to load hellomain.debug.out  


  • this is my file please remove .txt , hellomain can boot by sbl null correctly,  C:\ti\mcu_plus_sdk_am64x_09_01_00_41\examples\drivers\boot\sbl_null   however,  hellomain.appimage.hs_fs fail to boot from sbl_ospi   under C:\ti\mcu_plus_sdk_am64x_09_01_00_41\examples\drivers\boot



    hellomain.txt

    please rename it to hellomain.appimage.hs_fs.txt   the key I am using is default one in tools/boot/signing/rom_degenerateKey.pem


    hellomain.appimage.hs_fs.txt
    0�R0�:�R�}�c��w�ֱ*xV_��y�0
    	*�H��
    
    0��10	UUS10	USC10UNew York1!0U
    Texas Instruments., Inc.10
    UDSP10
    UAlbert10	*�H��
    	Albert@gt.ti.com0
    240916205333Z
    241016205333Z0��10	UUS10	USC10UNew York1!0U
    Texas Instruments., Inc.10
    UDSP10
    UAlbert10	*�H��
    	Albert@gt.ti.com0�"0
    	*�H��
    �0�
    ����ۛ�.�T�R���t�F�W������N�@�G7x���f71p�X���q5_��A0hs�y�;r����=ҘL�1��<m�a�,
    �;�8fr9)P���<�
    m/0��d�}�rD����u������`�2�J��'���gK�P�#����P5A���\�9z�Ŏ5hQK��9A�|��Qh�n����R��I�$j`G3��3:�t�-EI� �H����~�5@�{�.�>� �>�@�"��"�\�W�YVN��t�\���2Nfa;QN�OX�8�/L��	����������ď�Ko��h�ˮ�a�,< �o��
    �T���Ӝ�it�J�����ɵ��I��)��	���K@{�?�$rY�}��'��X������f�tV��
    ����Ul�c�g�hk�|(��i������Yc���BY/XG�"��Җ�F`��C���H!n|��]<+���V�6���M�r*k����?���~�lȅ��h��oE����#���0��0U0�0`	+�&"S0Q	`�He@e����ϕG�q��WQ�"�$]�Ap�J�$����\4m�4�)�z�t	`9���rN���0	+�&#0	0	+�&00
    	*�H��
    
    ��m�	<<fA袽�X�v�wYS�
    4��d|��O����E�pI�j>L��w�(Y~|R!�[����$W��,�/�=���M���y�M�y6�X&[����)���@��>�K]7ל���U�h��F�i]�Îd�����ە���u�+�1-D��I 0��Kc/�d��?;�=�b��kv�:Q�=�
    ���֐\,-e���RU�j���ͼQ�L=tV8nz�1Ռa�܊f�;����~	6��3€v�d��
    vm��T���g�����<�4�����T�9
    i-���{"�凊({ux�����l�A�~�^���˻6���XY>����q�t�QE�Yֽَ�רּ�?�����t��EP��Džg���@�~,k))h�1��Z�ls�?��s<�:��NxƳT~���k1U�	G�¥�U^o_3%!&�+��$ T�g~G.
    G'c���m�H��!�h;�ID�V�u���aU��΃$q~��gZ�����)��vMSTR7 MENDRPRC x������������������ ������������� ��0��@��P��`��p������������������������������������џ���o�����џ���o����џ���o����џ���o����џ���o����xџ���o�P/�&��P/�o��*��!��*����A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�/� ��*��O��/�o��0/�(��(��)��#��#��$��  �� �� ��0/�O����O����o��1�0�����	��	��0������O���o������.�p�0H��@� �Q�
     ��Q����l�0H�l,�0 H�P�
    �@�Q�
    @��@��Q�����
    �p
    0�p0�p0�p0�p����`0���p��0�p�H�M�?�(0��(0��<0��<0��#4��s0��80��0��D0��D0��S�3�D ��0��0��0��1����0H�0��,0��D0��0��0��?���0H�0��0��0��1��0��0��0��0��?���0H�0��0��0��1��0��0��0�� 0�� 0��Q?���0H�0��0��0��1��0��0��0��$0��$0��?�D0��0��D0������80��0C�40��40��S��0��@0��@0��0��0��?�0��0��0��?�0��0��0��Q?�0��0��0��?�@ ��40��R�
    @0��0��@0������?�0��0��00��00��0��00��O��00��0��0��?�o��HЍ��/�0�p0H-����K�0@H�,[�0PH�����Q�����H-����� �T�l<�00H�0��s0��0��s ��l<�00H� �����H-�����M�4;�00H�0����������K����@-�R�0��S�
    
    ���
    �������-��M�0��0��,�0��S�� �����0����2�Ѝ���@-��M����0��0�� �� ��@��0�� �� ��0��R��0��0�� ��0��0C�0�������� ��0��R�
    0��0��0������Ѝ�����-��M���������������Ѝ���@-�n<�00H�0��0#�s0��S��������M���� �����@-��������-��M�0��0������� ��0����������Ѝ����-��M�0��0��
    5��8��0��0��s0��@0�s0��S�� �����
    5��8�� �� 0��0�� 0��
    5��8�� ��T0��0��T0��
    5��8��X0��S0��s0��S�����
    0�����������
    5��8�� ��0��0��0��
    0�����������
    5��8�� ��0��0��
    0����������
    5��8�� ��0��2��0��
    %��0��0��0��0��0��8�� ��0������
    5��8�� �� 0��0�� 0��
    5��8��0�� �� �� �� ��!�� �� ��!�� �� ��"�� �� ��"�� �� ��@ �� �� �� �� �� �� ��
    0����������
    5��8��0��0�� ��#��
    5��8��0�� ��n<�00H� �� ��Ѝ����-��M�0����0�����
    5��8��0�� ��0�� ��0��S��+�D�0H��0��S�
    0��S�
    5�
    5��8��0�� �� �� �� ��!�� �� ��!�� �� ��"�� �� ��"�� �� ��#�� �� �� �� �� �� ��$�
    5��8��0�� �� �� �� ��!�� �� ��!�� �� ��"�� �� ��"�� �� ��#�� �� �� �� �� �� ��	�
    5��8��0��0�� ��#��
    5��8��0�� ��� �Ѝ���
    5��8��0��0��s0�� 0�s0��S�0�0�s0��� ����/��M�0��0��0��0��
    5��8�� �� ��Ѝ��/�0��� ����/��-��M������0��0��0��S�=��T�0H��0��0��0��s�
    0��0��0��0�� ��0��0S�S�
    0�� ��0��0S���9�����Ѝ����C-��M�����0����d+�0 H��;�00H�����
    �0��S�
    |��0�H�؛�0�H���	����0�� ����������:�����O��k�0`H��{�0pH�������0�� ������������-��K�0@H��[�0PH�����������-��M�0��0��n<�00H�0��0#�s0��S�
    ����0��
    S�����0��S�
    s���0��S�� �����
    ��z���k���0��S�� �����0����q���Ѝ����-��M���0��0��0��0�� ��0��R��0��0��0��
    ����������Ѝ���0@-�,�M���0�� 0��0��S�0c�0c�$0��$ ��g6�f6F���C���?��A�0��1��0��0��0B�0��$ ��0�� B�g6�f6F���C���?��0A�$0�� 0��0C�S�������0H�f��� 0�� 0��S�� 0��S�ڑ����0H�[���0��00c�S���S�ڑ����0H�Q���  ��R�������0H�J�����s ��(0��0��! C�$0��S�
    ����0��S�� 0��0C�S�������0H�6��� 0�� 0��S�� 0��S�ڠ����0H�+��� 0��S�������0H�$���(0��0��- ��! C� 0��S��S�ʣ����0H����S�� ��� ���� B� ��@��0��0��0��0��P�������,Ѝ�0���@-��M����0��0�� �� ��@��0�� �� ��0��R��0��0�� ��0��0C�0����%��� ��0��R�
    0��0��0������Ѝ�����-��M�������������:���Ѝ���Hello, World from Hellomain\n_ada_hellomains-textio.adba-elchha.adbIn last chance handlerPredefined exception raised at User defined exception, message: now suspending!g-io.adb= 3$
    A`9p)�=#$



  • Hello,

    The application's entry point is set to 0x20 instead of the expected 0x0 & so the entry point set is failed. The application should adhere to the following for booting via SBL:

    • Vector table (.vectors) should be allocated to 0x0.
    • The entry point should then be set to the base address (0x0) of the vector table.

    Please review any R5F example's `linker.cmd` file for reference.

    /* File: examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/generated/linker.cmd */
    ...
    -e_vectors  /* This is the entry of the application, _vector MUST be placed starting address 0x0 */
    
    ...
    
    SECTIONS
    {
        ...
        .vectors  : {
        } > R5F_VECS   , palign(8) 
        ...
    }
    
    
    MEMORY
    {
        R5F_VECS   : ORIGIN = 0x0 , LENGTH = 0x40 
        ...
    }

  • Hi, Prashant :

    Thanks, that is good point. but my application is built by adacore toolchain.


    my entry point  .boot is indeed at  0x20

    from 0x0 to 0x20,  I allocate all of them to __gnat_*_trap

    .traps 0x0000000000000000 0x20 C:\gnatpro\23.2r\arm-eabi\lib\gnat\light-tasking-am64xr5\adalib\libgnat.a(crt0.o)
    0x0000000000000004 __gnat_undef_trap
    0x0000000000000008 __gnat_svc_trap
    0x000000000000000c __gnat_pabt_trap
    0x0000000000000010 __gnat_dabt_trap
    0x0000000000000018 __gnat_irq_trap
    0x000000000000001c __gnat_fiq_trap

    *(.boot)
    .boot 0x0000000000000020 0x23c C:\gnatpro\23.2r\arm-eabi\lib\gnat\light-tasking-am64xr5\adalib\libgnat.a(crt0.o)
    0x0000000000000020 _start
    *fill* 0x000000000000025c 0x4
    .boot.__stub 0x0000000000000260 0x18 linker stubs

    \

    when, I am using sbl_null and using lauterbach to load the elf, everything works fine. the program start at  my entry point 0x20. 

    That is the reason I am thinking entry point is not an issue. below is an running examle, it successfully triggered entry point. 





    However, if we want to boot from sbl, the  entrypoint must be 0, right?  I will discuss with adacore team. Thanks. 

  • However, if we want to boot from sbl, the  entrypoint must be 0, right?

    That is correct. The SDK only supports booting from TCM in which case the exception table must always be placed at 0x0.

    Please refer to the following snap from the TRM chapter 6.2.3.11 R5FSS Boot Options

    Regards,

    Prashant

  • Hi, Prashant:

    Thanks for pointing me out. exactly, after I modify the linker script and change the start to 0, it can boot correctly.