Hi all, I want to use an interrupt on serial port 1 (/com/0, configure to be UART). So when data will come to the RX pin, we will start a thread that will read the data on the port. When i use this function:
naIsrInstall(SER1RX_INTERRUPT,(NA_ISR_HANDLER)uartISR, NULL);
I got a error that say that the interrupt: BBUS_DMA01_INTERRUPT is already use. So i try to do this:
result = naIsrUninstall(BBUS_DMA01_INTERRUPT);
if(result!=SUCCESS)
{
if(result==NA_INVALID_STATE)
printf(“The ISR handler has not been initialized”);
if(result==NA_INVALID_LEVEL)
printf(“The value of id is invalid or there is no ISR installed for it”);
}
result = naIsrInstall(BBUS_DMA01_INTERRUPT,(NA_ISR_HANDLER)uartISR, NULL);
if(result!=SUCCESS)
{
if(result==NA_INTERRUPT_IN_USE)
printf(“The interrupt level is already in use”);
if(result==NA_INVALID_LEVEL)
printf(“The value of id is invalid”);
I can run the code above with no problem. But farther in my code when i use NASpiReadWrite with port 2 (/com/1, configure to be SPI), the software stop running. It is possible that the fonction NASpiReadWrite with /com/1 use the BBUS_DMA01_INTERRUPT???
You have to configure serial driver as :-
#define BSP_SERIAL_PORT_1 BSP_SERIAL_SPI_DRIVER
in
\workspace\My_Project\bsp\7_X\connectcore9c_a
I just realize i make a mistake in my first message. My port 2 is configurate to be SPI and not /com/1…
if i do what you say a wont be able to use port 1 in uart mode (rs232)