Skip to contentSkip to conversation

arm: Simple delay function because of an chicken and egg problem

DISCUSSION Johannes (krjdev) Krottmayer 1 participant 1 message Mar 2, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

I'm running into an chicken and egg problem when modifying (fixing) some drivers for STMicroelectronics SoC's.

The problem, I will implement a timeout, when accessing some registers. Unfortunately I cannot use the basic mdelay() or higher level functions, which use this function, because there on these SoC's there isn't setup and enabled the timer before. Also the ARMv7-M SysTick timer will not be used.

I could write a simple delay loop which counts down at the frequency from the processor speed. But I think, this is not a good idea.

Any suggestion, what I can do? I'm still new in U-Boot, so I don't know if there a simple delay function exists.

Thanks in advance!

Johannes K.