Post Go back to editing

help with slave boot operation on SC598 SOM

Category: Software

Hi,

I have the SC598 SOM board and i have set it in SPI SLAVE BOOT mode and am trying to send it the contents of the .ldr file i have created via an external master processor.

I have tested to see if the program works first in the debugger and also sent it via the flash loader to the onboard FLASH. it all works fine.


but i understand that the elfloader must be configured differently for SPI SLAVE.
This is my configuration.

Question:
Do i need another option for blocks of zeros ?

"C:\analog\cces\3.0.0\elfloader.exe" -proc ADSP-SC598 -core0=SS_uC_App_Core0 -core1=SS_uC_App_Core1.dxe -core2=SS_uC_App_Core2.dxe -NoFinalTag=SS_uC_App_Core0 -NoFinalTag=SS_uC_App_Core1.dxe -b SPISLAVE -f BINARY -Width 8 -verbose -o SPIFlash_MultiCore.ldr


i have the documents EE447V01 which describes what the default signals and pins for the ADSP-SC59x (Table 1)

Question:
is this correct as there i cannot find anything in the hardware reference manual about the default settings in slave boot mode.

Question:
do i configure my SPI master data LSB or MSB, clock speed etc ?


on page 47-26 of the hardware reference manual
it states

"The SPI slave processor detects the correct boot mode from the host SPI device by reading the first byte sent, defined as SPICMD. The SPICMD Descriptions table describes the available codes. These additional bytes must be
sent prior to transmitting the data to configure the SPI device"

Question:
is this command sent with and individual CS operation or part of a block of 1024 bytes of data ?

In the diagram 47-8 it doesn't show this operation in the first flow chart. So is this always necessary to send the command byte ?

sorry for all the questions but i cannot find a complete explanation of how to achieve a slave boot operation.
I have found many forum posts about other DSPs but i don't know if these are relevant to SC598.

Many thanks for any help



question removed
[edited by: Beaker at 5:00 PM (GMT -4) on 13 May 2024]

