TX_WAIT_FOREVER doesn't in debug
I have a board design using STM32H743.
I am using:
STM32CubeIDE
Version: 1.13.2
Build: 18220_20230914_1601 (UTC)
running on:
OS Name Microsoft Windows 10 Enterprise
Version 10.0.19045 Build 19045
System Type x64-based PC
I am debugging an implementation of Azure RTOS based on Azure-H7 rev 3.1.0
In my code I have a thread that provides a debug port (UART) and waits for user input (Rx) as well as outputs information provided wherever there is need to update status (Tx). In the portion of the code that waits for user input, I have a semaphore that is set by the competition of HAL_UART_RxCpltCallback that sets the semaphore after which there is a routine that parses the user input. Since this is an ongoing process that never stops , it sits in a while(1) loop.
the code looks like this:
while (1)
{
tx_semaphore_get(&DebugInput, TX_WAIT_FOREVER);
cnt += 1;
//parse command
memcpy(input_string, DebugBuffer, sizeof(input_string));
}
I put the counter in the code to test if the memcpy() call gets called more than the number of times user input is given.
If I place a break point at the memcpy() call the execution falls to the break point without any user input. This mean that the TX_WAIT_FOEVER did not work. I also break point the callback in case there is an actual put on the semaphore and it never breaks. Also, when the code breaks immediately after the tx semaphore get, the threadX window does not indicate that the semaphore was ever put (count=0).
you will notice that I do not receive or keep that status from the tx_semaphore_get call. If I capture the status like this:
while (1)
{
status = tx_semaphore_get(&DebugInput, TX_WAIT_FOREVER);
cnt += 1;
//parse command
memcpy(input_string, DebugBuffer, sizeof(input_string));
}
then the break point at cnt += 1 is never hit with no user input.
Sounds like a debugger problem.
