I’m working on Hexiwear with mikroC compiler. Actually I only try to access low level peripheral individually and then make some libraries to acces them. But I have soon realized that if I want to externally communicate with the device, I need to communicate with the other MCU (MK40) because this one is in charge of BLE and Touch Buttons.
Communication between the 2 MCU is made via UART4 of the MK64. By pooling this UART I was able to intercept and decode some data. It’s clear that BLE will be very hard to use without reprogramming the MK40 but the touch buttons can be easily detected.
But in real life, pooling is not an option. I really need to activate UART4 Rx Interrupt.
I have try many combinations but here is the simplest code To try to get into interrupt.
volatile char U4Rx;
void UART4_RxTx_Int() iv IVT_INT_UART4_RX_TX ics ICS_AUTO
PTC_PDOR.B8 = 0; // Red Led should light up if Interrupt is trigged
U4Rx = UART4_Read();
GPIO_Digital_Output(&PTC_PDOR, _GPIO_PINMASK_8); // Red Led
GPIO_Digital_Output(&PTC_PDOR, _GPIO_PINMASK_9); // Blue Led
GPIO_Digital_Output(&PTD_PDOR, _GPIO_PINMASK_0); // Green led
PTC_PDOR.B8 = 1; // Light Down Red LED
NVIC_IntEnable(IVT_INT_UART4_RX_TX); // UART4 Interrupt
But infortunately the interrupt is never trigged. Any help will be appreciated.