ΣSigmaStudio Ask AI Русский Log in

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

Processors & DSP fabces Aug 5, 2019 00:00 9 replies Original on forum ↗
Subscribe
fabces Question
Aug 5, 2019 00:00

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

Audio Signal Processors

adi_rom_boot

adsp-sc57x

ADSP-SC572

SHARC Audio Processors/SoCs

ADIApproved Reply
Aug 9, 2019 00:00

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

fabces Reply
Aug 12, 2019 00:00

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

ADIApproved Reply
Aug 13, 2019 00:00

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

CLDPboot.zip201.7 KB
fabces Reply
Aug 13, 2019 00:00

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

1_buildArtifact.png
1_buildArtifact.png
2_setBootMode.png
2_setBootMode.png
ADIApproved Reply
Aug 19, 2019 00:00

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

feng123x Reply
Mar 4, 2020 00:00

Hi LalithaS,

I verified the example you provided on the adsp-sc573 ez-kit.Able to start the application as normal.

But our product uses adsp-21573. I ported the code in SC573_SSL to the project of adsp-21573.Unable to jump normally.

Can you provide SSL project for adsp-21573?

Best,

Kevin

ADIApproved Reply
Mar 19, 2020 00:00

Hi Kevin,

This query is already handled via the below Thread. To avoid duplication, I would suggest you to continue the discussion there.
ez.analog.com/.../adsp-21573-second-stage-bootloader

Regards,
Anand Selvaraj.

hisham Reply
Feb 7, 2025 00:00

Hi Lalitha,

So I tried the example SSL provided by you. I compiled it and created an ldr file and when I try to flash it via cldp after successful flashing my Development board goes into a fault state, and the fault LED lights up. But at the same time when I use the ldr file provided by you in the following reply, it works fine. Bootloader as well as the LED blinking example.

Was the ldr file you provided generated from the same source code example, or am I missing something. A help would be much appreciated

Regards,

Hisham

NandiniC Reply
Feb 11, 2025 00:00

Hi Hisham,

Based on this case (ez.analog.com/.../write-into-flash-with-regard-to-ota-update ), it seems that you've made progress with SSL booting. Are you still encountering the issue? If so, please create a new thread with your requirements. We also noticed you've posted questions about SSL booting in several threads. To avoid duplication of efforts, it would be really helpful if you could consolidate your requirements into a new thread.

Regards,
Nandini.C