cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with thread startup after power cycle on embedded application

LadyMt
Associate III

Hello,

My application is loaded via flash memory. Four threads are created and they seem to be generated correctly because when the board is connected to the computer, all the threads run well. But if I disconnect the power and then turn it back on, the threads no longer run.

Systick is used for ThreadX and TIM6 is used for HAL-Tick.

But the scheduler does not start the threads. I do not understand why. I am new to threads.

Has anyone encountered a similar problem and have solutions to suggest? Please

I am attaching the file app_thread.c

13 REPLIES 13

No - but to receive 1 byte using the DMA is ... rather overshot the target .

If you feel a post has answered your question, please click "Accept as Solution".

@AScha.3 wrote:

No - but to receive 1 byte using the DMA is ... rather overshot the target .


I don't quite understand what you mean by that, can you please explain?

Just imagine how much overhead you generate, to get/read ONE byte : a complex HAL-call for setting up the uart and then the DMA is needed, then on signal from uart the DMA is called and transfers with a 32bit bus 8bit.

Then INT is generated, DMA finished its job, and you get the info: we habe received a byte. wow.

 

If you just let the uart call (you) by an INT, you have the received byte and action  is finished.

If you feel a post has answered your question, please click "Accept as Solution".

DMA should be used with the UART when you want to offload sending and/or receiving multiple bytes of data. When used for receiving, the IDLE interrupt should be enabled -- __HAL_UART_ENABLE_IT(&huart, UART_IT_IDLE) -- and idle timeout handled in the UART interrupt handler.