Skip to main content
matheuscaltran
Associate II
September 24, 2023
Solved

HAL_CAN_GetTxMailboxesFreeLevel does not work with debug

hi, I'm using a discovery stm32f429 together with the STM32CubeIDE

I would like to know why when I use while to wait for the mailbox:

while (HAL_CAN_GetTxMailboxesFreeLevel(&hcan1) != 3)
{
// Wait until all transmission buffers are free
}

the debug does not work and gives an error:

Failed to assign value 8000c69, to register 0
Failed to assign value 20000028, to register 0
Failed to assign value 2002fff8, to register 0
Failed to assign value 80011d4, to register 0

If I use the command HAL_CAN_GetTxMailboxesFreeLevel it works normally or if I use RUN it works normally on the board, but I would like it to work in debug to see some information through the STM32CubeIDE

This topic has been closed for replies.
SRedd.5
SRedd.5Best answer
Senior III
September 26, 2023

My understanding is you can have a global variable in expression not a function. 

4 replies

SRedd.5
Senior III
September 24, 2023

My understanding is when in debug mode some of the features like CAN may not work as the timing of the CAN protocol may expire.

matheuscaltran
Associate II
September 25, 2023

Thanks for the answer. From the test I did, if I run the debug run(Resume) and put HAL_CAN_GetTxMailboxesFreeLevel in the live expression it gives this error

Screenshot_2.png

If I remove it from live expression to run (Resume) it works normally

Screenshot_3.png

Why does this happen is it a bug?

 

SRedd.5
SRedd.5Best answer
Senior III
September 26, 2023

My understanding is you can have a global variable in expression not a function. 

matheuscaltran
Associate II
September 26, 2023

It seems like that's right, create a global variable being the function and it didn't give that error when reading the expression

matheuscaltran_0-1695760579366.png