ADSP-SC572 Second stage loader won't boot main app with ad-_rom_boot()

Hi,

I made a second stage loader for a custom board with an SC572 chipset, but when I try booting from SPI flash using the adi_rom_boot() function it never works.

I tested that the loader works because when I write to the flash at address 0x00 it boots normally with the OTP bootloader.

I followed the documentation, and this is how I call the function.

 uint32_t boot_address = FLASH_XIP_BASE_ADDR + APP_OFFSET;
 uint32_t boot_cmd = (
        ENUM_ROM_BCMD_SPIM_DEVENUM_2 |
        ENUM_ROM_BCMD_SPIM_DEVICE_SPIXIP |
        ENUM_ROM_BCMD_SPIM_BCODE_D
    );

adi_rom_Boot((void *)boot_address, 0, 0, 0, boot_cmd);

any help would be appreciated, thank you!

Best,

Fabien

Parents
  • 0
    •  Analog Employees 
    on Aug 9, 2019 9:38 AM 11 months ago

    Hi Fabien,

    I've attached two simple projects namely ADSP_SC573_SSL.zip and ADSP_SC573_LED_Blink.zip that can be run directly on ADSP-SC573 EZ-kit. I'm sure that you can easily modify it for ADSP-SC572. The former is the bootloader code that contains adi_rom_boot() function and the latter is a simple LED blink code. The SSL code is flashed onto offset 0x0000 and application code is flashed at an offset of 0x40000. Upon reset, the ADSP_SC573_SSL boots(from 0th sector of flash) after which the ADSP_SC573_LED_Blink application boots.

    Please take this example as a reference and modify as per your requirement.

    Hope this helps!

    Regards,
    Lalitha S

    SC573_SSL.zip

  • Hi Lalitha,

    Thank you for your answer.

    I took your example and modified it for my hardware, and I get a similar issue. This time I generate 2 .ldr files in hex format with a -bcode =13. and when I load them into flash with cldp the one that boots is the always the last one I loaded. could it be a format issue? or am I using cldp wrong? I've attached the project so you can have a look.

    thank you for your help!

    Best,

    Fabien

    ADSP-SC572_SSLtest.zip

  • 0
    •  Analog Employees 
    on Aug 13, 2019 8:50 AM 11 months ago in reply to fabces

    Hi Fabien,

    I have looked into your projects. It seems you have enabled timer with some interrupt handlers in the code. First, we have to make sure the SSL works as expected on your hardware. For this, I would suggest you to have a simple code (with only LED Blinks for boot indication) and check if that works. Later on you could proceed with your application.

    I'm sharing the CLDP commands and loader streams that I've used for flashing the SSL and LED_Blink application. You can take this as a reference.

    Below is the command I used for generating loader streams.

    For LED Blink: -proc ADSP-SC573 -si-revision 0.0 -b spimaster -f binary -width 8 -bcode 1 -core0="<<Core0 File path>>" -NoFinalTag="ADSP_SC573_LED_Blink_Core0" -core1="<<Core1.dxe path>>" -NoFinalTag="ADSP_SC573_LED_Blink_Core1.dxe" -core2="<<Core2.dxe path>>"

    For SSL: -proc ADSP-SC573 -si-revision 0.0 -b spimaster -f binary -width 8 -bcode 1 -init "C:\Analog Devices\CrossCore Embedded Studio 2.8.1\SHARC\ldr\ezkitSC573_initcode_core0" -core0="<<Core0 File path>>" -NoFinalTag="ADSP_SC573_SSL_Core0" -core1="<<Core1.dxe path>>" -NoFinalTag="ADSP_SC573_SSL_Core1.dxe" -core2="<<Core2.dxe path>>

    Please let us know how you get through.

    Regards,
    Lalitha S

    CLDPboot.zip

  • Hi Lalitha S,

    The reason I set up the clock and enabled the timer was to control the led timer delay, otherwise in release I wasn't able to see the led blink without probing it with a scope.

    I generated the boot stream in a similar way except that I did in CCES, I've attached three screen shots to show you how I did it.

    1/ set the build artifact

    2/ select boot mode

    3/ generate the executable

    I did it in the same way for both streams, using the elfloader and not cldp.

    could this issue be related to that?

    thanks again for your help.

    Best

    Fabien

    t

Reply
  • Hi Lalitha S,

    The reason I set up the clock and enabled the timer was to control the led timer delay, otherwise in release I wasn't able to see the led blink without probing it with a scope.

    I generated the boot stream in a similar way except that I did in CCES, I've attached three screen shots to show you how I did it.

    1/ set the build artifact

    2/ select boot mode

    3/ generate the executable

    I did it in the same way for both streams, using the elfloader and not cldp.

    could this issue be related to that?

    thanks again for your help.

    Best

    Fabien

    t

Children
  • 0
    •  Analog Employees 
    on Aug 19, 2019 9:13 AM 10 months ago in reply to fabces

    Hi Fabien,

    Sorry for the delay in getting back. I've looked into your screenshots. Is it possible for you to try with Binary format with bcode 0x01.

    Regarding, "I did it in the same way for both streams, using the elfloader and not cldp. could this issue be related to that?"
    >>I think you are confused. elfloader is for generating loader stream whereas CLDP is used for flashing the loader stream. From your screenshots, I think you are using CCES tool to generate .ldr file and that is fine.

    Is it possible for you to share the commands for generating the loader stream(possibly for both SSL and LED)?

    BTW, I would like to reconfirm that you are able to do normal SPI Master booting(from 0th sector of flash) and you are facing issue with SSL only.

    Regards,
    Lalitha S