1
\$\begingroup\$

After putting data into STM32 USART register DR, data is being transfered and interrupt occurs(TXE,TXC). NVIC jumps into my IrqHandler code. How to set this same interrupt by software(and run IrqHandler), without inserting data into DR.

I have software CTS/RTS handling in my IrqHandler. I would like to have all tranmission management inside interrupt routine. Send function will be only used to prepare SendBuffer and byteIndex for transmission.

\$\endgroup\$
  • \$\begingroup\$ Just call IrqHandler... \$\endgroup\$ – Eugene Sh. Jan 31 '17 at 17:15
  • \$\begingroup\$ In my opinion calling IrqHandler() could be interrupted by UART hardware calling IrqHandler(). This could lead to unpredictable behaviour. This really could occur in my project because of using RTOS. Context of calling IrqHandler is important for me. I have to think about this, because of other programmers who will use my driver. \$\endgroup\$ – s.paszko Jan 31 '17 at 18:36
3
\$\begingroup\$

You can try using NVIC_SetPendingIRQ() or the software trigger register STIR as in

NVIC->STIR = USART0_IRQn;

Both methods will trigger the vector handler function via NVIC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.