Thread Notes

  • Hi, You can find the command for loader file generation and Flash the loader file in below link, 
    Loader File Generation [Analog Devices Wiki]

    The Flash command and driver files can be found in SigmaStudio+ installation folder "C:\Analog Devices\SigmaStudioPlus-Rel2.2.0\Target\Utilities\FlashProgrammer"

  • Thankyou Sakthivel P for the information about the loader file generation and flash programmer.

    For my application i will be setting the DSP in slave mode and loading the application via an external micro configured as an SPI master.

    I've been trying to get it to work

    I have tried sending 0x03 at the start before sending the ldr file and padding the data so 1024 bytes are always sent but i cannot get it to work.  I am wondering if i'm missing something that i have to do before sending ldr file or after it to start the DSP running my application.

    I have connected the SPI master to SPI2 on the SC598 board and using only single MOSI. I have the pull up and pull down resistors as shown in the diagram 47-7 in sc598 hardware ref manual.  The SPI is configured as CPHA = 1 and CPOL = 0 as specified.  I have the SPI_RDY pin monitored as per the flow chart in 47-8 but the first flow chart doesn't show SPICMD.  

    Am i missing something else to do after i put the processor in SPI SLAVE BOOT mode and resetting it ?

    do you have example code for a host application to send ldr file ?

    thanks for any help.

  • Hi Alan,

    To understand more about SPI slave boot, please refer the attached host code example for ADSP-21569 processor in the FAQ link below, which also has its boot application's ldr file. Please note that the boot switch for SPI slave boot mode differs to each processor so refer the ADSP-SC598 processor datasheet to know respective boot mode.
    https://ez.analog.com/dsp/sharc-processors/adsp-2156x/w/documents/17306/adsp-21569-spi-host-example 

    Regarding your queries:

    Question:
    "but i understand that the elfloader must be configured differently for SPI SLAVE.
    C:\analog\cces\3.0.0\elfloader.exe -proc ADSP-SC598 -core0=SS_uC_App_Core0 -core1=SS_uC_App_Core1.dxe -core2=SS_uC_App_Core2.dxe -NoFinalTag=SS_uC_App_Core0 -NoFinalTag=SS_uC_App_Core1.dxe -b SPISLAVE -f BINARY -Width 8 -verbose -o SPIFlash_MultiCore.ldr"
    >> For SPI slave booting can you please try with the Boot format as 'Include' format, so that the loader stream can be stored to a buffer array easily at the Host side.

    Question:
    "is this correct as there i cannot find anything in the hardware reference manual about the default settings in slave boot mode?"
    >> The pin mux details are available in the datasheet "Table:11", link provided below:
    https://www.analog.com/media/en/technical-documentation/data-sheets/adsp-sc596-adsp-sc598.pdf

    Question:
    "is this command sent with and individual CS operation or part of a block of 1024 bytes of data ?
    In the diagram 47-8 it doesn't show this operation in the first flow chart. So is this always necessary to send the command byte ?"
    >> There are some typos in the flow diagram available in the HRM document, which will be modified correctly in the next updates.
    For SPICMD, send 0x3 to keep single bit mode and then start sending the LDR in chunk of 1024 bytes. Before sending firmware, you need to send the SPICMD that is not part of the generated ldr.

    For more clarity regarding SPI slave booting, you can also refer to the thread link below to give you more insights on this.
    https://ez.analog.com/dsp/sharc-processors/adsp-sc5xxadsp-215xx/f/q-a/534422/adsp21569-spi-slave-boot 

    Regards,
    Ranjitha.R

  • Thank you so much for the information Ranji

    I managed to get it working now. Here is what i have done if this helps anyone else.

    how to generate .ldr file which contains the config data used by SPI MASTER(STM32) to talk to SPI SLAVE (SHARC)

    and send  it to SHARC dsp when it is set to SPI SLAVE boot mode.

    example

    1.
    create example project - LED_Blink_SC598_Cortex_Core0

    2.
    remove all printf statements as this causes SHARC to crash and build the project.
    run in debug mode to test it works.
    ez.analog.com/.../sc589-burnt-loader-file-doesn-t-run


    3.
    create a new folder put the files

    LED_Blink_SC598_Cortex_Core0
    which is located in
    ....examples\evsc59x_ez_kit_3.0.0\LED_Blink SC598 (Cortex)\EV-SOMCRR\SC598\arm\LED_Blink_SC598_Cortex_Core0\Debug

    create a .bat file with the following in it.

    "C:\analog\cces\3.0.0\elfloader.exe" -proc ADSP-SC598 -core0=LED_Blink_SC598_Cortex_Core0 -init "C:\analog\cces\3.0.0\SHARC\ldr\ezkitSC598W_initcode_core0" -b SPISLAVE -f INCLUDE -Width 8 -verbose -o LED_Blink_SC598.ldr


    4.
    run the bat file.
    this will create a file called 'LED_Blink_SC598.ldr'
    because of the INCLUDE option in the elfloader.exe options it will create a text file with the config data separated by commas
    so it can be used in an array in the SPI MASTER bootloader program.

    5.

    www.analog.com/.../ev-somcrr-brkout.html

    connections from external processor to SHARC breakout board

    STM32 FUNC pin breakout board (ev-somcrr-brkout) connection

    GND                                        make sure connect a few ground links from master to breakout board.

    GPIO pull down                      SCK                             PA_04                 P3_6
                                                   MISO                           PA_00                  P3_2
                                                   MOSI                           PA_01                  P3_3
    GPIO pull up                           _CS                            PA_05                  P3_7
    GPIO pull up                          SPI_RDY                     PB_05                  P4_6 (it is labelled as P4_15 but this is wrong label. use SPI0_SEL2B as this is PB_05)
                                                  RESET_CNTRL           SYS_HWRSTB    P6_47


    on the RESET_CNTRL set the STM32 GPIO to open drain.


    6.
    configuration of SPI MASTER (STM32)

    CPOL = 0
    CPHA = 1(second edge)
    MSB first
    i have it running at 3MHz but maybe able to run a lot quicker


    SYS_HWRST = LOW
    wait 10mS
    SYS_HWRST = HIGH
    wait 100mS


    if SPI_RDY = LOW then proceed else wait for SPI_RDY to be low.

    CS = LOW
    send SPICMD (0x03)
    CS = HIGH

    wait 1mS

    CS = LOW

    if SPI_RDY = LOW then send next byte of the config else wait for SPI_RDY to be low.

    when finished sending ALL data.
    CS = HIGH

    device will run the application when it is loaded. NO padding of data required to fit in 1024 byte buffers.

    some links for more information
    ---------------------------------

    ez.analog.com/.../help-with-slave-boot-operation-on-sc598-som
    ez.analog.com/.../adsp-21569-spi-host-example
    ez.analog.com/.../adzs-21569-ezkit-spi-slave-boot

    i couldn't see how to create SPI SLAVE option using explaination in link below so thats why had to create .bat file to do it.
    ez.analog.com/.../how-to-load-and-run-a-program-from-flash-on-adsp-sc5xx-target-board-using-crosscore-embedded-studio

  • Hi Alan,

    Thank you and from your comments above we assume that your issue has been resolved.
    Do you need any further assistance on this?

    Regards,
    Ranjitha.R

  • Hi Ranji,

    Yes, the issue has been resolved and don't need any further assistance with this issue. Many thanks for your help