Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added temperature sensor calibration values. #506

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

esden
Copy link
Contributor

@esden esden commented Jul 17, 2024

I am not 100% sure that this is the correct way to add these values. They do straddle the location of the VREFINTCAL. But I also did not want to make them into two separate peripherals.

@embassy-ci
Copy link

embassy-ci bot commented Jul 17, 2024

@Dirbaio
Copy link
Member

Dirbaio commented Jul 18, 2024

it should be fine to overlap them.

However, I wonder if we should instead do a single "peripheral" for all these calibration values? Making one for each random calibration value is going to be a lot of churn. The 0x1FFFFxxxx area seems to be some kind of "factory OTP". UID also seems to be in that area. Where is this documented, does ST give some name to tihs "OTP calibration data" thing?

@esden
Copy link
Contributor Author

esden commented Jul 18, 2024

Yeah that is probably a good idea to keep all that stuff together.

Interestingly there is a bunch more info in that memory area. The "Device Electronic Signature" is also in the 0x1FFF 75xx memory area. Funnily enough in the memory map diagram that area is marked as reserved.

Screenshot 2024-07-18 at 1 03 00 PM

There is not a dedicated documentation for that memory area. It is all dispersed between the reference manual and the datasheet of the particular part. The addresses don't always have a corresponding define in the ST published headers either.

The VRef internal calibration value and Temperature Sensor value addresses are usually listed in the datasheet of each part. One can find it by searching for VREFINT and TS_CAL1/TS_CAL2. The device electronic signature addresses are usually in the reference manual in the section named "Device electronic signature". I have not checked how reliable it is to find the defines for that in the ST published headers.

For this particular patch I checked a few representative datasheets for each part family. I did not check them all to make sure there are no outliers.

If we want to make a consistent structure for all this information we should check what possible memory arrangements we have throughout the STM32 families. The unique device ID existed in STM32 devices since STM32F1, so we will probably need a bunch of different versions of this "peripheral".

Let me know your thoughts.

@esden
Copy link
Contributor Author

esden commented Jul 22, 2024

The memory containing the data is usually not named at all by ST, but when it is named something it is either "Factory Information" or "Engineering Bytes". I still thing "Factory OTP" is most descriptive even though ST does not use the term as far as I can tell.

As I could not find machine readable source of the memory locations I went ahead and spent the last 4 days compiling the values myself: https://docs.google.com/spreadsheets/d/1-ieFzBtAUM4z5IefX1OkKll63qaJ4KMeVZzAd5jBvVc/edit?usp=sharing it would be fantastic to at least get it spot checked by someone else. I am also happy to open a dedicated Issue to serve as the discussion thread for the new "peripheral".

If you need the data exported into something we can commit to the repository let me know. The data I collected also indicates that we will have quite a big work cut out for us to figure out how to divide the peripheral versions so that we can cover the sheer variability of the stuff.

Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants