I would like to know how can I make the HAL_Delay function work. I configure the System CLock with CubeMX, when I compile the prog there is no errors but my program loops in the HAL_Delay function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-05 7:09 AM
How to test only the HAL_Delay (...).
Thank you for your helps
Regards
- Labels:
-
DEBUG
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-05 7:16 AM
Check the operation of SysTick_Handler() using the debugger. Make sure it fires correctly. If not - check what you did wrong (disabled all interrupts, misconfigured SysTick).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-05 9:22 PM
Well if I had to guess, you're probably calling HAL_Delay from an interrupt, which will not work.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 1:29 AM
Hi,
I don't know if I use with interrupt this function HAL_Delay but It's the summary of my configuration
On the other hand, I can see the SysTick of my configuration is not configured
yet my Clock is configured, I probably missed a step. Do you know if I can find information how to activate SysTick ?
I think when you configure when you configure the Clock the SysTic is automatically configured.
Thank you for your advices
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 5:16 AM
Hi,
After some changes, now I think my I2C does not work correctly. In this prototype :
The HAL_I2C_Master_Transmit return an error, probably for the same reasons. Do you know where I can find examples with I2C ?
Thank you for your helps.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 5:39 AM
It could mean that the I2C slave address is invalid or a physical connection issue. You should see what the txResponse value is. Is that where the HAL_Delay is stuck? And why is a 1ms delay needed in that write function?
Also, your write function is a void and you are trying to return HAL_ERROR. The compiler should have gave you a warning about that..
You can find examples in your repository
C:\Users\<user name>\STM32Cube\Repository
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 5:48 AM
Hi,
Thank you, yes I have a number of error is 1, but what does that mean ? I don't know.
Yes I have a warning but I don't know how to return a value. For the hardware (wiring and component address, all is correct). I think it comes from the Clock or SysTick. In fact the I2C need theses parameters.
I'll look at the example you gave me.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 7:14 AM
Hi,
After browsing the directory I couldn't find the I2C example with my evaluation board.
Probably I have to look elsewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-06 9:32 AM
You can use the Nucleo example. It is the same Microcontroller.
C:\Users\<suer name>\STM32Cube\Repository\STM32Cube_FW_L5_V1.5.0\Projects\NUCLEO-L552ZE-Q\Examples\I2C
Also, i'm not sure what I2C device you're trying to write to but if it's a 16 bit register then you're not writing the value to your buff array correctly.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-08 11:48 PM
Hi,
I can see sevaral example but I don't know which file corresponds to my evaluation card ?
Probably I2C_TwoBoards_ComPolling may suit my needs ?
Thank you
