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.

How to configure UART ISR using HWI on BIOS for DM6437

Hiall

I am trying to bring our UART isr using HWI on Bios on DM6437 platform. I configured bios as blew steps:

Step1 : configure in ECM(Event Combiner Manager)

      Modify  “EVENT84 proterpies"

CommentUart0ISR

Function:  _IntISR

Arg: 0x00000000

select unmask event source

setp2: add function “void IntISR( )” in main.c

 

I set some breakpoint and some flag in “void IntISR( )”, but I found that the program didn’t enter the IntISR( ) when the uart received data.

Where the mistake? Could anyone help me? Thanks a lot!

PS. I add my “void IntISR” in dvdskC:\dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\drivers\uart\sample\build\m6437_evm_uart_st_sample.pjt

  • The ECM does not automatically service an interrupt. The ECM is a module designed to allow up to 32 interrupt events to be serviced by a single CPU interrupt; however, this single interrupt must be responsible for determining which interrupt(s) occured and then calling the appropriate interrupt routine(s). But before we discuss how to use the ECM let me ask you a simple question that may make this process much easier:

    Does your system require more than 12 dedicated interrupts?

    If not then you gain nothing by using the ECM and should instead use the dedicated HWI_INT4-15 events. These allow you to directly map events to the CPU without the need to determine which event caused the interrupt. If you do not need more than 12 interrupts pick any of the previously mentioned interrupts and assign it to the proper event (in this case you chose 84 for UARTINT0) and configure the function as you did before. Make sure you also enable the hardware dispatcher as this will take care of any context switching and state saving (and will "play nice" with the scheduler).

    If you do require more than 12 interrupts then the ECM route is the way to go. You will then need to configure one of the HWI_INTn events to map to the EVT2 source because EVT2 covers events 64-95 in the ECM. You will then need to write an ISR that determines which event(s) sourced the interrupt(s) and take the appropriate action from there. Let me know if this is what you need and we can discuss this route further.

  • Thanks for your help very much!

    In fact,my system does't need more than 12 dedicated interrupts. my system is simple, it just has one UART0 interrupt.

    I found that the interrupt configure are different between DM642 and DM6437,  i don't kown how to map it.

    But i found the answer from your eariler post ---"Interrupts", which disscussed with Jason Zutty .

    i learned from the sample and my UART0 ISR work well now,thanks very much!!

    Best regards,

    Yongquan Chen

  • I am very glad to hear that you got your interrupt working.

    Yongquan Chen said:
    I found that the interrupt configure are different between DM642 and DM6437,  i don't kown how to map it.
    As far as interrupt mapping goes you can see each interrupt event number inside the DM6437 datasheet on page 200 (section 6.8). You can map any of these system events to one of the 12 dedicated CPU interrupts based on the number in that chart. I think you already knew that part as you knew that UARTINT0 was 84, but maybe this will help anyway.