2023-06-06
10:35 PM
- last edited on
2023-06-27
06:41 AM
by
Laurids_PETERSE
Hi;
I am using STM32U585ZIT6Q controller in my current project. I am enabled Trust Zone option.
I have configured ADC 1 (4 channel) in non secure with GPDMA.I am not able to read ADC data. I have attached all configuration. I have used HCLK(160MHz) for ADC.
if i got working example then it will more helpful.
Please help me for same.
Solved! Go to Solution.
2023-06-12 07:56 AM - edited 2023-11-20 03:48 AM
Here attached my previous project with ADC1 in non secure context (NS) and in 12bit resolution.
I also added ADC1 channel computation en mV for VREFINT, VBAT and Degree Celsius for TempSensor.
I do not implemented ADC4, it's up to you for its implementation where you want.
As explained before, I just changed ADC1 secure context as following.
Good luck.
Romain,
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.
2023-06-06 11:39 PM
Hi @JShah.7 (Community Member)
According Datasheet DS13086 Rev 7 the Table 104. 14-bit ADC1 characteristics indicates the max ADC1 frequency is 55MHz. You must increase ADC clock prescaler input.
Check also you enabled internal VDDA switch before using ADC1 with:
HAL_PWREx_EnableVddA();
Let me know if it helps?
Regards,
romain,
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.
2023-06-07 12:18 AM
Hi @RomainR.
Thanks for suggestion. As per your suggestion i use HAL_PWREx_EnableVddA(); function and 16MHz(HSI) clock but still result is same.
2023-06-07 12:24 AM
Is it a custom board?
Are you able to have ADC1 conversion working in these conditions:
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.
2023-06-07 12:31 AM
Yes,
I have tested with STM32U575ZIT6Q and it is working in both condition. Also it is working with GPDMA. But if i enable TZ it is not working.
2023-06-07 01:03 AM
In your case, TZ security is active. so, ADC Peripheral, SRAM memory for GPDMA transfer and GPIO are either securable or TrustZone-aware.
In this case you must use Global TrustZone controller (GTZC) to configure your application in secure mode.
Refer to AN5347 - Rev 6 chapter 4 and 11.
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.
2023-06-07 03:05 AM
Hi,
I have configured GTZC but still result is same. Can you please share me example code for ADC with Trustzone enable?
2023-06-07 04:34 AM
Sorry, example your are requesting is actually not available.
But, share your project, I will check your ADC1, GPDMA channel linked-list and GTZC configuration.
regards,
romain,
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.
2023-06-07 10:01 PM
Shared. Please check message.
2023-06-08 05:29 AM - edited 2023-11-20 03:47 AM
Hello @RomainR.
Thanks for your support.
Here I have a query regarding supported peripherals for the secure firmware.
Is secure firmware support ADC or not?
Thanks,
Chintan Patel