Q1: I want to use the PEC example in BF609 core1, but it doesn't work. What could be the problem? Thank
Please refer the description of Core Target Select bit of Source Control register (SEC_SCTLn.CTG). This bit selects the specific SEC core interface to which the interrupt is mapped.
For an interrupt to be handled by core1, I think, this field should be 1.
I am not sure about how to instruct the driver API's about it. May be someone from driver team may suggest suitable parameter/s to be passed to do this.
In the mean time, can you check if explicitly setting this field (of appropriate SEC0_SCTLn register) in the code can work or not (OR SEC0_SCTLn register with 0x1000000 before installing callback)?
Which PEC example you are referring to? Please provide details about the code it contains. Is it working fine on core0?
I am referenig to the example in this path "CrossCore Embedded Studio 1.0.0\Blackfin\Examples\drivers\pvp\PEC".
The example is on core and it is working fine.
I want to try the same example in core 1. The build is fine. RetVal is equal to SUCCESS; but gNumProcessedFrames is equal to zero.
Is there any configuration to add to get the PVP working from core 1.
Thanks a lot
I suspect the ISR (in which gNumProcessedFrames is incremented) is not called at-all. Have you tried putting breakpoint in that ISR? If it is not hitting the breakpoint, the reason for this can be SEC registers are not being programmed properly. Can you check to what values the SEC0_CCTL1.EN and SEC_SCTLn.CTG bits are programmed to?
I put breakpoint in that ISR but it didn't go to it.
SEC0_CCTL1.EN = 1
SEC0_SCTLn.CTG = 0
The Core Target bit should be set using the SEC service API. By default all the interrupts are mapped to Core 0. This can be altered using the SEC API. This API should be called by the application before opening the respective driver. In your case it is PVP driver. Please note that PVP has several interrupts two for the status interrupts and an interrupt for each of the DMA channels associated with it. All of them should be mapped to core1. The code snippet below shows how to map all the PVP related interrupts to core1.
adi_sec_SetCoreID(INTR_PVP0_STAT0, ADI_SEC_CORE_1); // Status interrupt 0
adi_sec_SetCoreID(INTR_PVP0_STAT1, ADI_SEC_CORE_1); // Status interrupt 1
adi_sec_SetCoreID(INTR_PVP0_CPCI_DMA, ADI_SEC_CORE_1); // Camera pipe config DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_MPCI_DMA, ADI_SEC_CORE_1); // Memory pipe config DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_CPDOB_DMA, ADI_SEC_CORE_1); // Camera pipe data B DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_CPDOC_DMA, ADI_SEC_CORE_1); // Camera pipe data C DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_CPSTAT_DMA, ADI_SEC_CORE_1); // Camera pipe status DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_MPDO_DMA, ADI_SEC_CORE_1); // Memory pipe data out DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_MPDI_DMA, ADI_SEC_CORE_1); // Memory pipe data in DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_MPSTAT_DMA, ADI_SEC_CORE_1); // Memory pipe status DMA interrupt
adi_sec_SetCoreID(INTR_PVP0_CPDOA_DMA, ADI_SEC_CORE_1); // Camera pipe data A DMA interrupt
^_^ I follow this method, and run my ADAS algrithom on core1, thank you very very very much!!
Jihen, please set the Core Target Select field appropriately for Core-1 as shown in the above post.
Another thing, if the code conatains adi_sec_init() function call, then as explained in driver documentation, "It is application responsibility to make sure that adi_sec_Init is called from Core0 first and then from other cores."
So you may have to take care of this point as well.
Retrieving data ...