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.

CCS/CC2650MODA: FreeRTOS mq_send hangs inside ISR?

Part Number: CC2650MODA
Other Parts Discussed in Thread: BLE-STACK

Tool/software: Code Composer Studio

I'm reading the ADC using DMA; in my DMA_Complete ISR, I make a decision to send an alert to a BLE Subscribed message.

That freezes on the SNP_RPC_sendNotifInd call so I'm thinking I've gone too deep (I wanted to reorganize the code anyway to split the functionality cleanly -- ISR detects the "go tone" BLE sends the "Turn on light").

So, I changed it so my ISR does a mq_send(apQueueSend, &NotifyMessage, sizeof(NotifyMessage),1) -- I looked and the mqueue.c actually checks and calls the FromISR  version, so I thought I'd be OK...but I'm not -- it freezes inside xQueueGenericSendFromISR on portASSERT_IF_INTERRUPT_PRIORITY_INVALID()...

So... now what?

I thought that was "the best way" to decouple the BLE code from the ISRs... did I miss a setup phase somewhere (do I need to put a "I'm in an ISR" statement at the beginning of the ISR?
My decl for the ISR is:

void DMA_INT1_IRQHandler(void)

after modifying the FreeRTOS startup_msp432_gcc.c code to be similar to C:\ti\simplelink_msp432p4_sdk_3_30_00_13\examples\nortos\MSP_EXP432P401R\demos\boostxl_edumkii_microphonefft_msp432p401r:

extern void DMA_INT1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
  ...


void (* const interruptVectors[])(void) __attribute__ ((section (".intvecs"))) =

{
(void (*)(void))((uint32_t)&_stack_end), /* The initial stack pointer */
resetISR, /* The reset handler */
NMI_Handler, /* The NMI handler */
HardFault_Handler, /* The hard fault handler */
MemManage_Handler, /* The MPU fault handler */
BusFault_Handler, /* The bus fault handler */
UsageFault_Handler, /* The usage fault handler */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
SVC_Handler, /* SVCall handler */
DebugMon_Handler, /* Debug monitor handler */
0, /* Reserved */
PendSV_Handler, /* The PendSV handler */
SysTick_Handler, /* The SysTick handler */
PSS_IRQHandler, /* PSS Interrupt */
CS_IRQHandler, /* CS Interrupt */
PCM_IRQHandler, /* PCM Interrupt */
WDT_A_IRQHandler, /* WDT_A Interrupt */
FPU_IRQHandler, /* FPU Interrupt */
FLCTL_IRQHandler, /* Flash Controller Interrupt*/
COMP_E0_IRQHandler, /* COMP_E0 Interrupt */
COMP_E1_IRQHandler, /* COMP_E1 Interrupt */
TA0_0_IRQHandler, /* TA0_0 Interrupt */
TA0_N_IRQHandler, /* TA0_N Interrupt */
TA1_0_IRQHandler, /* TA1_0 Interrupt */
TA1_N_IRQHandler, /* TA1_N Interrupt */
TA2_0_IRQHandler, /* TA2_0 Interrupt */
TA2_N_IRQHandler, /* TA2_N Interrupt */
TA3_0_IRQHandler, /* TA3_0 Interrupt */
TA3_N_IRQHandler, /* TA3_N Interrupt */
EUSCIA0_IRQHandler, /* EUSCIA0 Interrupt */
EUSCIA1_IRQHandler, /* EUSCIA1 Interrupt */
EUSCIA2_IRQHandler, /* EUSCIA2 Interrupt */
EUSCIA3_IRQHandler, /* EUSCIA3 Interrupt */
EUSCIB0_IRQHandler, /* EUSCIB0 Interrupt */
EUSCIB1_IRQHandler, /* EUSCIB1 Interrupt */
EUSCIB2_IRQHandler, /* EUSCIB2 Interrupt */
EUSCIB3_IRQHandler, /* EUSCIB3 Interrupt */
ADC14_IRQHandler, /* ADC14 Interrupt */
T32_INT1_IRQHandler, /* T32_INT1 Interrupt */
T32_INT2_IRQHandler, /* T32_INT2 Interrupt */
T32_INTC_IRQHandler, /* T32_INTC Interrupt */
AES256_IRQHandler, /* AES256 Interrupt */
RTC_C_IRQHandler, /* RTC_C Interrupt */
DMA_ERR_IRQHandler, /* DMA_ERR Interrupt */
DMA_INT3_IRQHandler, /* DMA_INT3 Interrupt */
DMA_INT2_IRQHandler, /* DMA_INT2 Interrupt */
DMA_INT1_IRQHandler, /* DMA_INT1 Interrupt */
DMA_INT0_IRQHandler, /* DMA_INT0 Interrupt */
PORT1_IRQHandler, /* Port1 Interrupt */
PORT2_IRQHandler, /* Port2 Interrupt */
PORT3_IRQHandler, /* Port3 Interrupt */
PORT4_IRQHandler, /* Port4 Interrupt */
PORT5_IRQHandler, /* Port5 Interrupt */
PORT6_IRQHandler /* Port6 Interrupt */
};

  • Hi Thor,

    Are you trying to use one compiler to do all of this or did you reorganize a part of the project into a library?

    In general the BLE-Stack always expects to be the highest priority task running, so if you are interrupting it it may lead to unexpected behavior.