This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS: There is a question of C2000 RTOS HWI's configuration that in non BOIS



Tool/software: TI-RTOS

hi:

I don't understant HWI setting in non_Bois .

first I read study paper :

as show , I don't understand " 0x10 is INT5"     ,     what is INT5?

then when I imported project of ti sample about non_BOIS HWI's configurations :

why is 67 ,0x10, 5,0x0008 ?

can someone explant it ?

best regard

hunk

  • Hi Yanzhen,

    Please refer to the TMS320F2803x Piccolo System Control and Interrupts Reference Guide. You'll find the following table

    So the interrupt is in group 5. 

    Hwi_plug takes the interrupt number.

    Hwi_enableIER takes the group number mask. The group number is 5, so the set the fifth bit which is 0x10.

    Hwi_enablePIEIER takes the group number and pie mask. So 5 and 0x8 (setting the fourth bit since it is the fourth one in group 5).

    You might want to reference this page also: 

    Todd

  • thanks Todd!
    I got it !
  • hi Todd:
    As you said , INT5.4 has no course in it . so

    //plug non-BIOS managed interrupt (67, Group 5) into the vector table and enable it
    Hwi_plug(67, (Hwi_PlugFuncPtr)isr_nonBIOS); //plug 67 into vector table (group 5)
    Hwi_enableIER(0x10); //enable INT5 (group 5)
    Hwi_enablePIEIER(5,0x0008);

    void interrupt isr_nonBIOS()
    {
    nonbios_isr_end = Timestamp_get32(); // get snapshot of timer
    //asm(" NOP");
    // PieCtrlRegs.PIEACK.bit.ACK3 = 1; // Acknowledge interrupt to PIE or...
    // PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }
    this interrupt isr can not run! right?
    best regard
    hunk
  • I see two things wrong here:

    1) Hwi_plug() should reference interrupt number 5 as that is the core interrupt that PIE interrupt 67 lands on.
    2) As this is a non BIOS managed ISR, you should NOT call any BIOS APIs from within it (ie Timestamp_get32()).

    Alan
  • hi Alan

    thank you.

    something here I don' t understand:

    1) Hwi_plug(67, (Hwi_PlugFuncPtr)isr_nonBIOS); //plug 67 into vector table (group 5)   ,     this "67"       is wrong?

    2) vetor table(group5) just have QEP ,    there are nothing in 5.4 .      that  means  , there is no trigger in it .   how can interruption ?

    3) You know this example is nonBIOS ,but use BIOS APIs .  (ie Hwi_plug())   ," zero latency" is use BIOS manage .  

    this program from TI.  but can not run into interrup I tried. C28x_Hwi_Benchmarks.zip

    please have a look.

    best regard

    hunk

  • After reviewing the example more carefully, I realized that I was mistaken regarding 67 being a bad argument to Hwi_plug(). This should be ok.

    Also, simply calling Timestamp_get32() from a non-BIOS-managed ISR is ok because Timestamp_get32() doesn't interact with any BIOS critical data structures.

    I don't see any obvious reason why the benchmark example doesn't run. As I have no access to the board you're running on I can't easily recreate the problem at the moment.

    Perhaps the particular PIE interrupt used by the example is not vacant on your device and is therefore causing an issue. Are you saying the application never gets to isr_nonBIOS()? Or does it go there once and never again? Or perhaps it keeps returning there infinitely? If that is the case, you might try un-commenting lines 171 and 172 to see if the PIE controller needs proper servicing for this non-vacant interrupt.

    Alan
  • hi I DO un-commenting lines 171 and 172 ,BUT nothing happened !
    I Mean , there is a resver in INT5.4 . so nothing will happen. but why exaple use INT5.4 ? confuse....
  • hi Alan:
    As you said :

    void interrupt isr_nonBIOS()
    {
    nonbios_isr_end = Timestamp_get32(); // get snapshot of timer
    asm(" NOP");
    PieCtrlRegs.PIEACK.bit.ACK3 = 1; // Acknowledge interrupt to PIE or...
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }

    It Can one time interrupt . but next time nothing happen!
  • If my understanding of the application is correct, that interrupt is only posted once:

    Void taskFxn(UArg a0, UArg a1)
    {
    
    	t0 =  Timestamp_get32();							// determine Timestamp overhead
    	t1 =  Timestamp_get32();
    	timestamp_overhead = t1 - t0;
    
    	bios_isr_start = Timestamp_get32();					// start BIOS-managed interrupt snapshot
    	Hwi_post(38);										// post BIOS-managed INT (38)
    
    	nonbios_isr_start = Timestamp_get32();				// start non-BIOS-managed interrupt snapshot
    	Hwi_post(67);  									 // post non-BIOS-managed INT (67)
    
    	// Calculate interrupt latencies
    	bios_int_latency =  bios_isr_end -  bios_isr_start -  timestamp_overhead;
    	nonbios_int_latency = nonbios_isr_end - nonbios_isr_start - timestamp_overhead;
    
    	// print results to Console screen
    	System_printf("TIMESTAMP FXN OVERHEAD = [%u] CYCLES\n", timestamp_overhead);
    	System_printf("C28x BIOS Interrupt Latency = [%u] CYCLES\n", bios_int_latency);
    	System_printf("C28x Zero Latency Interrupt Latency = [%u] CYCLES\n", nonbios_int_latency);
    	System_flush();
    
    	// falls into Idle loop here - forever.
    }
    

    So, I'm not sure what the problem is.

    Alan

  • thank you Alan. I think I have understood