Post Go back to editing

SC598 interrupt handling on SHARC core 2

Category: Hardware
Product Number: SC598 interrupt handling on SHARC core 2

Currently, I am porting the old SC589 project to SC598 by using the SC598 EZ KIT.

I can attach WDOG1 interrupt to an interrupt routine on SHARC Core 1 without problem.

But, when I attach WDOG2 on the SHARC Core 2, I cannot get the interrupt from the SHARC.

Yes, I checked the WDOG2 registers and IRPTEN in MODE1 register and seems ok.

Any idea of that and how to check further ?

Thanks
Arthur

  • Hi Arthur,

    Regarding “But, when I attach WDOG2 on the SHARC Core 2, I cannot get the interrupt from the SHARC”, we understand that you have used the WDOG2 in SHARC Core 2 and interrupt is not hitting after WDOG expiration.
    Could you please check the WDOG_STAT register which contains the current count value of the watchdog timer. When the count value reaches 0, the watchdog timer stops counting, and the expiry event is generated.

    Did you get a chance to refer the watchdog example available in the BSP package? If not, we suggest you to download “ADSP-SC59x/2159x EZ-KIT Board Support Package” from the below link:
    https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/ev-sc598-som.html

    After installation, Watchdog examples found in the below path:
    < installation path>\EV-SC59x_EZ-KIT-Rel4.0.0\EV-SC59x_EZ-KIT\Examples\services\wd


    Also, ensure that the interrupt ID for WDT2 is properly configured for Core2, you can refer the ADSP-SC596/ADSP-SC598 SHARC+ Processor HRM document for more information, please follow these suggestions and let us know if you need further assistance.

    Regards,
    Nandini C

  • Hi Nandini

    I am using the BSP WD project to test..  Basically, I added extra WatchDog_Callback() in Core2.

    But, I observe the following after I place two breakpoints on callback() for both cores.

    1) The Core1 hit the Callback breakpoint but Core2 does not.

    2) The example seems always reported "Tests Pass" even there is no callback.

    After all, my project need to use both watchdog interrupt on each core simultaneously without breaking the old code.

    Attached is the project I used, hopefully you have chance to check.

    https://drive.google.com/file/d/1SGf6qcq1wkWUxAS7ahDEgEcwp098fzXV/view?usp=sharing

    Thanks

    Arthur

  • Hi Arthur,

    Thank you for sharing the project.

    The example program “Watchdog_Expiry_Reload” checks the functionality of the watchdog timer by the following three tests

    Test 1: Checking the counter and watchdog status immediately after enabling it. They should not have expired at this point.
    Test 2: Resetting the watchdog timer during a Delay() function. The counter and watchdog should not expire after the Delay() has completed.
    Test 3: Not resetting the watchdog timer during a Delay() function. The counter and watchdog should expire after the Delay() has completed and a watchdog timer callback event posted.

    So, only Test3 checks the WDOG expiration event. However, WatchdogTest3 is not being called from main. Could you please invoke WatchdogTest3 from main and share the results with us?

    Regards,
    Nandini C

  • Hi Nandini C

    Just uploaded an enhanced version of example code as above with the prinf() statement.

    Here is the test result:

    Load complete.
    Loading application: "C:\analog\EV-SC59x_EZ-KIT-Rel4.0.0\EV-SC59x_EZ-KIT\Examples\services\wd\Watchdog Expiry Reload\EV-SOMCRR\SC598\sharc\WD_Expiry_Reload_SC598_SHARC_Core2\Debug\WD_Expiry_Reload_SC598_SHARC_Core2.dxe"
    Load complete.
    Core 2 Test 1 PASS
    Core 1 Test 1 PASS
    Core 2 Test 2 PASS
    Core 1 Test 2 PASS
    Core 2 Test 3 FAIL
    Core 1 Test 3 PASS
    Core 1 All Done

    Thanks

    Arthur

  • Hi Arthur,

    From the console output, it appears that Core2 starts execution before Core1. As a result, the adi_sec_Init function on Core2 is invoked first, followed by the adi_sec_Init function on Core1. When Core1 runs its initialization, it clears the SCI control bits, which prevents the interrupt from triggering even though the WDOG has expired.


    To avoid this issue, adi_initComponents must be called on Core1 before it is called on Core2. The following note in adi_sec_Init() also highlights this requirement.


    * This API will reset all the SEC registers the first time it is called from LOWEST_CORE_ID. It is the application's responsibility to make sure that adi_sec_Init is called from LOWEST_CORE_ID.

    * On BF609, the core 0 call must precede any call from another core - it is the application's responsibility to ensure this.

    * On SC5xx/215xx, a call from another core will wait until core 1 has completed its initialization before proceeding.

    We assume you are running the application using the “Application with CrossCore Debugger” option without the ARM core. In this mode, Core2 does not wait for Core1 to complete its initialization as SECINIT is already set. Therefore, we recommend ensuring that adi_initComponents is called on Core1 before it is invoked on Core2.

    Regards,
    Nandini C

  • Hi Nandini C

    Is there an API to detect SHARC Core1 is up and running from SHARC Core 2 ?

    Thanks

    Arthur

  • Hi Arthur,

    Unfortunately, we do not have an API for this. At the end of the adi_sec_Init function, the RCU.MSG_SECINIT bit is set for Core1, and Core2 polls this bit initially so that Core2 waits until Core1 completes the SEC initialization.

    When using the “Application with CrossCore Debugger” option without the ARM, this RCU.MSG_SECINIT bit gets enabled before adi_initComponents is called.

    To avoid this issue, you can either use the “Application with CrossCore Launch Group” option or run the application through the boot flow without the debugger—both approaches will prevent the problem.

    Regards,
    Nandini C

  • Just have a software workaround on this issue.  Thank your for your help.

    Thanks

    Arthur

  • I have the WDOG2 working on Core2 but it willl stop after execute a piece of code.

    It appears that the interrupt is masked.

    Do you have instruction on what registers to check for that ?

    Thanks

    Arthur

  • Hi Arthur,

    As the WDOG does not have a dedicated interrupt mask register, we recommend checking the general SEC interrupt configuration for WDOG2 (Interrupt ID-5) on the SHARC processor.

    To help us better understand the issue, could you please provide more details about the statement, "it will stop after executing a piece of code"? Specifically, please describe the code sequence being executed and the observed behaviour when the issue occurs.

    Regards,
    Nandini C

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.