cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-U575ZI-Q - HAL_GetTick returns 0

CLC_EricF
Associate II

Bonjour,

J'utilise la suite CUBEMX et CUBEIDE  pour créer mon projet à partir d'une carte de développement NUCLEO-U575ZI-Q.
J'ai réalisé mon projet sur CUBEMX en gardant et validant le BSP de la NUCLEO pour utiliser les leds et surtout le debug via ST-LINK embarqué.

J'ai ajouté des IO pour effectuer une maquette avec SPI1 et OCTO-SPI1 plus quelques IO notamment une PWM.

Pour commencer j'ai d'abord réalisé un bout de code pour faire clignoter une led (LED_GREEN); à une certaine fréquence réglée par HAL_Delay.

Le souci est que cette fonction bloque car le Tick ne semble pas être validé, (HAL_GetTick  me retourne toujours 0)...

Je crois pourtant avoir validé les interruptions :

Hello,

I am using the CUBEMX and CUBEIDE suite to create my project based on a NUCLEO-U575ZI-Q development board.
I created my project on CUBEMX, keeping the NUCLEO BSP to use the LEDs and, above all, debugging via the embedded ST-LINK.

I added I/Os to create a model with SPI1 and OCTO-SPI1, and a few I/Os, including a PWM.

To start with, I wrote a piece of code to make a LED (LED_GREEN) flash at a certain frequency set by HAL_Delay.

The problem is that this function blocks because the tick does not seem to be validated (HAL_GetTick always returns 0)...

However, I believe I have validated the interrupts:

Translated with DeepL.com (free version)

CLC_EricF_0-1771519169847.png

Can you help me, je débute dans l'environnement STM32CUBE...
Thanks in advance,

Eric

 

23 REPLIES 23

The default option is SysTick in CubeMx as time base for HAL. It should work as is. No need to select another timer for that.

So please attach your project.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello @mƎALLEm ,

I sent you the project last Friday. Did you not receive it?
I am sending it again just in case.

Thank you again for your help.


Regards,

Eric

Hello,

No I did receive nothing. I will test it by tomorrow as I don't have the board at my hands today.

Thank you for the sharing.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello @CLC_EricF ,

I see in your project you are using security feature: secure and non-secure area.

Just to ensure this is not a security related question. (if it's the case it will be moved to STM32 Security forum board).

Could you please do the same test without activating the security?

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Yes, I created the project based on Nucleo board by activating the Trust Zone because in my final product, firmware updates will be done via USB. So I will put the boot loader in the security zone to identify the encrypted files.
For now, I don't need it, but I admit I don't know how to exit Secure mode... I thought it would be enough to work on the No-Secure part.

Unfortunately, I don't see where to disable Secure mode. Do I have to start from scratch? (Maybe I went too fast for a start?)

Eric 


@CLC_EricF wrote:

Do I have to start from scratch? (Maybe I went too fast for a start?)


Yes I suggest to start a very simple project from scratch. Security is another stuff to treat.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

OK, I understand, but won't it be more difficult to switch to Trust Zone mode later on?
I'll take your advice.

Thank you very mutch

Eric

I'm not a security expert but the idea is at least to validate that HAL_Delay() is working in non secure project. Because I suspect the issue is more related to the TrustZone configuration than to CubeMx or HAL issue.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
CLC_EricF
Associate II

Hello,

So I ran an example (GPIO_Demo.ioc) without touching the .ioc file (just generating the code with CubeMX and compiling and debugging it in CubeIDE).
Naturally, everything works: Get_Tick, HAL_Delay, and EXi interrupts.
Now I'm going to try to compare the two projects (mine in Secure-NoSecure mode) and the demo to try to understand what I'm missing.
I already notice that in the demo's ioc file, neither the NUCLEO board's BSP nor DEBUG are validated in the file, so everything is done by code?

I admit this confuses me a little...

Regards,

Eric

Hello,

Sorry I'm not sure to follow you.

Did you test a simple project without TrustZone or not? if yes what was your finding?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.