Skip to main content

Timeline for IDLE flag problem with uart?

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Jun 21, 2021 at 6:05 comment added Jeroen3 @StainlessSteelRat is correct that using prints in an interrupt is a problem since the stdio stream driver should be thread safe. Which it isn't by default for stm32.
Jun 21, 2021 at 5:59 history edited mathco CC BY-SA 4.0
added 554 characters in body
Jun 18, 2021 at 18:21 answer added Marko Buršič timeline score: 0
Jun 18, 2021 at 17:37 comment added StainlessSteelRat Depends upon the function. Any printf is a pig and is part of OP's problem.
Jun 18, 2021 at 17:28 comment added Justme @StainlessSteelRat Are you serious about what you said? Calling functions from ISR is fine. The STM32 HAL already does that. It's a STM32 so on ISR the registers are pushed to stack by hardware for ISR context anyway, there is no penalty any more than for a regular function call. Besides the STM32 could have like 1 megabyte of RAM, so it's not a problem, not even on a 8 kilobyte STM32. What's not right is to call a heavy function like printf in ISR, and most likely it is not re-entrant so those are the largest issues.
Jun 18, 2021 at 17:18 comment added StainlessSteelRat Never do function calls from ISRs! You just pushed all registers used in ISR and now you do it again. The printf increases registers used and latency from function in ISR is wasteful. Set your flag. In your software, check flag, process it and print message.
Jun 18, 2021 at 15:36 answer added Ocanath timeline score: 1
Jun 18, 2021 at 14:55 history edited mathco CC BY-SA 4.0
added 236 characters in body
Jun 18, 2021 at 14:34 answer added Justme timeline score: 2
Jun 18, 2021 at 14:28 history asked mathco CC BY-SA 4.0